/
types.go
138 lines (107 loc) · 6.28 KB
/
types.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package v1
import (
"k8s.io/kubernetes/pkg/api/unversioned"
kapi "k8s.io/kubernetes/pkg/api/v1"
)
// OAuthAccessToken describes an OAuth access token
type OAuthAccessToken struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
kapi.ObjectMeta `json:"metadata,omitempty"`
// ClientName references the client that created this token.
ClientName string `json:"clientName,omitempty" description:"references the client that created this token"`
// ExpiresIn is the seconds from CreationTime before this token expires.
ExpiresIn int64 `json:"expiresIn,omitempty" description:"is the seconds from creation time before this token expires"`
// Scopes is an array of the requested scopes.
Scopes []string `json:"scopes,omitempty" description:"list of requested scopes"`
// RedirectURI is the redirection associated with the token.
RedirectURI string `json:"redirectURI,omitempty" description:"redirection URI associated with the token"`
// UserName is the user name associated with this token
UserName string `json:"userName,omitempty" description:"user name associated with this token"`
// UserUID is the unique UID associated with this token
UserUID string `json:"userUID,omitempty" description:"unique UID associated with this token"`
// AuthorizeToken contains the token that authorized this token
AuthorizeToken string `json:"authorizeToken,omitempty" description:"contains the token that authorized this token"`
// RefreshToken is the value by which this token can be renewed. Can be blank.
RefreshToken string `json:"refreshToken,omitempty" description:"optional value by which this token can be renewed"`
}
// OAuthAuthorizeToken describes an OAuth authorization token
type OAuthAuthorizeToken struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
kapi.ObjectMeta `json:"metadata,omitempty"`
// ClientName references the client that created this token.
ClientName string `json:"clientName,omitempty" description:"references the client that created this token"`
// ExpiresIn is the seconds from CreationTime before this token expires.
ExpiresIn int64 `json:"expiresIn,omitempty" description:"seconds from creation time before this token expires"`
// Scopes is an array of the requested scopes.
Scopes []string `json:"scopes,omitempty" description:"list of requested scopes"`
// RedirectURI is the redirection associated with the token.
RedirectURI string `json:"redirectURI,omitempty" description:"redirection URI associated with the token"`
// State data from request
State string `json:"state,omitempty" description:"state data from request"`
// UserName is the user name associated with this token
UserName string `json:"userName,omitempty" description:"user name associated with this token"`
// UserUID is the unique UID associated with this token. UserUID and UserName must both match
// for this token to be valid.
UserUID string `json:"userUID,omitempty" description:"unique UID associated with this token. userUID and userName must both match for this token to be valid"`
}
// OAuthClient describes an OAuth client
type OAuthClient struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
kapi.ObjectMeta `json:"metadata,omitempty"`
// Secret is the unique secret associated with a client
Secret string `json:"secret,omitempty" description:"unique secret associated with a client"`
// RespondWithChallenges indicates whether the client wants authentication needed responses made in the form of challenges instead of redirects
RespondWithChallenges bool `json:"respondWithChallenges,omitempty" description:"indicates whether the client wants authentication needed responses made in the form of challenges instead of redirects"`
// RedirectURIs is the valid redirection URIs associated with a client
RedirectURIs []string `json:"redirectURIs,omitempty" description:"valid redirection URIs associated with a client"`
}
// OAuthClientAuthorization describes an authorization created by an OAuth client
type OAuthClientAuthorization struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
kapi.ObjectMeta `json:"metadata,omitempty"`
// ClientName references the client that created this authorization
ClientName string `json:"clientName,omitempty" description:"references the client that created this authorization"`
// UserName is the user name that authorized this client
UserName string `json:"userName,omitempty" description:"user name that authorized this client"`
// UserUID is the unique UID associated with this authorization. UserUID and UserName
// must both match for this authorization to be valid.
UserUID string `json:"userUID,omitempty" description:"unique UID associated with this authorization. userUID and userName must both match for this authorization to be valid"`
// Scopes is an array of the granted scopes.
Scopes []string `json:"scopes,omitempty" description:"list of granted scopes"`
}
// OAuthAccessTokenList is a collection of OAuth access tokens
type OAuthAccessTokenList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of OAuth access tokens
Items []OAuthAccessToken `json:"items" description:"list of oauth access tokens"`
}
// OAuthAuthorizeTokenList is a collection of OAuth authorization tokens
type OAuthAuthorizeTokenList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of OAuth authorization tokens
Items []OAuthAuthorizeToken `json:"items" description:"list of oauth authorization tokens"`
}
// OAuthClientList is a collection of OAuth clients
type OAuthClientList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of OAuth clients
Items []OAuthClient `json:"items" description:"list of oauth clients"`
}
// OAuthClientAuthorizationList is a collection of OAuth client authorizations
type OAuthClientAuthorizationList struct {
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of OAuth client authorizations
Items []OAuthClientAuthorization `json:"items" description:"list of oauth client authorizations"`
}