Follow the OpenID Connect Audiences spec #240
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This follows the OpenID Connect spec to support audiences with either a string or an array of strings instead of just a string.
This fixes the bug at go-gitea/gitea#4877 and the PR at go-gitea/gitea#4878 is dependent on this getting fixed and released.
I have tested this and am running it on my site now with the OpenID Connect with multiple audiences returned with no issue, the new code is not even run at all unless the old pure-string check fails.
Disclaimer: I've never used and barely looked at Go thus far, and I was unable to find common functions like filter or so forth (or any higher order functions at all...) and based on some googling it appears that these large and unwieldy loops are the standard way to do this kind of thing in Go, but if any changes are needed please request as such with information on what I should change it to (great learning opportunity!).
And of course any rights or whatever there-of related to this code I give up for whatever use this project currently wants or will want in the future. Etc... etc... Commit is signed, etc...