forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fields.go
42 lines (37 loc) · 1.32 KB
/
fields.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
33
34
35
36
37
38
39
40
41
42
package oauth
import (
"fmt"
"k8s.io/apimachinery/pkg/fields"
runtime "k8s.io/apimachinery/pkg/runtime"
)
func OAuthAccessTokenFieldSelector(obj runtime.Object, fieldSet fields.Set) error {
oauthAccessToken, ok := obj.(*OAuthAccessToken)
if !ok {
return fmt.Errorf("%T not an OAuthAccessToken", obj)
}
fieldSet["clientName"] = oauthAccessToken.ClientName
fieldSet["userName"] = oauthAccessToken.UserName
fieldSet["userUID"] = oauthAccessToken.UserUID
fieldSet["authorizeToken"] = oauthAccessToken.AuthorizeToken
return nil
}
func OAuthAuthorizeTokenFieldSelector(obj runtime.Object, fieldSet fields.Set) error {
oauthAuthorizeToken, ok := obj.(*OAuthAuthorizeToken)
if !ok {
return fmt.Errorf("%T not an OAuthAuthorizeToken", obj)
}
fieldSet["clientName"] = oauthAuthorizeToken.ClientName
fieldSet["userName"] = oauthAuthorizeToken.UserName
fieldSet["userUID"] = oauthAuthorizeToken.UserUID
return nil
}
func OAuthClientAuthorizationFieldSelector(obj runtime.Object, fieldSet fields.Set) error {
oauthClientAuthorization, ok := obj.(*OAuthClientAuthorization)
if !ok {
return fmt.Errorf("%T not an OAuthAuthorizeToken", obj)
}
fieldSet["clientName"] = oauthClientAuthorization.ClientName
fieldSet["userName"] = oauthClientAuthorization.UserName
fieldSet["userUID"] = oauthClientAuthorization.UserUID
return nil
}