Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit OpenID Connect customization template claims when none are set #2620

Merged
merged 2 commits into from Jan 10, 2023
Merged

Omit OpenID Connect customization template claims when none are set #2620

merged 2 commits into from Jan 10, 2023

Conversation

F21
Copy link
Contributor

@F21 F21 commented Jan 9, 2023

There's a bug in the OpenID Connect customization template in #2615 where included_claim_keys is set to nil and sent to the GitHub API if it is not set. This results in the API returning a 422 Unprocessable Entity error.

This PR resolves this by setting the JSON annotation of IncludeClaimKeys in OIDCSubjectClaimCustomTemplate to omitempty and adds a test to verify this.

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #2620 (d239547) into master (8ec1e49) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head d239547 differs from pull request most recent head 34c3e7f. Consider uploading reports for the commit 34c3e7f to get more accurate results

@@           Coverage Diff           @@
##           master    #2620   +/-   ##
=======================================
  Coverage   98.01%   98.02%           
=======================================
  Files         128      129    +1     
  Lines       11055    11084   +29     
=======================================
+ Hits        10836    10865   +29     
  Misses        150      150           
  Partials       69       69           
Impacted Files Coverage Δ
github/actions_oidc.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @F21 !
One minor tweak, please, then we will be ready for a second LGTM+Approval from any other contributor to this repo before merging.

github/actions_oidc_test.go Outdated Show resolved Hide resolved
@F21
Copy link
Contributor Author

F21 commented Jan 10, 2023

Thanks for the quick review @gmlewis ! Pushed another commit to remove the blank line.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @F21 ! (for future PRs, there's no need to force-push in this repo since we always squash-and-merge at the end anyway, just FYI... no biggie.)
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Jan 10, 2023
Copy link
Contributor

@valbeat valbeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gmlewis gmlewis changed the title Omit OpenID Connect customization template claims in request when none are set Omit OpenID Connect customization template claims when none are set Jan 10, 2023
@gmlewis
Copy link
Collaborator

gmlewis commented Jan 10, 2023

Thank you, @valbeat !
Merging.

@gmlewis gmlewis merged commit e4ff2a2 into google:master Jan 10, 2023
@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Jan 10, 2023
@F21 F21 deleted the repo-oidc-customization-to-default branch January 10, 2023 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants