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

fix: allowed_top_level_claims default to nil #3245

Merged
merged 1 commit into from Sep 8, 2022

Conversation

fehrnah
Copy link
Contributor

@fehrnah fehrnah commented Sep 5, 2022

allowed_top_level_claims were set to nil if claim was not present

Related issue(s)

When allowed_top_level_claims are configured, they are always present in the token, with value null if they were never set.

This PR fixes this and adds a regression test

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

@CLAassistant
Copy link

CLAassistant commented Sep 5, 2022

CLA assistant check
All committers have signed the CLA.

@fehrnah fehrnah changed the title Fix allowed_top_level_claims set to nil fix allowed_top_level_claims set to nil Sep 5, 2022
@fehrnah fehrnah changed the title fix allowed_top_level_claims set to nil fix: allowed_top_level_claims default to nil Sep 5, 2022
allowed_top_level_claims were set to nil if claim was not present
Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome find, thank you!

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #3245 (7f5b9cf) into master (05bda6b) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3245      +/-   ##
==========================================
+ Coverage   76.72%   76.74%   +0.02%     
==========================================
  Files         123      123              
  Lines        8846     8847       +1     
==========================================
+ Hits         6787     6790       +3     
+ Misses       1634     1633       -1     
+ Partials      425      424       -1     
Impacted Files Coverage Δ
oauth2/session.go 80.32% <100.00%> (+0.32%) ⬆️
persistence/sql/persister_oauth2.go 82.88% <0.00%> (+0.76%) ⬆️

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

@aeneasr aeneasr merged commit cd2c252 into ory:master Sep 8, 2022
@vinckr
Copy link
Member

vinckr commented Sep 14, 2022

Hello @fehrnah
Congrats on merging your first PR in Ory 🎉 !
Your contribution will soon be helping secure millions of identities around the globe 🌏.
As a small token of appreciation we send all our first time contributors a gift package to welcome them to the community.
Please drop me an email and I will forward you the form to claim your Ory swag!

@fehrnah fehrnah deleted the dev/allowed-claims-empty branch September 22, 2022 11:46
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

4 participants