Skip to content

Allow for Customization of Polaris Authorizer #1920

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

travis-bowen
Copy link
Contributor

Want to be able to allow for Polaris Authorizer to be customizable at the request level, while still maintaining existing behavior of a single application level implementation.

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.

Thanks for your interest and contribution, @travis-bowen !

Your code changes make sense to me, however, if your intention is to have an alternative PolarisAuthorizer in a downstream build (not in this repo), I believe these changes are not necessary. The downstream build could have an overriding producer method like this:

  @Produces
  @Alternative
  @Priority(10)
  @Singleton
  public PolarisAuthorizer polarisAuthorizer(...) {...}

to cause a different implementation to be used. You can have any config and other beans injected into the producer method depending on its needs. WDYT?

@ApplicationScoped
public PolarisAuthorizer polarisAuthorizer(PolarisConfigurationStore configurationStore) {
return new PolarisAuthorizerImpl(configurationStore);
@RequestScoped
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this is contentious I can probably change back to ApplicationScoped and utilize the call context within my own implementation to do different things per request.

@travis-bowen
Copy link
Contributor Author

Thanks for the input @dimas-b ! I'm pretty new to the Quarkus stuff so let me try that out!

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