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

FFI: Expose support for registration through OIDC in the login details. #4169

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Oct 25, 2024

This allows clients to decide whether or not passing Create to url_for_oidc is allowed.

@pixlwave pixlwave requested a review from a team as a code owner October 25, 2024 13:16
@pixlwave pixlwave requested review from bnjbvr and removed request for a team October 25, 2024 13:16
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Too much logic at the FFI layer, please create a method in the SDK with tests :)

@pixlwave
Copy link
Member Author

Too much logic at the FFI layer, please create a method in the SDK with tests :)

Haha, a response faster than Clippy! Ok will do next week 🙂

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.77%. Comparing base (40f4fc1) to head (4829f48).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4169   +/-   ##
=======================================
  Coverage   84.77%   84.77%           
=======================================
  Files         269      269           
  Lines       28963    28963           
=======================================
+ Hits        24552    24553    +1     
+ Misses       4411     4410    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if let Ok(issuer) = oidc.fetch_authentication_issuer().await {
if let Ok(metadata) = &oidc.given_provider_metadata(&issuer).await {
metadata
.prompt_values_supported
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't be more efficient / generic to expose the prompt_values_supported list as a list of OidcPrompt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I wasn't sure if the concept of OidcPrompts was a bit too much info but if we're happy with that I'll update and at which point, there wouldn't be any custom FFI logic so I would leave all this in the FFI.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, the amount of code didn't really change that much, it's basically just the use of Into instead of contains. WDYT @bnjbvr, I wouldn't really consider there to be any custom FFI logic here now as it is just mapping SDK values to FFI values.

Copy link
Member

Choose a reason for hiding this comment

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

If that's sufficient for your needs, that's fine with me. (Please make sure to log errors that are silently swallowed here, for both if let Ok(...) branches.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 4829f48

@pixlwave pixlwave force-pushed the doug/oidc-registration branch from dfbcfc1 to 4024ee0 Compare October 28, 2024 10:12
@pixlwave pixlwave force-pushed the doug/oidc-registration branch from 4024ee0 to 4829f48 Compare October 28, 2024 11:08
@pixlwave pixlwave requested a review from bnjbvr October 28, 2024 12:19
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@bnjbvr bnjbvr merged commit 7c39fd6 into main Oct 28, 2024
40 checks passed
@bnjbvr bnjbvr deleted the doug/oidc-registration branch October 28, 2024 12:26
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.

3 participants