Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for IsResourceRequest (0.2 sec)

  1. staging/src/k8s.io/apiserver/pkg/storage/selection_predicate_test.go

    			labelSelector: "",
    			fieldSelector: "",
    			indexLabels:   []string{},
    			indexFields:   []string{"metadata.namespace"},
    			ctx: request.WithRequestInfo(context.Background(), &request.RequestInfo{
    				IsResourceRequest: true,
    				Path:              "/api/v1/namespaces/default/pods",
    				Verb:              "list",
    				APIPrefix:         "api",
    				APIGroup:          "",
    				APIVersion:        "v1",
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Nov 30 10:39:09 UTC 2023
    - 8.6K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go

    	// GetAPIVersion returns the version of the group requested, if a request is for a REST object.
    	GetAPIVersion() string
    
    	// IsResourceRequest returns true for requests to API resources, like /api/v1/nodes,
    	// and false for non-resource endpoints like /api, /healthz
    	IsResourceRequest() bool
    
    	// GetPath returns the path of the request
    	GetPath() string
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 06 14:36:14 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/caching_authorizer.go

    	GetUser() user.Info
    	GetVerb() string
    	IsReadOnly() bool
    	GetNamespace() string
    	GetResource() string
    	GetSubresource() string
    	GetName() string
    	GetAPIGroup() string
    	GetAPIVersion() string
    	IsResourceRequest() bool
    	GetPath() string
    })(nil)
    
    // The user info accessors known to cache key construction. If this fails to compile, the cache
    // implementation may need to be updated.
    var _ user.Info = (interface {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 12 18:58:24 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  4. plugin/pkg/auth/authorizer/rbac/rbac.go

    	// Build a detailed log of the denial.
    	// Make the whole block conditional so we don't do a lot of string-building we won't use.
    	if klogV := klog.V(5); klogV.Enabled() {
    		var operation string
    		if requestAttributes.IsResourceRequest() {
    			b := &bytes.Buffer{}
    			b.WriteString(`"`)
    			b.WriteString(requestAttributes.GetVerb())
    			b.WriteString(`" resource "`)
    			b.WriteString(requestAttributes.GetResource())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 24 10:13:50 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/audit/policy/checker.go

    	}
    
    	return true
    }
    
    // Check whether the rule's non-resource URLs match the request attrs.
    func ruleMatchesNonResource(r *audit.PolicyRule, attrs authorizer.Attributes) bool {
    	if attrs.IsResourceRequest() {
    		return false
    	}
    
    	path := attrs.GetPath()
    	for _, spec := range r.NonResourceURLs {
    		if pathMatches(path, spec) {
    			return true
    		}
    	}
    
    	return false
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 02 22:24:14 UTC 2022
    - 6.1K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/endpoints/filters/traces.go

    		otelhttp.WithTracerProvider(tp),
    		otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string {
    			ctx := r.Context()
    			info, exist := request.RequestInfoFrom(ctx)
    			if !exist || !info.IsResourceRequest {
    				return r.Method
    			}
    			return getSpanNameFromRequestInfo(info, r)
    		}),
    	}
    	wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 15 01:42:42 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  7. pkg/auth/authorizer/abac/abac.go

    	if !p.Spec.Readonly {
    		return true
    	}
    
    	return false
    }
    
    func nonResourceMatches(p abac.Policy, a authorizer.Attributes) bool {
    	// A non-resource policy cannot match a resource request
    	if !a.IsResourceRequest() {
    		// Allow wildcard match
    		if p.Spec.NonResourcePath == "*" {
    			return true
    		}
    		// Allow exact match
    		if p.Spec.NonResourcePath == a.GetPath() {
    			return true
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 11 03:11:30 UTC 2021
    - 7.4K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/endpoints/filters/authorization.go

    	if !found {
    		return nil, errors.New("no RequestInfo found in the context")
    	}
    
    	// Start with common attributes that apply to resource and non-resource requests
    	attribs.ResourceRequest = requestInfo.IsResourceRequest
    	attribs.Path = requestInfo.Path
    	attribs.Verb = requestInfo.Verb
    
    	attribs.APIGroup = requestInfo.APIGroup
    	attribs.APIVersion = requestInfo.APIVersion
    	attribs.Resource = requestInfo.Resource
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 20 13:35:55 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/apf_filter_test.go

    	})
    	if err != nil {
    		t.Errorf("expected the controller to reconcile the priority level configuration object: %s, error: %s", plcObj.Name, err)
    	}
    
    	reqInfo := &request.RequestInfo{
    		IsResourceRequest: false,
    		Path:              "/foobar",
    		Verb:              "GET",
    	}
    	noteFn := func(fs *flowcontrol.FlowSchema, plc *flowcontrol.PriorityLevelConfiguration, fd string) {}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 30 12:18:40 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/rule.go

    }
    
    func matchesPolicyRule(digest RequestDigest, policyRule *flowcontrol.PolicyRulesWithSubjects) bool {
    	if !matchesASubject(digest.User, policyRule.Subjects) {
    		return false
    	}
    	if digest.RequestInfo.IsResourceRequest {
    		return matchesAResourceRule(digest.RequestInfo, policyRule.ResourceRules)
    	}
    	return matchesANonResourceRule(digest.RequestInfo, policyRule.NonResourceRules)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 30 12:18:35 UTC 2023
    - 6.3K bytes
    - Viewed (0)
Back to top