-
Notifications
You must be signed in to change notification settings - Fork 0
/
accesstoken.go
32 lines (25 loc) · 976 Bytes
/
accesstoken.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 AccessTokenRegistry struct {
Err error
AccessTokens *api.OAuthAccessTokenList
AccessToken *api.OAuthAccessToken
DeletedAccessTokenName string
}
func (r *AccessTokenRegistry) ListAccessTokens(ctx kapi.Context, labels labels.Selector) (*api.OAuthAccessTokenList, error) {
return r.AccessTokens, r.Err
}
func (r *AccessTokenRegistry) GetAccessToken(ctx kapi.Context, name string) (*api.OAuthAccessToken, error) {
return r.AccessToken, r.Err
}
func (r *AccessTokenRegistry) CreateAccessToken(ctx kapi.Context, token *api.OAuthAccessToken) (*api.OAuthAccessToken, error) {
return r.AccessToken, r.Err
}
func (r *AccessTokenRegistry) DeleteAccessToken(ctx kapi.Context, name string) error {
r.DeletedAccessTokenName = name
return r.Err
}