forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauthorizetoken.go
32 lines (25 loc) · 1.02 KB
/
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
32
package test
import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"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, labels labels.Selector) (*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
}