/
types.go
80 lines (61 loc) · 2.82 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
package v1
import (
"k8s.io/kubernetes/pkg/api/unversioned"
kapi "k8s.io/kubernetes/pkg/api/v1"
)
// Auth system gets identity name and provider
// POST to UserIdentityMapping, get back error or a filled out UserIdentityMapping object
type User struct {
unversioned.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
FullName string `json:"fullName,omitempty" description:"full name of user"`
Identities []string `json:"identities" description:"list of identities"`
Groups []string `json:"groups" description:"list of groups"`
}
type UserList struct {
unversioned.TypeMeta `json:",inline"`
unversioned.ListMeta `json:"metadata,omitempty"`
Items []User `json:"items" description:"list of users"`
}
type Identity struct {
unversioned.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
// ProviderName is the source of identity information
ProviderName string `json:"providerName" description:"source of identity information"`
// ProviderUserName uniquely represents this identity in the scope of the provider
ProviderUserName string `json:"providerUserName" description:"uniquely represents this identity in the scope of the provider"`
// User is a reference to the user this identity is associated with
// Both Name and UID must be set
User kapi.ObjectReference `json:"user" description:"reference to the user this identity is associated with. both name and uid must be set"`
Extra map[string]string `json:"extra,omitempty" description:"extra information for this identity"`
}
type IdentityList struct {
unversioned.TypeMeta `json:",inline"`
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Identity `json:"items" description:"list of identities"`
}
type UserIdentityMapping struct {
unversioned.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
Identity kapi.ObjectReference `json:"identity,omitempty" description:"reference to an identity"`
User kapi.ObjectReference `json:"user,omitempty" description:"reference to a user"`
}
// Group represents a referenceable set of Users
type Group struct {
unversioned.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
// Users is the list of users in this group.
Users []string `json:"users" description:"list of users in this group"`
}
type GroupList struct {
unversioned.TypeMeta `json:",inline"`
unversioned.ListMeta `json:"metadata,omitempty"`
Items []Group `json:"items" description:"list of groups"`
}
func (*GroupList) IsAnAPIObject() {}
func (*Group) IsAnAPIObject() {}
func (*User) IsAnAPIObject() {}
func (*UserList) IsAnAPIObject() {}
func (*Identity) IsAnAPIObject() {}
func (*IdentityList) IsAnAPIObject() {}
func (*UserIdentityMapping) IsAnAPIObject() {}