adutra commented on code in PR #5119:
URL: https://github.com/apache/polaris/pull/5119#discussion_r3676149911
##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/resolver/Resolver.java:
##########
@@ -780,6 +787,16 @@ private ResolverStatus resolvePaths(
private ResolverStatus resolveCallerPrincipalAndPrincipalRoles(
List<ResolvedPolarisEntity> toValidate, boolean resolvePrincipalRoles) {
+ // External principals are not backed by the metastore: synthesize the
caller principal and its
+ // roles directly from the authenticated principal instead of resolving
them from the backend.
+ boolean externalPrincipal =
+ polarisPrincipal
+ .getAttribute(PolarisPrincipal.PRINCIPAL_ENTITY_ATTRIBUTE_KEY,
PrincipalEntity.class)
+ .isEmpty();
+ if (externalPrincipal) {
Review Comment:
Introducing another flag seems unnecessary to me: the existence (or not) of
a principal entity is _precisely_ what distinguishes an external principal from
an internal one.
--
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]