Skip to content

Remove AuthProperties and just use Context #657

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

Merged
merged 1 commit into from
Apr 18, 2025

Conversation

rhernandez35
Copy link
Contributor

@rhernandez35 rhernandez35 commented Apr 18, 2025

Rather than essentially recreate Context for Auth and Identity related properties, we can just use Context. AuthProperties already used Context.Key, but recreated most of Context in order to be immutable. This isn't strictly necessary given Context can be made immutable using Context.unmodifiableView(ctx).

In order to make this change, we needed to add a few missing methods to Context that are good additions: merge (merge two contexts and return a new context), getOrDefault, and Context.empty (return an immutable and empty context).


This is just @mtdowling's change rebased onto main. I need access to the full request Context to write request-scoped identity resolvers.

Rather than essentially recreate Context for Auth and Identity related
properties, we can just use Context. AuthProperties already used
Context.Key, but recreated most of Context in order to be immutable.
This isn't strictly necessary given Context can be made immutable using
Context.unmodifiableView(ctx).

In order to make this change, we needed to add a few missing methods to
Context that are good additions: merge (merge two contexts and return a
new context), getOrDefault, and Context.empty (return an immutable and
empty context).
@rhernandez35 rhernandez35 enabled auto-merge (rebase) April 18, 2025 17:51
@rhernandez35 rhernandez35 merged commit a032c09 into main Apr 18, 2025
2 checks passed
@rhernandez35 rhernandez35 deleted the remove-auth-properties branch April 18, 2025 18:21
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