forked from openshift/origin
/
types.go
109 lines (81 loc) · 4.11 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
package api
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
)
type AccessToken struct {
api.TypeMeta `json:",inline" yaml:",inline"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
// Name is the unique value for an access token - also known as its secret
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// AuthorizeToken is the authorization token that granted this access token, and contains
// the specific state of the token.
AuthorizeToken AuthorizeToken `json:"authorizeToken,omitempty" yaml:"authorizeToken,omitempty"`
// RefreshToken is the value by which this token can be renewed. Can be blank.
RefreshToken string `json:"refreshToken,omitempty" yaml:"refreshToken,omitempty"`
}
type AuthorizeToken struct {
api.TypeMeta `json:",inline" yaml:",inline"`
// Name is the unique value for an authorization token - also known as its secret
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// ClientName references the client that created this token.
ClientName string `json:"clientName,omitempty" yaml:"clientName,omitempty"`
// ExpiresIn is the seconds from CreationTime before this token expires.
ExpiresIn int64 `json:"expiresIn,omitempty" yaml:"expiresIn,omitempty"`
// Scopes is an array of the requested scopes.
Scopes []string `json:"scopes,omitempty" yaml:"scopes,omitempty"`
// RedirectURI is the redirection associated with the token.
RedirectURI string `json:"redirectURI,omitempty" yaml:"redirectURI,omitempty"`
// State data from request
State string `json:"state,omitempty" yaml:"state,omitempty"`
// UserName is the user name associated with this token
UserName string `json:"userName,omitempty" yaml:"userName,omitempty"`
// 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" yaml:"userUID,omitempty"`
}
type Client struct {
api.TypeMeta `json:",inline" yaml:",inline"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
// Name is the unique identifier of the client
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// Secret is the unique secret associated with a client
Secret string `json:"secret,omitempty" yaml:"secret,omitempty"`
// RedirectURIs is the valid redirection URIs associated with a client
RedirectURIs []string `json:"redirectURIs,omitempty" yaml:"redirectURIs,omitempty"`
}
type ClientAuthorization struct {
api.TypeMeta `json:",inline" yaml:",inline"`
// ClientName references the client that created this authorization
ClientName string `json:"clientName,omitempty" yaml:"clientName,omitempty"`
// UserName is the user name that authorized this client
UserName string `json:"userName,omitempty" yaml:"userName,omitempty"`
// 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" yaml:"userUID,omitempty"`
// Scopes is an array of the granted scopes.
Scopes []string `json:"scopes,omitempty" yaml:"scopes,omitempty"`
}
type AccessTokenList struct {
api.TypeMeta `json:",inline" yaml:",inline"`
Items []AccessToken `json:"items,omitempty" yaml:"items,omitempty"`
}
type AuthorizeTokenList struct {
api.TypeMeta `json:",inline" yaml:",inline"`
Items []AuthorizeToken `json:"items,omitempty" yaml:"items,omitempty"`
}
type ClientList struct {
api.TypeMeta `json:",inline" yaml:",inline"`
Items []Client `json:"items,omitempty" yaml:"items,omitempty"`
}
type ClientAuthorizationList struct {
api.TypeMeta `json:",inline" yaml:",inline"`
Items []ClientAuthorization `json:"items,omitempty" yaml:"items,omitempty"`
}
func (*AccessToken) IsAnAPIObject() {}
func (*AuthorizeToken) IsAnAPIObject() {}
func (*Client) IsAnAPIObject() {}
func (*AccessTokenList) IsAnAPIObject() {}
func (*AuthorizeTokenList) IsAnAPIObject() {}
func (*ClientList) IsAnAPIObject() {}
func (*ClientAuthorization) IsAnAPIObject() {}
func (*ClientAuthorizationList) IsAnAPIObject() {}