Merge pull request #49677 from dims/send-missing-uid-field-during-webhook-authorize
Automatic merge from submit-queue (batch tested with PRs 50103, 49677, 49449, 43586, 48969) Add missing UID in SubjectAccessReviewSpec **What this PR does / why we need it**: WebhookAuthorizer's Authorize should send *all* the information present in the user.Info data structure. We are not sending the UID currently. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note The SubjectAccessReview API in the authorization.k8s.io API group now allows providing the user uid. ```
This commit is contained in:
@@ -121,6 +121,8 @@ type SubjectAccessReviewSpec struct {
|
||||
// Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer
|
||||
// it needs a reflection here.
|
||||
Extra map[string]ExtraValue
|
||||
// UID information about the requesting user.
|
||||
UID string
|
||||
}
|
||||
|
||||
// ExtraValue masks the value so protobuf can generate
|
||||
|
@@ -233,6 +233,7 @@ func autoConvert_v1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReview
|
||||
out.User = in.User
|
||||
out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups))
|
||||
out.Extra = *(*map[string]authorization.ExtraValue)(unsafe.Pointer(&in.Extra))
|
||||
out.UID = in.UID
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -247,6 +248,7 @@ func autoConvert_authorization_SubjectAccessReviewSpec_To_v1_SubjectAccessReview
|
||||
out.User = in.User
|
||||
out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups))
|
||||
out.Extra = *(*map[string]v1.ExtraValue)(unsafe.Pointer(&in.Extra))
|
||||
out.UID = in.UID
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -233,6 +233,7 @@ func autoConvert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessR
|
||||
out.User = in.User
|
||||
out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups))
|
||||
out.Extra = *(*map[string]authorization.ExtraValue)(unsafe.Pointer(&in.Extra))
|
||||
out.UID = in.UID
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -247,6 +248,7 @@ func autoConvert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessR
|
||||
out.User = in.User
|
||||
out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups))
|
||||
out.Extra = *(*map[string]v1beta1.ExtraValue)(unsafe.Pointer(&in.Extra))
|
||||
out.UID = in.UID
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user