@@ -771,6 +771,12 @@ jwt:
771
771
expression: 'claims.sub'
772
772
# extra attributes to be added to the UserInfo object. Keys must be domain-prefix path and must be unique.
773
773
extra:
774
+ # key is a string to use as the extra attribute key.
775
+ # key must be a domain-prefix path (e.g. example.org/foo). All characters before the first "/" must be a valid
776
+ # subdomain as defined by RFC 1123. All characters trailing the first "/" must
777
+ # be valid HTTP Path characters as defined by RFC 3986.
778
+ # k8s.io, kubernetes.io and their subdomains are reserved for Kubernetes use and cannot be used.
779
+ # key must be lowercase and unique across all extra attributes.
774
780
- key: 'example.com/tenant'
775
781
# valueExpression is a CEL expression that evaluates to a string or a list of strings.
776
782
valueExpression: 'claims.tenant'
@@ -869,6 +875,12 @@ jwt:
869
875
expression: 'claims.sub'
870
876
# 要添加到 UserInfo 对象的其他属性,键必须是域前缀路径并且必须是唯一的。
871
877
extra:
878
+ # key 是用作额外属性键的字符串。
879
+ # key 必须是域名前缀路径(例如 example.org/foo)。
880
+ # 第一个 "/" 之前的所有字符必须是 RFC 1123 定义的有效子域名。
881
+ # 第一个 "/" 之后的所有字符必须是 RFC 3986 定义的有效 HTTP 路径字符。
882
+ # k8s.io, kubernetes.io 及其子域名保留供 Kubernetes 使用,不能使用。
883
+ # key 必须是小写,并且在所有额外属性中唯一。
872
884
- key: 'example.com/tenant'
873
885
# valueExpression 是一个计算结果为字符串或字符串列表的 CEL 表达式。
874
886
valueExpression: 'claims.tenant'
@@ -1901,13 +1913,12 @@ that grant access to the `*` user or `*` group do not include anonymous users.
1901
1913
1902
1914
<!--
1903
1915
The `AuthenticationConfiguration` can be used to configure the anonymous
1904
- authenticator. To enable configuring anonymous auth via the config file you need
1905
- enable the `AnonymousAuthConfigurableEndpoints` feature gate. When this feature
1906
- gate is enabled you cannot set the `--anonymous-auth` flag.
1916
+ authenticator. If you set the anonymous field in the `AuthenticationConfiguration`
1917
+ file then you cannot set the `--anonymous-auth` flag.
1907
1918
-->
1908
1919
` AuthenticationConfiguration` 可用于配置匿名身份认证模块。
1909
- 要通过配置文件启用匿名身份认证配置,你需要启用 `AnonymousAuthConfigurableEndpoints` 特性门控。
1910
- 当此特性门控被启用时,你不能设置 `--anonymous-auth` 标志。
1920
+ 如果你在 `AuthenticationConfiguration` 文件中设置了 anonymous 字段,
1921
+ 那么你不能设置 `--anonymous-auth` 标志。
1911
1922
1912
1923
<!--
1913
1924
The main advantage of configuring anonymous authenticator using the authentication
@@ -2132,6 +2143,19 @@ for UIDs, a user should be granted the following role:
2132
2143
附加字段会被作为 `userextras` 资源的子资源来执行权限评估。
2133
2144
如果要允许用户为附加字段 “scopes” 和 UID 设置伪装头部,该用户需要被授予以下角色:
2134
2145
2146
+ <!--
2147
+ ` ` ` yaml
2148
+ apiVersion: rbac.authorization.k8s.io/v1
2149
+ kind: ClusterRole
2150
+ metadata:
2151
+ name: scopes-and-uid-impersonator
2152
+ rules:
2153
+ # Can set "Impersonate-Extra-scopes" header and the "Impersonate-Uid" header.
2154
+ - apiGroups: ["authentication.k8s.io"]
2155
+ resources: ["userextras/scopes", "uids"]
2156
+ verbs: ["impersonate"]
2157
+ ` ` `
2158
+ -->
2135
2159
` ` ` yaml
2136
2160
apiVersion: rbac.authorization.k8s.io/v1
2137
2161
kind: ClusterRole
@@ -2150,6 +2174,38 @@ of `resourceNames` a resource can take.
2150
2174
-->
2151
2175
你也可以通过约束资源可能对应的 `resourceNames` 限制伪装头部的取值:
2152
2176
2177
+ <!--
2178
+ ` ` ` yaml
2179
+ apiVersion: rbac.authorization.k8s.io/v1
2180
+ kind: ClusterRole
2181
+ metadata:
2182
+ name: limited-impersonator
2183
+ rules:
2184
+ # Can impersonate the user "[email protected] "
2185
+ - apiGroups: [""]
2186
+ resources: ["users"]
2187
+ verbs: ["impersonate"]
2188
+ resourceNames: ["[email protected] "]
2189
+
2190
+ # Can impersonate the groups "developers" and "admins"
2191
+ - apiGroups: [""]
2192
+ resources: ["groups"]
2193
+ verbs: ["impersonate"]
2194
+ resourceNames: ["developers","admins"]
2195
+
2196
+ # Can impersonate the extras field "scopes" with the values "view" and "development"
2197
+ - apiGroups: ["authentication.k8s.io"]
2198
+ resources: ["userextras/scopes"]
2199
+ verbs: ["impersonate"]
2200
+ resourceNames: ["view", "development"]
2201
+
2202
+ # Can impersonate the uid "06f6ce97-e2c5-4ab8-7ba5-7654dd08d52b"
2203
+ - apiGroups: ["authentication.k8s.io"]
2204
+ resources: ["uids"]
2205
+ verbs: ["impersonate"]
2206
+ resourceNames: ["06f6ce97-e2c5-4ab8-7ba5-7654dd08d52b"]
2207
+ ` ` `
2208
+ -->
2153
2209
` ` ` yaml
2154
2210
apiVersion: rbac.authorization.k8s.io/v1
2155
2211
kind: ClusterRole
@@ -2574,6 +2630,17 @@ the binary `/home/jane/bin/example-client-go-exec-plugin` is executed.
2574
2630
` ./bin/example-client-go-exec-plugin` ,则要执行的可执行文件为
2575
2631
` /home/jane/bin/example-client-go-exec-plugin` 。
2576
2632
2633
+ <!--
2634
+ ` ` ` yaml
2635
+ - name: my-user
2636
+ user:
2637
+ exec:
2638
+ # Path relative to the directory of the kubeconfig
2639
+ command: "./bin/example-client-go-exec-plugin"
2640
+ apiVersion: "client.authentication.k8s.io/v1"
2641
+ interactiveMode: Never
2642
+ ` ` `
2643
+ -->
2577
2644
` ` ` yaml
2578
2645
- name: my-user
2579
2646
user:
0 commit comments