Package org.apache.polaris.service.auth
Interface Authenticator<C,P extends Principal>
- Type Parameters:
C- the type of credentials used for authenticationP- the type of principal that is returned upon successful authentication
- All Known Implementing Classes:
DefaultAuthenticator
public interface Authenticator<C,P extends Principal>
An interface for authenticating principals based on provided credentials.
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate(C credentials) Authenticates the given credentials and returns an optional principal.
-
Method Details
-
authenticate
Optional<P> authenticate(C credentials) throws org.apache.iceberg.exceptions.NotAuthorizedException, org.apache.iceberg.exceptions.ServiceFailureException Authenticates the given credentials and returns an optional principal.If the credentials are not valid or if the authentication fails, implementations may choose to return an empty optional or throw an exception. Returning empty will generally translate into a
NotAuthorizedException.- Parameters:
credentials- the credentials to authenticate- Returns:
- an optional principal if authentication is successful, or an empty optional if authentication fails.
- Throws:
org.apache.iceberg.exceptions.NotAuthorizedException- if the credentials are not authorizedorg.apache.iceberg.exceptions.ServiceFailureException- if there is a failure in the authentication service
-