Package land.oras.auth
Class AuthStore
java.lang.Object
land.oras.auth.AuthStore
Implements a credentials store using a configuration file
to keep the credentials in plain-text.
Reference: Docker config
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordNested Credential class to represent username and password pairs.static final recordCredential helper response -
Method Summary
Modifier and TypeMethodDescription@Nullable AuthStore.Credentialget(ContainerRef containerRef) Retrieves credentials for the given containerRef.@Nullable StringgetCredentialHelperBinary(ContainerRef containerRef) Get the credential helper binary for the given containerRef.static AuthStorenewStore()Creates a new FileStore from default locationstatic AuthStoreCreates a new FileStore based on the given configuration file path.
-
Method Details
-
newStore
Creates a new FileStore based on the given configuration file path.- Parameters:
configPaths- Path to the configuration files.- Returns:
- FileStore instance.
-
newStore
Creates a new FileStore from default location- Returns:
- FileStore instance.
-
get
Retrieves credentials for the given containerRef.- Parameters:
containerRef- ContainerRef.- Returns:
- Credential object or null if no credential is found.
- Throws:
OrasException
-
getCredentialHelperBinary
Get the credential helper binary for the given containerRef.- Parameters:
containerRef- ContainerRef.- Returns:
- Credential helper binary name or null if not found.
-