Skip to content

Commit d5306a4

Browse files
authored
Merge pull request kubernetes#3543 from nabokihms/update-test-plan-section
KEP-3325: Update milestone and test plan section for SelfSubjectReview KEP
2 parents 4303341 + 7b87c2f commit d5306a4

File tree

2 files changed

+36
-49
lines changed

2 files changed

+36
-49
lines changed

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

Lines changed: 35 additions & 48 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,37 +109,44 @@ 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": {
129-
"name": "jane.doe",
130-
"uid": "b6c7cfd4-f166-11ec-8ea0-0242ac120002",
131-
"groups": ["viewers", "editors"],
132-
"extra": {
133-
"provider_id": "token.company.dev"
129+
"userInfo": {
130+
"name": "jane.doe",
131+
"uid": "b6c7cfd4-f166-11ec-8ea0-0242ac120002",
132+
"groups": [
133+
"viewers",
134+
"editors"
135+
],
136+
"extra": {
137+
"provider_id": [
138+
"token.company.dev"
139+
]
140+
}
134141
}
135142
}
136143
}
137144
```
138145

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

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,
148+
NOTE: Unlike the TokenReview, there are no audiences in requests and responses since
149+
the SelfSubjectReview API can only be accessed using valid credentials against the API server,
143150
meaning that the audience must always be that of the API server. Thus learning this value is not practical.
144151

145152
### RBAC
@@ -166,32 +173,25 @@ rules:
166173
- apiGroups:
167174
- authentication.k8s.io
168175
resources:
169-
- selfsubjectattributesreviews
176+
- selfsubjectreviews
170177
verbs:
171178
- create
172179
```
173180
174-
After reaching GA, the SelfSubjectAttributesReview API will be enabled by default.
181+
After reaching GA, the SelfSubjectReview API will be enabled by default.
175182
If necessary, it will be possible to disable this API by using the following kube-apiserver flag:
176183
```
177-
--runtime-config=authentication.k8s.io/v1alpha1/selfsubjectattributesreviews=false
184+
--runtime-config=authentication.k8s.io/v1alpha1/selfsubjectreviews=false
178185
```
179186

180187
### Test Plan
181188

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

186193
##### Prerequisite testing updates
187194

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-
195195
##### Unit tests
196196

197197
<!--
@@ -212,18 +212,7 @@ This can inform certain test coverage improvements that we want to do before
212212
extending the production code to implement this enhancement.
213213
-->
214214

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.
215+
- `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)
227216

228217
##### Integration tests
229218

@@ -234,9 +223,7 @@ For Beta and GA, add links to added tests together with links to k8s-triage for
234223
https://storage.googleapis.com/k8s-triage/index.html
235224
-->
236225

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
226+
- `k8s.io/kubernetes/test/integration/auth/selfsubjectreview_test.go`
240227

241228
##### e2e tests
242229

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

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

253240
### Graduation Criteria
254241

@@ -281,7 +268,7 @@ Pick one of these and delete the rest.
281268
-->
282269

283270
- Feature gate
284-
- Feature gate name: `SelfSubjectAttributesReview`
271+
- Feature gate name: `APISelfSubjectReview`
285272
- Components depending on the feature gate:
286273
- kube-apiserver
287274

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

350337
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.
351338
```
352-
{__name__=~"apiserver_request_.*", group="authentication.k8s.io", resource="selfsubjectattributesreview"}
339+
{__name__=~"apiserver_request_.*", group="authentication.k8s.io", resource="selfsubjectreviews"}
353340
```
354341

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

373360
```
374361
Group: authentication.k8s.io
375-
Kind: SelfSubjectAttributesReview
362+
Kind: SelfSubjectReview
376363
```
377364

378365
###### 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)