flyrain commented on code in PR #5119:
URL: https://github.com/apache/polaris/pull/5119#discussion_r3625335761
##########
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:
External-vs-internal here is decided purely by whether the principal carries
a `PRINCIPAL_ENTITY_ATTRIBUTE_KEY`. Can we use a more deterministic way? like a
flag
--
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]