func (s *UserConversion) ConvertToAccessToken(user interface{}, token *oapi.OAuthAccessToken) error { info, ok := user.(kuser.Info) if !ok { return errors.New("did not receive user.Info") } token.UserName = info.GetName() if token.UserName == "" { return errors.New("user name is empty") } token.UserUID = info.GetUID() return nil }
func (u *testUser) ConvertToAccessToken(_ interface{}, token *api.OAuthAccessToken) error { token.UserName = u.UserName token.UserUID = u.UserUID return u.Err }