mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-29 21:01:02 +00:00
rebase authenticators onto new interface.
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
@@ -262,7 +263,7 @@ func TestTokenAuthenticator(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
func() {
|
||||
a := NewTokenAuthenticator(&lister{test.secrets})
|
||||
u, found, err := a.AuthenticateToken(test.token)
|
||||
resp, found, err := a.AuthenticateToken(context.Background(), test.token)
|
||||
if err != nil {
|
||||
t.Errorf("test %q returned an error: %v", test.name, err)
|
||||
return
|
||||
@@ -280,8 +281,7 @@ func TestTokenAuthenticator(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
gotUser := u.(*user.DefaultInfo)
|
||||
|
||||
gotUser := resp.User.(*user.DefaultInfo)
|
||||
if !reflect.DeepEqual(gotUser, test.wantUser) {
|
||||
t.Errorf("test %q want user=%#v, got=%#v", test.name, test.wantUser, gotUser)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user