bharos opened a new issue, #11412:
URL: https://github.com/apache/gravitino/issues/11412
Custom `PrincipalMapper` and `GroupMapper` implementations loaded via fully
qualified class name (FQCN) have no way to receive server configuration after
construction. The factories (`PrincipalMapperFactory`, `GroupMapperFactory`)
instantiate them via no-arg constructor but never pass config.
This is inconsistent with `OAuthTokenValidator` and `Authenticator`, which
both define `initialize(Config config)` and have it called by their respective
factories after construction. Custom token validators and authenticators can
read any `gravitino.conf` property, but custom principal/group mappers cannot.
This gap prevents building config-driven mappers, such as a static mapping
table for Azure AD service principal GUIDs to friendly display names.
**Proposed solution:**
Add a `default void initialize(Config config) {}` method to both
`PrincipalMapper` and `GroupMapper` interfaces, and update their factories to
call it after construction — matching the existing pattern in
`OAuthTokenValidator` and `Authenticator`.
This is fully backward compatible: existing implementations
(`RegexPrincipalMapper`, `KerberosPrincipalMapper`, `RegexGroupMapper`) do not
need changes since the default method is a no-op.
PR: #11411
--
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]