It seems to me that OpenIDContext provides some data specific to OpenID while SecurityContext provides general security info.
What if we made OpenIDContext extend SecurityContext?
With that, it would be enough to inject OpenIDContext and get all features of SecurityContext and the redundant method getCallerName() could be removed in favor of the inherited SecurityContext.getCallerPrincipal().
Should I submit a PR to do that?
In the future, we can also easily move the method getCallerGroups from OpenIDContext to SecurityContext without a breaking change, or leave it in OpenIDContext and introduce a lazy way to retrieve roles to prevent loading a lot
of roles, e.g. using a Stream instead of Set.
Kind regards,
Ondrej Mihályi
Senior Payara Service Engineer
Payara - Supported Enterprise
Software for Jakarta EE and MicroProfile Applications
US: +1 415 523 0175 | UK: +44 207 754 0481
----------------------------------------------------------------------------------------------------------------------
Payara is a proud recipient of the prestigious
Queen's Award for Enterprise: International Trade 2021
Payara-Tech LDA, Registered Office: Rua Nova de São Pedro no. 54, 2nd floor, room “D”, 9000 048 Funchal, Ilha da Madeira, Portugal
VAT: PT 515158674 |
www.payara.fish |
info@xxxxxxxxxxx |
@Payara_Fish
|