Skip to content

Make PolarisAuthorizer RequestScoped #2340

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
Aug 15, 2025

Conversation

XN137
Copy link
Contributor

@XN137 XN137 commented Aug 13, 2025

all methods in PolarisAuthorizer currently have a CallContext parameter.
in its only implementation only CallContext.getRealmConfig is getting used.

so since PolarisAuthorizer cant be used outside a request, we can simply make it request-scoped and inject the request-scoped RealmConfig directly.

all methods in `PolarisAuthorizer` currently have a `CallContext`
parameter.
in its only implementation only `CallContext.getRealmConfig` is getting
used.

so since `PolarisAuthorizer` cant be used outside a request, we can
simply make it request-scoped and inject the request-scoped `RealmConfig`
directly.
@Produces
@RequestScoped
public PolarisAuthorizer polarisAuthorizer(RealmConfig realmConfig) {
return new PolarisAuthorizerImpl(realmConfig);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: if any custom implementations of PolarisAuthorizer are out there and still need the CallContext for whatever reason, they are free to still inject it here.

@XN137 XN137 marked this pull request as ready for review August 13, 2025 08:04
Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Nice cleanup, +1

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Aug 13, 2025
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Nice improvement! 👍

@snazy
Copy link
Member

snazy commented Aug 15, 2025

The PR got 4 approvals and no objections, merging.

@snazy snazy merged commit 88f58fc into apache:main Aug 15, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Aug 15, 2025
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.

5 participants