Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.iceberg.io.CloseableGroup;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -45,9 +44,6 @@ public interface CallContext extends AutoCloseable {
// created, scoped to the current call context.
String REQUEST_PATH_CATALOG_INSTANCE_KEY = "REQUEST_PATH_CATALOG_INSTANCE";

// Authenticator filters should populate this field alongside resolving a SecurityContext.
// Value type: AuthenticatedPolarisPrincipal
String AUTHENTICATED_PRINCIPAL = "AUTHENTICATED_PRINCIPAL";
String CLOSEABLES = "closeables";

static CallContext setCurrentContext(CallContext context) {
Expand All @@ -63,11 +59,6 @@ static PolarisDiagnostics getDiagnostics() {
return CURRENT_CONTEXT.get().getPolarisCallContext().getDiagServices();
}

static AuthenticatedPolarisPrincipal getAuthenticatedPrincipal() {
return (AuthenticatedPolarisPrincipal)
CallContext.getCurrentContext().contextVariables().get(CallContext.AUTHENTICATED_PRINCIPAL);
}

static void unsetCurrentContext() {
CURRENT_CONTEXT.remove();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ protected Optional<AuthenticatedPolarisPrincipal> getPrincipal(DecodedToken toke

AuthenticatedPolarisPrincipal authenticatedPrincipal =
new AuthenticatedPolarisPrincipal(new PrincipalEntity(principal), activatedPrincipalRoles);
LOGGER.debug("Populating authenticatedPrincipal into CallContext: {}", authenticatedPrincipal);
callContext.contextVariables().put(CallContext.AUTHENTICATED_PRINCIPAL, authenticatedPrincipal);
return Optional.of(authenticatedPrincipal);
}
}