Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for requestFunc (0.17 sec)

  1. staging/src/k8s.io/apiserver/pkg/authentication/authenticator/interfaces.go

    	return f(ctx, token)
    }
    
    // RequestFunc is a function that implements the Request interface.
    type RequestFunc func(req *http.Request) (*Response, bool, error)
    
    // AuthenticateRequest implements authenticator.Request.
    func (f RequestFunc) AuthenticateRequest(req *http.Request) (*Response, bool, error) {
    	return f(req)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 12 00:55:47 UTC 2020
    - 2.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/authentication/group/group_adder_test.go

    	response := &authenticator.Response{User: &user.DefaultInfo{Name: "user", Groups: append(capacity, "original")}}
    	orig := toJson(response)
    
    	adder := authenticator.Request(
    		NewGroupAdder(
    			authenticator.RequestFunc(func(req *http.Request) (*authenticator.Response, bool, error) {
    				return response, true, nil
    			}),
    			[]string{"added"},
    		),
    	)
    
    	r, _, _ := adder.AuthenticateRequest(nil)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 11 20:04:50 UTC 2022
    - 3.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous.go

    )
    
    const (
    	anonymousUser = user.Anonymous
    
    	unauthenticatedGroup = user.AllUnauthenticated
    )
    
    func NewAuthenticator() authenticator.Request {
    	return authenticator.RequestFunc(func(req *http.Request) (*authenticator.Response, bool, error) {
    		auds, _ := authenticator.AudiencesFrom(req.Context())
    		return &authenticator.Response{
    			User: &user.DefaultInfo{
    				Name:   anonymousUser,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 31 21:50:11 UTC 2018
    - 1.2K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/endpoints/filters/authentication_test.go

    				http.HandlerFunc(func(_ http.ResponseWriter, req *http.Request) {
    					if tc.expectSuccess {
    						success = 1
    					} else {
    						t.Errorf("unexpected call to handler")
    					}
    				}),
    				authenticator.RequestFunc(func(req *http.Request) (*authenticator.Response, bool, error) {
    					if req.Header.Get("Authorization") == "Something" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 20.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go

    			Subresource:     scope.Subresource,
    			Namespace:       namespace,
    			Name:            name,
    		}
    
    		span.AddEvent("About to store object in database")
    		wasCreated := false
    		requestFunc := func() (runtime.Object, error) {
    			obj, created, err := r.Update(
    				ctx,
    				name,
    				rest.DefaultUpdatedObjectInfo(obj, transformers...),
    				withAuthorization(rest.AdmissionToValidateObjectFunc(
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 20:19:46 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/create.go

    			result, err := requestFunc()
    			// If the object wasn't committed to storage because it's serialized size was too large,
    			// it is safe to remove managedFields (which can be large) and try again.
    			if isTooLargeError(err) {
    				if accessor, accessorErr := meta.Accessor(obj); accessorErr == nil {
    					accessor.SetManagedFields(nil)
    					result, err = requestFunc()
    				}
    			}
    			return result, err
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 20:19:46 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/patch.go

    	}
    
    	transformers := []rest.TransformFunc{p.applyPatch, p.applyAdmission, dedupOwnerReferencesTransformer}
    
    	wasCreated := false
    	p.updatedObjectInfo = rest.DefaultUpdatedObjectInfo(nil, transformers...)
    	requestFunc := func() (runtime.Object, error) {
    		// Pass in UpdateOptions to override UpdateStrategy.AllowUpdateOnCreate
    		options := patchToUpdateOptions(p.options)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 28.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/endpoints/filters/metrics_test.go

    			done := make(chan struct{})
    			auth := WithAuthentication(
    				http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {
    					close(done)
    				}),
    				authenticator.RequestFunc(func(_ *http.Request) (*authenticator.Response, bool, error) {
    					return tt.response, tt.status, tt.err
    				}),
    				http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {
    					close(done)
    				}),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 20 13:35:55 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/server/config_test.go

    			t.Errorf(" Expected %v path which we did not get", p)
    		}
    	})
    }
    
    func TestAuthenticationAuditAnnotationsDefaultChain(t *testing.T) {
    	authn := authenticator.RequestFunc(func(req *http.Request) (*authenticator.Response, bool, error) {
    		// confirm that we can set an audit annotation in a handler before WithAudit
    		audit.AddAuditAnnotation(req.Context(), "pandas", "are awesome")
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 29 18:59:21 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509_test.go

    		req, _ := http.NewRequest("GET", "/", nil)
    		if !testCase.Insecure {
    			req.TLS = &tls.ConnectionState{PeerCertificates: testCase.Certs}
    		}
    
    		authCall := false
    		auth := authenticator.RequestFunc(func(req *http.Request) (*authenticator.Response, bool, error) {
    			authCall = true
    			return &authenticator.Response{User: &user.DefaultInfo{Name: "innerauth"}}, true, nil
    		})
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 02 23:23:03 UTC 2024
    - 36.9K bytes
    - Viewed (0)
Back to top