Categorygithub.com/oras-project/oras-credentials-go
modulepackage
0.4.0
Repository: https://github.com/oras-project/oras-credentials-go.git
Documentation: pkg.go.dev

# README

Credential Management for oras-go

Build Status codecov Go Report Card Go Reference

banner

oras-credentials-go is a credential management library designed for oras-go. It supports reading, saving, and removing credentials from Docker configuration files and external credential stores that follow the Docker credential helper protocol.

[!IMPORTANT] The APIs previously located in this library have been moved to oras-go. As a result, these APIs are now deprecated and users should use the packages in oras-go instead.

This repository will now be used for developing experimental features scoped to credentials management. If any of these features are deemed stable and applicable to oras-go, they may be moved there in the future.

Versioning

The oras-credentials-go library follows Semantic Versioning, where breaking changes are reserved for MAJOR releases, and MINOR and PATCH releases must be 100% backwards compatible.

Docs

Code of Conduct

This project has adopted the CNCF Code of Conduct.

# Packages

Deprecated: This package is deprecated.

# Functions

Credential returns a Credential() function that can be used by auth.Client.
Login provides the login functionality with the given credentials.
Logout provides the logout functionality given the registry name.
NewDefaultNativeStore returns a native store based on the platform-default docker credentials helper and a bool indicating if the native store is available.
NewFileStore creates a new file credentials store.
NewMemoryStore creates a new in-memory credentials store.
NewNativeStore creates a new native store that uses a remote helper program to manage credentials.
NewStore returns a Store based on the given configuration file.
NewStoreFromDocker returns a Store based on the default docker config file.
NewStoreWithFallbacks returns a new store based on the given stores.
ServerAddressFromHostname maps a hostname to a server address, which is used as a key for credentials store.
ServerAddressFromRegistry maps a registry to a server address, which is used as a key for credentials store.

# Variables

ErrBadCredentialFormat is returned by Put() when the credential format is bad.
ErrClientTypeUnsupported is thrown by Login() when the registry's client type is not supported.
ErrPlaintextPutDisabled is returned by Put() when DisablePut is set to true.

# Type aliases

DynamicStore dynamically determines which store to use based on the settings in the config file.
FileStore implements a credentials store using the docker configuration file to keep the credentials in plain-text.
Store is the interface that any credentials store must implement.
StoreOptions provides options for NewStore.