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 record
Nested Credential class to represent username and password pairs. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Error message indicating that the format of the provided credential is invalid. -
Method Summary
Modifier and TypeMethodDescription@Nullable AuthStore.Credential
get
(ContainerRef containerRef) Retrieves credentials for the given containerRef.static AuthStore
newStore()
Creates a new FileStore from default locationstatic AuthStore
Creates a new FileStore based on the given configuration file path.
-
Field Details
-
ERR_BAD_CREDENTIAL_FORMAT
Error message indicating that the format of the provided credential is invalid. This is typically used when credentials do not match the expected structure or format.- See Also:
-
-
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
-