-
Notifications
You must be signed in to change notification settings - Fork 290
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
Conversation
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup, +1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement! 👍
The PR got 4 approvals and no objections, merging. |
all methods in
PolarisAuthorizer
currently have aCallContext
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-scopedRealmConfig
directly.