rebase authenticators onto new interface.

This commit is contained in:
Mike Danese
2018-10-15 15:17:36 -07:00
parent 11be171757
commit e5227216c0
61 changed files with 415 additions and 337 deletions

View File

@@ -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)
}