Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for authorizeFunc (0.23 sec)

  1. pkg/kubelet/server/server_test.go

    	return nil, nil
    }
    
    type fakeAuth struct {
    	authenticateFunc func(*http.Request) (*authenticator.Response, bool, error)
    	attributesFunc   func(user.Info, *http.Request) authorizer.Attributes
    	authorizeFunc    func(authorizer.Attributes) (authorized authorizer.Decision, reason string, err error)
    }
    
    func (f *fakeAuth) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 51.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/authorization/authorizer/interfaces.go

    // authorized, otherwise it returns an error.
    type Authorizer interface {
    	Authorize(ctx context.Context, a Attributes) (authorized Decision, reason string, err error)
    }
    
    type AuthorizerFunc func(ctx context.Context, a Attributes) (Decision, string, error)
    
    func (f AuthorizerFunc) Authorize(ctx context.Context, a Attributes) (Decision, string, error) {
    	return f(ctx, a)
    }
    
    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/authorization/path/path.go

    			return nil, fmt.Errorf("only trailing * allowed in %q", p)
    		}
    		if strings.HasSuffix(p, "*") {
    			prefixes = append(prefixes, p[:len(p)-1])
    		} else {
    			paths.Insert(p)
    		}
    	}
    
    	return authorizer.AuthorizerFunc(func(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) {
    		if a.IsResourceRequest() {
    			return authorizer.DecisionNoOpinion, "", nil
    		}
    
    		pth := strings.TrimPrefix(a.GetPath(), "/")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 09 13:47:19 UTC 2021
    - 1.9K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/caching_authorizer_test.go

    				},
    			},
    		},
    	} {
    		t.Run(tc.name, func(t *testing.T) {
    			var misses int
    			frontend := newCachingAuthorizer(func() authorizer.Authorizer {
    				return authorizer.AuthorizerFunc(func(_ context.Context, attributes authorizer.Attributes) (authorizer.Decision, string, error) {
    					if misses >= len(tc.backend) {
    						t.Fatalf("got more than expected %d backend invocations", len(tc.backend))
    					}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 12 18:58:24 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  5. pkg/registry/rbac/clusterrole/policybased/storage_test.go

    	bob := &user.DefaultInfo{Name: "bob"}
    	steve := &user.DefaultInfo{Name: "steve"}
    	alice := &user.DefaultInfo{Name: "alice"}
    
    	authzCalled := 0
    	fakeStorage := &fakeStorage{}
    	fakeAuthorizer := authorizer.AuthorizerFunc(func(ctx context.Context, attr authorizer.Attributes) (authorizer.Decision, string, error) {
    		authzCalled++
    		if attr.GetUser().GetName() == "steve" {
    			return authorizer.DecisionAllow, "", nil
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 09 13:47:19 UTC 2021
    - 6.2K bytes
    - Viewed (0)
  6. pkg/registry/rbac/role/policybased/storage_test.go

    	bob := &user.DefaultInfo{Name: "bob"}
    	steve := &user.DefaultInfo{Name: "steve"}
    	alice := &user.DefaultInfo{Name: "alice"}
    
    	authzCalled := 0
    	fakeStorage := &fakeStorage{}
    	fakeAuthorizer := authorizer.AuthorizerFunc(func(ctx context.Context, attr authorizer.Attributes) (authorizer.Decision, string, error) {
    		authzCalled++
    		if attr.GetUser().GetName() == "steve" {
    			return authorizer.DecisionAllow, "", nil
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 09 13:47:19 UTC 2021
    - 6.3K bytes
    - Viewed (0)
Back to top