Package land.oras.auth
Class AuthStoreAuthenticationProvider
java.lang.Object
land.oras.auth.AuthStoreAuthenticationProvider
- All Implemented Interfaces:
AuthProvider
@NullMarked
public final class AuthStoreAuthenticationProvider
extends Object
implements AuthProvider
AuthStoreAuthenticationProvider is an implementation of the
AuthProvider interface.
It retrieves credentials from a AuthStore and generates a Basic Authentication header.-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorAuthStoreAuthenticationProvider(AuthStore authStore) Constructor. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetAuthHeader(ContainerRef registry) Get the authentication header for this providerGet the authentication scheme for this providergetIdentity(ContainerRef registry) Get an opaque identity marker for the credentials this provider resolves for the given registry.
-
Constructor Details
-
AuthStoreAuthenticationProvider
public AuthStoreAuthenticationProvider()Default constructor -
AuthStoreAuthenticationProvider
Constructor.- Parameters:
authStore- The FileStore instance to retrieve credentials from.
-
-
Method Details
-
getAuthHeader
Description copied from interface:AuthProviderGet the authentication header for this provider- Specified by:
getAuthHeaderin interfaceAuthProvider- Parameters:
registry- The registry- Returns:
- The authentication header or null if not applicable
-
getAuthScheme
Description copied from interface:AuthProviderGet the authentication scheme for this provider- Specified by:
getAuthSchemein interfaceAuthProvider- Returns:
- The authentication scheme
-
getIdentity
Description copied from interface:AuthProviderGet an opaque identity marker for the credentials this provider resolves for the given registry. This marker is used to keyTokenCacheentries alongside the requestedScopes- Specified by:
getIdentityin interfaceAuthProvider- Parameters:
registry- The registry- Returns:
- A non-null identity marker
-