Package land.oras.auth
Class AbstractUsernamePasswordProvider
java.lang.Object
land.oras.auth.AbstractUsernamePasswordProvider
- All Implemented Interfaces:
AuthProvider
- Direct Known Subclasses:
UsernamePasswordProvider
public abstract sealed class AbstractUsernamePasswordProvider
extends Object
implements AuthProvider
permits UsernamePasswordProvider
A provider for username and password authentication
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractUsernamePasswordProvider(String username, String password) Create a new username and password provider -
Method Summary
Modifier and TypeMethodDescription@NonNull 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.Get the passwordGet the username
-
Constructor Details
-
AbstractUsernamePasswordProvider
Create a new username and password provider- Parameters:
username- The usernamepassword- The password
-
-
Method Details
-
getUsername
Get the username- Returns:
- The username
-
getPassword
Get the password- Returns:
- The password
-
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
-