Skip to content

Commit 85ffc9d

Browse files
authored
Merge pull request kubernetes#87791 from mikedanese/authexp
remove authn/z expansions
2 parents 23aa2e2 + 65483a1 commit 85ffc9d

File tree

56 files changed

+400
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+400
-176
lines changed

staging/src/k8s.io/api/authentication/v1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const (
4040

4141
// +genclient
4242
// +genclient:nonNamespaced
43-
// +genclient:noVerbs
43+
// +genclient:onlyVerbs=create
4444
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4545

4646
// TokenReview attempts to authenticate a token to a known user.

staging/src/k8s.io/api/authentication/v1beta1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
// +genclient
2626
// +genclient:nonNamespaced
27-
// +genclient:noVerbs
27+
// +genclient:onlyVerbs=create
2828
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2929

3030
// TokenReview attempts to authenticate a token to a known user.

staging/src/k8s.io/api/authorization/v1/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
// +genclient
2626
// +genclient:nonNamespaced
27-
// +genclient:noVerbs
27+
// +genclient:onlyVerbs=create
2828
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2929

3030
// SubjectAccessReview checks whether or not a user or group can perform an action.
@@ -43,7 +43,7 @@ type SubjectAccessReview struct {
4343

4444
// +genclient
4545
// +genclient:nonNamespaced
46-
// +genclient:noVerbs
46+
// +genclient:onlyVerbs=create
4747
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4848

4949
// SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a
@@ -63,7 +63,7 @@ type SelfSubjectAccessReview struct {
6363
}
6464

6565
// +genclient
66-
// +genclient:noVerbs
66+
// +genclient:onlyVerbs=create
6767
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
6868

6969
// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.
@@ -189,7 +189,7 @@ type SubjectAccessReviewStatus struct {
189189

190190
// +genclient
191191
// +genclient:nonNamespaced
192-
// +genclient:noVerbs
192+
// +genclient:onlyVerbs=create
193193
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
194194

195195
// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace.

staging/src/k8s.io/api/authorization/v1beta1/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
// +genclient
2626
// +genclient:nonNamespaced
27-
// +genclient:noVerbs
27+
// +genclient:onlyVerbs=create
2828
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2929

3030
// SubjectAccessReview checks whether or not a user or group can perform an action.
@@ -43,7 +43,7 @@ type SubjectAccessReview struct {
4343

4444
// +genclient
4545
// +genclient:nonNamespaced
46-
// +genclient:noVerbs
46+
// +genclient:onlyVerbs=create
4747
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4848

4949
// SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a
@@ -63,7 +63,7 @@ type SelfSubjectAccessReview struct {
6363
}
6464

6565
// +genclient
66-
// +genclient:noVerbs
66+
// +genclient:onlyVerbs=create
6767
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
6868

6969
// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.
@@ -189,7 +189,7 @@ type SubjectAccessReviewStatus struct {
189189

190190
// +genclient
191191
// +genclient:nonNamespaced
192-
// +genclient:noVerbs
192+
// +genclient:onlyVerbs=create
193193
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
194194

195195
// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace.

staging/src/k8s.io/api/core/v1/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4061,6 +4061,7 @@ type ServiceList struct {
40614061
}
40624062

40634063
// +genclient
4064+
// +genclient:method=CreateToken,verb=create,subresource=token,input=k8s.io/api/authentication/v1.TokenRequest,result=k8s.io/api/authentication/v1.TokenRequest
40644065
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
40654066

40664067
// ServiceAccount binds together:

staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ go_library(
1717
importpath = "k8s.io/client-go/kubernetes/typed/authentication/v1/fake",
1818
deps = [
1919
"//staging/src/k8s.io/api/authentication/v1:go_default_library",
20+
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
2021
"//staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1:go_default_library",
2122
"//staging/src/k8s.io/client-go/rest:go_default_library",
2223
"//staging/src/k8s.io/client-go/testing:go_default_library",

staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview_expansion.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ import (
2323
core "k8s.io/client-go/testing"
2424
)
2525

26-
func (c *FakeTokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
27-
return c.CreateContext(context.Background(), tokenReview)
28-
}
29-
3026
func (c *FakeTokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
3127
obj, err := c.Fake.Invokes(core.NewRootCreateAction(authenticationapi.SchemeGroupVersion.WithResource("tokenreviews"), tokenReview), &authenticationapi.TokenReview{})
3228
return obj.(*authenticationapi.TokenReview), err

staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@ import (
2323
)
2424

2525
type TokenReviewExpansion interface {
26-
Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error)
2726
CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error)
2827
}
2928

30-
func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
31-
return c.CreateContext(context.Background(), tokenReview)
32-
}
33-
3429
func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
3530
result = &authenticationapi.TokenReview{}
3631
err = c.client.Post().

0 commit comments

Comments
 (0)