- Sort Score
- Result 10 results
- Languages All
Results 11 - 17 of 17 for AuthenticateToken (0.23 sec)
-
staging/src/k8s.io/apiserver/pkg/authentication/group/token_group_adder_test.go
authenticator.TokenFunc(func(ctx context.Context, token string) (*authenticator.Response, bool, error) { return response, true, nil }), []string{"added"}, ), ) r, _, _ := adder.AuthenticateToken(context.Background(), "") if !reflect.DeepEqual(r.User.GetGroups(), []string{"original", "added"}) { t.Errorf("Expected original,added groups, got %#v", r.User.GetGroups()) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 11 20:04:50 UTC 2022 - 1.6K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/authentication/request/bearertoken/bearertoken.go
// The space before the token case if len(parts) == 3 { warning.AddWarning(req.Context(), "", invalidTokenWithSpaceWarning) } return nil, false, nil } resp, ok, err := a.auth.AuthenticateToken(req.Context(), token) // if we authenticated successfully, go ahead and remove the bearer token so that no one // is ever tempted to use it inside of the API server if ok { req.Header.Del("Authorization") }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Apr 25 13:22:28 UTC 2022 - 2K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/authentication/token/tokenfile/tokenfile.go
tokens[record[0]] = obj if len(record) >= 4 { obj.Groups = strings.Split(record[3], ",") } } return &TokenAuthenticator{ tokens: tokens, }, nil } func (a *TokenAuthenticator) AuthenticateToken(ctx context.Context, value string) (*authenticator.Response, bool, error) { user, ok := a.tokens[value] if !ok { return nil, false, nil } return &authenticator.Response{User: user}, true, nil
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat May 16 11:54:27 UTC 2020 - 2.4K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/metrics_test.go
if err != nil { t.Error("failed to create client") return } _, _, err = wh.AuthenticateToken(context.Background(), "t0k3n") if scenario.wantErr { if err == nil { t.Errorf("expected error making authorization request: %v", err) } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jun 29 07:49:14 UTC 2021 - 3.7K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/authentication/request/websocket/protocol.go
if len(token) > 0 && len(filteredProtocols) == 0 { return nil, false, errors.New("missing additional subprotocol") } if len(token) == 0 { return nil, false, nil } resp, ok, err := a.auth.AuthenticateToken(req.Context(), token) // on success, remove the protocol with the token if ok { // https://tools.ietf.org/html/rfc6455#section-11.3.4 indicates the Sec-WebSocket-Protocol header may appear multiple times
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jun 07 18:21:43 UTC 2023 - 3.4K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/authentication/token/tokenfile/tokenfile_test.go
Ok: true, }, { Token: "token8", }, } for i, testCase := range testCases { resp, ok, err := auth.AuthenticateToken(context.Background(), testCase.Token) if testCase.User == nil { if resp != nil { t.Errorf("%d: unexpected non-nil user %#v", i, resp.User) } } else if !reflect.DeepEqual(testCase.User, resp.User) {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Oct 22 17:16:59 UTC 2018 - 3.6K bytes - Viewed (0) -
plugin/pkg/auth/authenticator/token/bootstrap/bootstrap_test.go
token: "foo" + "." + tokenSecret, wantNotFound: true, }, } for _, test := range tests { func() { a := NewTokenAuthenticator(&lister{test.secrets}) resp, found, err := a.AuthenticateToken(context.Background(), test.token) if err != nil { t.Errorf("test %q returned an error: %v", test.name, err) return } if !found { if !test.wantNotFound {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Feb 04 18:36:05 UTC 2020 - 8.3K bytes - Viewed (0)