forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
authorizetoken.go
31 lines (24 loc) · 968 Bytes
/
authorizetoken.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package test
import (
kapi "k8s.io/kubernetes/pkg/api"
"github.com/openshift/origin/pkg/oauth/api"
)
type AuthorizeTokenRegistry struct {
Err error
AuthorizeTokens *api.OAuthAuthorizeTokenList
AuthorizeToken *api.OAuthAuthorizeToken
DeletedAuthorizeTokenName string
}
func (r *AuthorizeTokenRegistry) ListAuthorizeTokens(ctx kapi.Context, options *kapi.ListOptions) (*api.OAuthAuthorizeTokenList, error) {
return r.AuthorizeTokens, r.Err
}
func (r *AuthorizeTokenRegistry) GetAuthorizeToken(ctx kapi.Context, name string) (*api.OAuthAuthorizeToken, error) {
return r.AuthorizeToken, r.Err
}
func (r *AuthorizeTokenRegistry) CreateAuthorizeToken(ctx kapi.Context, token *api.OAuthAuthorizeToken) (*api.OAuthAuthorizeToken, error) {
return r.AuthorizeToken, r.Err
}
func (r *AuthorizeTokenRegistry) DeleteAuthorizeToken(ctx kapi.Context, name string) error {
r.DeletedAuthorizeTokenName = name
return r.Err
}