Add missing UID in SubjectAccessReviewSpec
WebhookAuthorizer's Authorize should send *all* the information present in the user.Info data structure. We are not sending the UID currently. Kubernetes-commit: 9a761b16c1558106800222dbc52f6ab03c40c64c
This commit is contained in:
parent
2c66dfcbee
commit
7d27fa3fec
|
|
@ -144,6 +144,7 @@ func (w *WebhookAuthorizer) Authorize(attr authorizer.Attributes) (authorized bo
|
||||||
if user := attr.GetUser(); user != nil {
|
if user := attr.GetUser(); user != nil {
|
||||||
r.Spec = authorization.SubjectAccessReviewSpec{
|
r.Spec = authorization.SubjectAccessReviewSpec{
|
||||||
User: user.GetName(),
|
User: user.GetName(),
|
||||||
|
UID: user.GetUID(),
|
||||||
Groups: user.GetGroups(),
|
Groups: user.GetGroups(),
|
||||||
Extra: convertToSARExtra(user.GetExtra()),
|
Extra: convertToSARExtra(user.GetExtra()),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,6 +505,7 @@ func TestWebhook(t *testing.T) {
|
||||||
TypeMeta: expTypeMeta,
|
TypeMeta: expTypeMeta,
|
||||||
Spec: v1beta1.SubjectAccessReviewSpec{
|
Spec: v1beta1.SubjectAccessReviewSpec{
|
||||||
User: "jane",
|
User: "jane",
|
||||||
|
UID: "1",
|
||||||
Groups: []string{"group1", "group2"},
|
Groups: []string{"group1", "group2"},
|
||||||
ResourceAttributes: &v1beta1.ResourceAttributes{
|
ResourceAttributes: &v1beta1.ResourceAttributes{
|
||||||
Verb: "GET",
|
Verb: "GET",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue