adutra commented on PR #2390:
URL: https://github.com/apache/polaris/pull/2390#issuecomment-3200842423
@flyrain @collado-mike @dennishuo FYI
As discussed in the ML, I know that `ActiveRolesProvider` is listed as an
extension point.
My ask is for you to assess whether you can refactor your own roles provider
impl from this:
```java
@RequestScoped class DefaultAuthenticator implements Authenticator {}
@RequestScoped class DefaultActiveRolesProvider implements
ActiveRolesProvider {}
```
to this:
```java
@RequestScoped class DefaultAuthenticator implements Authenticator {
@Inject MyActiveRolesProvider rolesProvider;
}
```
I created several protected methods in `DefaultAuthenticator` that can be
used to facilitate this migration:
* `resolvePrincipalEntity` : mostly what was already in this class
* `resolvePrincipalRoles` : mostly code from `DefaultActiveRolesProvider`,
also calls two methods:
* `extractRequestedRoles`: decodes the token roles and handles the
`PRINCIPAL_ROLES:ALL` stuff
* `loadPrincipalGrants`: loads the principal grants
But you are also free of course to use a different `Authenticator` impl if
that's easier.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]