1
1
package v1alpha1
2
2
3
3
import (
4
- v4 "k8s.io/api/rbac/v1"
5
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4
+ v4 "k8s.io/api/rbac/v1"
5
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
6
6
)
7
7
8
8
type AuthenticationSource string
@@ -16,57 +16,61 @@ type AuthenticationSource string
16
16
// +kubebuilder:printcolumn:JSONPath=".spec.description",name=Description,type=string
17
17
// +kubebuilder:field:scope=Cluster
18
18
type Group struct {
19
- metav1.TypeMeta `json:",inline"`
20
- metav1.ObjectMeta `json:"metadata,omitempty"`
19
+ metav1.TypeMeta `json:",inline"`
20
+ metav1.ObjectMeta `json:"metadata,omitempty"`
21
21
22
- Spec GroupSpec `json:"spec"`
22
+ Spec GroupSpec `json:"spec"`
23
23
}
24
24
25
25
type GroupSpec struct {
26
- DisplayName string `json:"displayName"`
27
- Description string `json:"description"`
28
- Permissions []v4.PolicyRule `json:"permissions"ƒ`
29
- Namespaces []string `json:"namespaces"`
30
- ClusterGroup bool `json:"clusterGroup"`
26
+ DisplayName string `json:"displayName"`
27
+ Description string `json:"description"`
28
+ Permissions []v4.PolicyRule `json:"permissions"ƒ`
29
+ Namespaces []string `json:"namespaces"`
30
+ ClusterGroup bool `json:"clusterGroup"`
31
31
}
32
32
33
33
// +genclient
34
34
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
35
35
// +genclient:noStatus
36
36
// +kubebuilder:printcolumn:JSONPath=".spec.type",name=Source Type,type=string
37
37
type SynchronisationSource struct {
38
- metav1.TypeMeta `json:",inline"`
39
- metav1.ObjectMeta `json:"metadata,omitempty"`
38
+ metav1.TypeMeta `json:",inline"`
39
+ metav1.ObjectMeta `json:"metadata,omitempty"`
40
40
41
- Spec SynchronisationSourceSpec `json:"spec"`
41
+ Spec SynchronisationSourceSpec `json:"spec"`
42
42
}
43
43
44
44
type SynchronisationSourceSpec struct {
45
- // +kubebuilder:validation:Enum=authentik;ldap
46
- Type string `json:"type"`
47
- // +kubebuilder:validation:Optional
48
- Authentik * AuthentikSynchronisationSourceSpec `json:"authentik"`
49
- // GroupMappings should be a map internal group identifier => Kubernetes Group Name
50
- // This is useful when your IdP or SyncSource returns some kind of UUID for the groups,
51
- // but you want human-readable named groups in the cluster
52
- GroupMappings map [string ]string `json:"groupMappings"`
45
+ // +kubebuilder:validation:Enum=authentik;ldap
46
+ Type string `json:"type"`
47
+ // +kubebuilder:validation:Optional
48
+ Authentik * AuthentikSynchronisationSourceSpec `json:"authentik"`
49
+ // GroupMappings should be a map internal group identifier => Kubernetes Group Name
50
+ // This is useful when your IdP or SyncSource returns some kind of UUID for the groups,
51
+ // but you want human-readable named groups in the cluster
52
+ GroupMappings map [string ]string `json:"groupMappings"`
53
+ // +kubebuilder:validation:Optional
54
+ // +kubebuilder:Optional
55
+ // +kubebuilder:validation:default:=[]
56
+ DefaultGroups * []string `json:"defaultGroups"`
53
57
}
54
58
55
59
type AuthentikSynchronisationSourceSpec struct {
56
- URL string `json:"url"`
57
- Scheme string `json:"scheme"`
58
- SecretName string `json:"secretName"`
59
- // RequiredGroups is a list where a user only gets considered for this data source once they are a member of at least one of these groups
60
- // Leaving this array empty will autopass all users
61
- RequiredGroups []string `json:"requiredGroups"`
60
+ URL string `json:"url"`
61
+ Scheme string `json:"scheme"`
62
+ SecretName string `json:"secretName"`
63
+ // RequiredGroups is a list where a user only gets considered for this data source once they are a member of at least one of these groups
64
+ // Leaving this array empty will autopass all users
65
+ RequiredGroups []string `json:"requiredGroups"`
62
66
}
63
67
64
68
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
65
69
type SynchronisationSourceList struct {
66
- metav1.TypeMeta `json:",inline"`
67
- metav1.ListMeta `json:"metadata"`
70
+ metav1.TypeMeta `json:",inline"`
71
+ metav1.ListMeta `json:"metadata"`
68
72
69
- Items []SynchronisationSource `json:"items"`
73
+ Items []SynchronisationSource `json:"items"`
70
74
}
71
75
72
76
// +genclient
@@ -75,32 +79,32 @@ type SynchronisationSourceList struct {
75
79
// +kubebuilder:printcolumn:JSONPath=".spec.authenticationSource",name=Authentication Source,type=string
76
80
// +kubebuilder:printcolumn:JSONPath=".spec.displayName",name=Display Name,type=string
77
81
type User struct {
78
- metav1.TypeMeta `json:",inline"`
79
- metav1.ObjectMeta `json:"metadata,omitempty"`
82
+ metav1.TypeMeta `json:",inline"`
83
+ metav1.ObjectMeta `json:"metadata,omitempty"`
80
84
81
- Spec UserSpec `json:"spec"`
85
+ Spec UserSpec `json:"spec"`
82
86
}
83
87
84
88
type UserSpec struct {
85
- DisplayName string `json:"displayName"`
86
- AuthenticationSource string `json:"authenticationSource"`
87
- GroupMemberships []string `json:"groupMemberships"`
89
+ DisplayName string `json:"displayName"`
90
+ AuthenticationSource string `json:"authenticationSource"`
91
+ GroupMemberships []string `json:"groupMemberships"`
88
92
}
89
93
90
94
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
91
95
92
96
type GroupList struct {
93
- metav1.TypeMeta `json:",inline"`
94
- metav1.ListMeta `json:"metadata"`
97
+ metav1.TypeMeta `json:",inline"`
98
+ metav1.ListMeta `json:"metadata"`
95
99
96
- Items []Group `json:"items"`
100
+ Items []Group `json:"items"`
97
101
}
98
102
99
103
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
100
104
101
105
type UserList struct {
102
- metav1.TypeMeta `json:",inline"`
103
- metav1.ListMeta `json:"metadata"`
106
+ metav1.TypeMeta `json:",inline"`
107
+ metav1.ListMeta `json:"metadata"`
104
108
105
- Items []User `json:"items"`
109
+ Items []User `json:"items"`
106
110
}
0 commit comments