-
Notifications
You must be signed in to change notification settings - Fork 2
/
structures.go
79 lines (65 loc) · 2.24 KB
/
structures.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
package main
type Json_decode_error struct {
Status string `json:"status"`
Details string `json:"details"`
}
type Auth_token struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Spec *Token `json:"spec"`
}
type Token struct {
Token string `json:"token"`
}
type Authenticated struct {
Authenticated bool `json:"authenticated"`
}
type AStatus struct {
Authenticated bool `json:"authenticated"`
Userinfo *Userinfo `json:"user"`
}
type Userinfo struct {
Username string `json:"username"`
UID string `json:"uid"`
Groups []string `json:"groups"`
}
type Auth_response_successfull struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Status *AStatus `json:"status"`
}
type Auth_unsuccessfull struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Status *Authenticated `json:"status"`
}
type SubjectAccessReview struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Spec *SubjectAccessReviewSpec `json:"spec"`
}
type SubjectAccessReviewSpec struct {
ResourceAttributes *SubjectAccessReviewSpecResourceAttributes `json:"resourceAttributes,omitempty"`
NonResourceAttributes *SubjectAccessReviewSpecNonResourceAttributes `json:"nonresourceAttributes,omitempty"`
User string `json:"user"`
Group []string `json:"group"`
}
type SubjectAccessReviewSpecNonResourceAttributes struct {
Path string `json:"path,omitempty"`
Verb string `json:"verb,omitempty"`
}
type SubjectAccessReviewSpecResourceAttributes struct {
Namespace string `json:"namespace,omitempty"`
Verb string `json:"verb,omitempty"`
Group string `json:"group,omitempty"`
Resource string `json:"resource,omitempty"`
}
type SubjectAccessReviewResponse struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Status *SubjectAccessReviewResponseStatus `json:"status"`
}
type SubjectAccessReviewResponseStatus struct {
Allowed bool `json:"allowed"`
Reason string `json:"reason,omitempty"`
}