Skip to content

Commit 3882310

Browse files
committed
Update milestone and test plan section for SelfSubjectReview KEP
Signed-off-by: m.nabokikh <[email protected]>
1 parent a4b5f5c commit 3882310

File tree

2 files changed

+27
-47
lines changed

2 files changed

+27
-47
lines changed

keps/sig-auth/3325-self-subject-attributes-review-api/README.md

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# KEP-3325: Self subject attributes review API
1+
# KEP-3325: Self subject review API
22

33
<!-- toc -->
44
- [Release Signoff Checklist](#release-signoff-checklist)
@@ -39,10 +39,10 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
3939
- [ ] (R) Design details are appropriately documented
4040
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
4141
- [ ] e2e Tests for all Beta API Operations (endpoints)
42-
- [ ] (R) Ensure GA e2e tests for meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
42+
- [ ] (R) Ensure GA e2e tests for meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
4343
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
4444
- [ ] (R) Graduation criteria is in place
45-
- [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
45+
- [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
4646
- [ ] (R) Production readiness review completed
4747
- [ ] (R) Production readiness review approved
4848
- [ ] "Implementation History" section is up-to-date for milestone
@@ -77,7 +77,7 @@ The motivation for this KEP is to reduce obscurity and help users with debugging
7777

7878
## Proposal
7979

80-
Add a new API endpoint to the `authentication.k8s.io` group - `SelfSubjectAttributesReview`.
80+
Add a new API endpoint to the `authentication.k8s.io` group - `SelfSubjectReview`.
8181
The user will hit the endpoint after authentication happens, so all attributes will be available to return.
8282

8383
## Design Details
@@ -89,18 +89,18 @@ The endpoint has no input parameters or a `spec` field because only the authenti
8989

9090
The structure for building a request:
9191
```go
92-
type SelfSubjectAttributesReview struct {
92+
type SelfSubjectReview struct {
9393
metav1.TypeMeta `json:",inline"`
9494
// Standard list metadata.
9595
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
9696
// +optional
9797
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
9898
// Status is filled in by the server with the user attributes.
99-
Status SelfSubjectAttributesReviewStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"`
99+
Status SelfSubjectReviewStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"`
100100
}
101101
```
102102
```go
103-
type SelfSubjectAttributesReviewStatus struct {
103+
type SelfSubjectReviewStatus struct {
104104
// User attributes of the current user.
105105
// +optional
106106
UserInfo authenticationv1.UserInfo `json:"userInfo,omitempty" protobuf:"bytes,1,opt,name=userInfo"`
@@ -109,22 +109,22 @@ type SelfSubjectAttributesReviewStatus struct {
109109

110110
On receiving a request, the Kubernetes API server fills the status with the user attributes and returns it to the user.
111111

112-
Request example (the body would be a `SelfSubjectAttributesReview` object):
112+
Request example (the body would be a `SelfSubjectReview` object):
113113
```
114-
POST /apis/authentication.k8s.io/v1alpha1/selfsubjectattributesreview
114+
POST /apis/authentication.k8s.io/v1alpha1/selfsubjectreviews
115115
```
116116
```json
117117
{
118118
"apiVersion": "authentication.k8s.io/v1alpha1",
119-
"kind": "SelfSubjectAttributesReview"
119+
"kind": "SelfSubjectReview"
120120
}
121121
```
122122
Response example:
123123

124124
```json
125125
{
126126
"apiVersion": "authentication.k8s.io/v1alpha1",
127-
"kind": "SelfSubjectAttributesReview",
127+
"kind": "SelfSubjectReview",
128128
"status": {
129129
"name": "jane.doe",
130130
"uid": "b6c7cfd4-f166-11ec-8ea0-0242ac120002",
@@ -138,8 +138,8 @@ Response example:
138138

139139
User attributes are known at the moment of accessing the rest API endpoint and can be extracted from the request context.
140140

141-
NOTE: Unlike the TokenReview, there are no audiences in requests and responses since
142-
the SelfSubjectAttributesReview API can only be accessed using valid credentials against the API server,
141+
NOTE: Unlike the TokenReview, there are no audiences in requests and responses since
142+
the SelfSubjectReview API can only be accessed using valid credentials against the API server,
143143
meaning that the audience must always be that of the API server. Thus learning this value is not practical.
144144

145145
### RBAC
@@ -166,32 +166,25 @@ rules:
166166
- apiGroups:
167167
- authentication.k8s.io
168168
resources:
169-
- selfsubjectattributesreviews
169+
- selfsubjectreviews
170170
verbs:
171171
- create
172172
```
173173
174-
After reaching GA, the SelfSubjectAttributesReview API will be enabled by default.
174+
After reaching GA, the SelfSubjectReview API will be enabled by default.
175175
If necessary, it will be possible to disable this API by using the following kube-apiserver flag:
176176
```
177-
--runtime-config=authentication.k8s.io/v1alpha1/selfsubjectattributesreviews=false
177+
--runtime-config=authentication.k8s.io/v1alpha1/selfsubjectreviews=false
178178
```
179179

180180
### Test Plan
181181

182-
[X] I/we understand the owners of the involved components may require updates to
182+
[x] I/we understand the owners of the involved components may require updates to
183183
existing tests to make this code solid enough prior to committing the changes necessary
184184
to implement this enhancement.
185185

186186
##### Prerequisite testing updates
187187

188-
<!--
189-
Based on reviewers feedback describe what additional tests need to be added prior
190-
implementing this enhancement to ensure the enhancements have also solid foundations.
191-
-->
192-
193-
N/A
194-
195188
##### Unit tests
196189

197190
<!--
@@ -212,18 +205,7 @@ This can inform certain test coverage improvements that we want to do before
212205
extending the production code to implement this enhancement.
213206
-->
214207

215-
The plan to test the SelfSubjectAttributesReview API is:
216-
217-
1. Request returns all user attributes
218-
2. Request returns some user attributes
219-
3. Request with a status returns overridden fields
220-
221-
Command line interface tests covering:
222-
1. How successful responses are rendered in the terminal with various output modes.
223-
2. How errors are rendered.
224-
225-
Given that a new API package is introduced as part of this feature there is
226-
no existing test coverage to link to.
208+
- `k8s.io/kubectl/pkg/cmd/auth/whoami.go`: `23.09.2022` - [`44%`](https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/ci-kubernetes-coverage-unit/1573199873317015552)
227209

228210
##### Integration tests
229211

@@ -234,9 +216,7 @@ For Beta and GA, add links to added tests together with links to k8s-triage for
234216
https://storage.googleapis.com/k8s-triage/index.html
235217
-->
236218

237-
1. Successful authentication through a simple authenticator, e.g., token or certificate authenticator
238-
2. Successful authentication through a complicated authenticator, e.g., webhook or authentication proxy authenticator
239-
3. Failed authentication
219+
- `k8s.io/kubernetes/test/integration/auth/selfsubjectreview_test.go`
240220

241221
##### e2e tests
242222

@@ -248,7 +228,7 @@ https://storage.googleapis.com/k8s-triage/index.html
248228
We expect no non-infra related flakes in the last month as a GA graduation criteria.
249229
-->
250230

251-
There are no e2e tests planned for the alpha milestone.
231+
- `k8s.io/kubernetes/test/e2e/auth/selfsubjectreview.go`
252232

253233
### Graduation Criteria
254234

@@ -281,15 +261,15 @@ Pick one of these and delete the rest.
281261
-->
282262

283263
- Feature gate
284-
- Feature gate name: `SelfSubjectAttributesReview`
264+
- Feature gate name: `APISelfSubjectReview`
285265
- Components depending on the feature gate:
286266
- kube-apiserver
287267

288268
```go
289269
FeatureSpec{
290-
Default: false,
291-
LockToDefault: false,
292-
PreRelease: featuregate.Alpha,
270+
Default: false,
271+
LockToDefault: false,
272+
PreRelease: featuregate.Alpha,
293273
}
294274
```
295275

@@ -349,7 +329,7 @@ The feature utilizes core mechanisms of the Kubernetes API server, so the maximu
349329

350330
The apiserver_request_* metrics family is helpful to be aware of how many requests to the endpoint are in your cluster and how many of them failed.
351331
```
352-
{__name__=~"apiserver_request_.*", group="authentication.k8s.io", resource="selfsubjectattributesreview"}
332+
{__name__=~"apiserver_request_.*", group="authentication.k8s.io", resource="selfsubjectreviews"}
353333
```
354334

355335
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
@@ -372,7 +352,7 @@ No.
372352

373353
```
374354
Group: authentication.k8s.io
375-
Kind: SelfSubjectAttributesReview
355+
Kind: SelfSubjectReview
376356
```
377357

378358
###### Will enabling / using this feature result in any new calls to the cloud provider?

keps/sig-auth/3325-self-subject-attributes-review-api/kep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ milestone:
2121
beta: "v1.27"
2222
stable: "v1.28"
2323
feature-gates:
24-
- name: SelfSubjectAttributesReview
24+
- name: APISelfSubjectReview
2525
components:
2626
- kube-apiserver
2727
disable-supported: true

0 commit comments

Comments
 (0)