Skip to content

Commit

Permalink
chore: add UID field and nil check
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Tonks <[email protected]>
  • Loading branch information
miketonks-form3 committed Jan 10, 2025
1 parent a7c06aa commit 515bb10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/webhook/validate_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func (v *AuthValidator) auth(userInfo authnv1.UserInfo, namespace string, chaosK
Resource: resourceName,
},
User: userInfo.Username,
UID: userInfo.UID,
Groups: userInfo.Groups,
Extra: convertExtra(userInfo.Extra),
},
Expand Down Expand Up @@ -177,6 +178,9 @@ func contains(arr []string, target string) bool {
}

func convertExtra(in map[string]authnv1.ExtraValue) map[string]authzv1.ExtraValue {
if in == nil {
return nil
}
// map from authentication and authorization types
extra := make(map[string]authzv1.ExtraValue)
for key, value := range in {
Expand Down

0 comments on commit 515bb10

Please sign in to comment.