Skip to content

Commit

Permalink
enhance: audience validation
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed May 30, 2024
1 parent 169b103 commit 3f46a1b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/build/id_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ func GetIDToken(c *gin.Context) {

// if audience is provided, include that in claims
if len(c.QueryArray("audience")) > 0 {
idmto.Audience = c.QueryArray("audience")
audience := []string{}
for _, a := range c.QueryArray("audience") {

Check failure on line 109 in api/build/id_token.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] api/build/id_token.go#L109

ranges should only be cuddled with assignments used in the iteration (wsl)
Raw output
api/build/id_token.go:109:3: ranges should only be cuddled with assignments used in the iteration (wsl)
		for _, a := range c.QueryArray("audience") {
		^
if len(a) > 0 {
audience = append(audience, util.Sanitize(a))
}
}
idmto.Audience = audience

Check failure on line 114 in api/build/id_token.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] api/build/id_token.go#L114

assignments should only be cuddled with other assignments (wsl)
Raw output
api/build/id_token.go:114:3: assignments should only be cuddled with other assignments (wsl)
		idmto.Audience = audience
		^
}

// mint token
Expand Down

0 comments on commit 3f46a1b

Please sign in to comment.