Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for AuthenticateToken (0.36 sec)

  1. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go

    	a.AuthenticateToken(context.Background(), "bad1")
    	a.AuthenticateToken(context.Background(), "bad2")
    	a.AuthenticateToken(context.Background(), "bad3")
    	fakeClock.Step(2 * time.Microsecond)
    	a.AuthenticateToken(context.Background(), "bad1")
    	a.AuthenticateToken(context.Background(), "bad2")
    	a.AuthenticateToken(context.Background(), "bad3")
    	fakeClock.Step(2 * time.Microsecond)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 20.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook_v1_test.go

    				return
    			}
    
    			service.Deny()
    			_, authenticated, err = wh.AuthenticateToken(context.Background(), "t0k3n")
    			if err != nil {
    				t.Errorf("%s: unexpectedly failed AuthenticateToken", tt.test)
    			}
    			if authenticated {
    				t.Errorf("%s: incorrectly authenticated token", tt.test)
    			}
    		}()
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 18 00:47:42 UTC 2022
    - 19.1K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook_v1beta1_test.go

    				return
    			}
    
    			service.Deny()
    			_, authenticated, err = wh.AuthenticateToken(context.Background(), "t0k3n")
    			if err != nil {
    				t.Errorf("%s: unexpectedly failed AuthenticateToken", tt.test)
    			}
    			if authenticated {
    				t.Errorf("%s: incorrectly authenticated token", tt.test)
    			}
    		}()
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 18 00:47:42 UTC 2022
    - 19.2K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go

    	return &WebhookTokenAuthenticator{
    		tokenReview,
    		retryBackoff,
    		implicitAuds,
    		requestTimeout,
    		metrics,
    	}, nil
    }
    
    // AuthenticateToken implements the authenticator.Token interface.
    func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token string) (*authenticator.Response, bool, error) {
    	// We take implicit audiences of the API server at WebhookTokenAuthenticator
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 18 00:47:42 UTC 2022
    - 11.5K bytes
    - Viewed (0)
  5. pkg/serviceaccount/jwt_test.go

    		ctx := authenticator.WithAudiences(context.Background(), auds)
    		if _, ok, err := authn.AuthenticateToken(ctx, "invalid token"); err != nil || ok {
    			t.Errorf("%s: Expected err=nil, ok=false for non-JWT token", k)
    			continue
    		}
    
    		resp, ok, err := authn.AuthenticateToken(ctx, tc.Token)
    		if (err != nil) != tc.ExpectedErr {
    			t.Errorf("%s: Expected error=%v, got %v", k, tc.ExpectedErr, err)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 27 22:16:08 UTC 2024
    - 17K bytes
    - Viewed (0)
  6. pkg/serviceaccount/jwt.go

    	// call. This struct should contain fields for any private claims that the
    	// Validator requires to validate the JWT.
    	NewPrivateClaims() interface{}
    }
    
    func (j *jwtTokenAuthenticator) AuthenticateToken(ctx context.Context, tokenData string) (*authenticator.Response, bool, error) {
    	if !j.hasCorrectIssuer(tokenData) {
    		return nil, false, nil
    	}
    
    	tok, err := jwt.ParseSigned(tokenData)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 27 22:16:08 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  7. pkg/kubeapiserver/authenticator/config.go

    		tokenAuthenticators = append(tokenAuthenticators,
    			authenticator.TokenFunc(func(ctx context.Context, token string) (*authenticator.Response, bool, error) {
    				return jwtAuthenticatorPtr.Load().jwtAuthenticator.AuthenticateToken(ctx, token)
    			}),
    		)
    	}
    
    	if len(config.WebhookTokenAuthnConfigFile) > 0 {
    		webhookTokenAuth, err := newWebhookTokenAuthenticator(config)
    		if err != nil {
    			return nil, nil, nil, nil, err
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Mar 09 19:29:33 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go

    	}
    	if v.audiences.HasAny(t.Audience...) {
    		return nil
    	}
    
    	return fmt.Errorf("oidc: expected audience in %q got %q", sets.List(v.audiences), t.Audience)
    }
    
    func (a *jwtAuthenticator) AuthenticateToken(ctx context.Context, token string) (*authenticator.Response, bool, error) {
    	if !hasCorrectIssuer(a.jwtAuthenticator.Issuer.URL, token) {
    		return nil, false, nil
    	}
    
    	verifier, ok := a.idTokenVerifier()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Mar 09 19:29:33 UTC 2024
    - 37.9K bytes
    - Viewed (0)
Back to top