diff --git a/plugin/pkg/authorizer/webhook/webhook.go b/plugin/pkg/authorizer/webhook/webhook.go index 51e5f09fd..e008e6746 100644 --- a/plugin/pkg/authorizer/webhook/webhook.go +++ b/plugin/pkg/authorizer/webhook/webhook.go @@ -144,6 +144,7 @@ func (w *WebhookAuthorizer) Authorize(attr authorizer.Attributes) (authorized bo if user := attr.GetUser(); user != nil { r.Spec = authorization.SubjectAccessReviewSpec{ User: user.GetName(), + UID: user.GetUID(), Groups: user.GetGroups(), Extra: convertToSARExtra(user.GetExtra()), } diff --git a/plugin/pkg/authorizer/webhook/webhook_test.go b/plugin/pkg/authorizer/webhook/webhook_test.go index 0d155dab3..4f5bd2331 100644 --- a/plugin/pkg/authorizer/webhook/webhook_test.go +++ b/plugin/pkg/authorizer/webhook/webhook_test.go @@ -505,6 +505,7 @@ func TestWebhook(t *testing.T) { TypeMeta: expTypeMeta, Spec: v1beta1.SubjectAccessReviewSpec{ User: "jane", + UID: "1", Groups: []string{"group1", "group2"}, ResourceAttributes: &v1beta1.ResourceAttributes{ Verb: "GET",