Documentation
¶
Overview ¶
Package registryauth binds OCI registry access to the existing Atmos auth lifecycle.
Index ¶
- func Authenticate(ctx context.Context, config *schema.AtmosConfiguration, identity, host string, ...) (authn.Authenticator, error)
- func Identity(config *schema.AtmosConfiguration, host string) (string, error)
- func Logout(ctx context.Context, config *schema.AtmosConfiguration, identity string, ...) error
- func PluginBindings(config *schema.AtmosConfiguration) (map[string]string, error)
- type Manager
- type Option
- type Preparation
- type RegistryCredentials
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func Authenticate(ctx context.Context, config *schema.AtmosConfiguration, identity, host string, options ...Option) (authn.Authenticator, error)
Authenticate logs in the selected identity and performs its registry exchange.
func Identity ¶
func Identity(config *schema.AtmosConfiguration, host string) (string, error)
Identity resolves an exact normalized host to its configured Atmos identity.
func Logout ¶
func Logout(ctx context.Context, config *schema.AtmosConfiguration, identity string, options ...Option) error
Logout clears the selected identity through Atmos auth, including integration cleanup.
func PluginBindings ¶
func PluginBindings(config *schema.AtmosConfiguration) (map[string]string, error)
Types ¶
type Manager ¶
type Manager interface {
Authenticate(context.Context, string) (*types.WhoamiInfo, error)
GetCachedCredentials(context.Context, string) (*types.WhoamiInfo, error)
Logout(context.Context, string, bool) error
}
Manager is the authentication lifecycle needed by registry access.
type Option ¶
type Option func(*Resolver)
Option configures lazy authentication dependencies.
func WithPreparation ¶
func WithPreparation(prepare Preparation) Option
WithPreparation supplies the plugin composition boundary without introducing a dependency cycle.
type Preparation ¶
Preparation registers already available auth plugins without downloading packages. The returned function removes those temporary registrations after authentication.
type RegistryCredentials ¶
type RegistryCredentials interface {
RegistryHost() string
RegistryAuth() (username, password, identityToken, registryToken string)
}
RegistryCredentials supplies credentials scoped to one registry host. Auth identities can implement this without depending on an OCI client.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver authenticates only exact configured hosts. Exchanged tokens are cached briefly against the live auth session; logout or rotation invalidates that cache.
func New ¶
func New(config *schema.AtmosConfiguration, bindings map[string]string, options ...Option) *Resolver
New creates a resolver without loading credentials or starting authentication.
func (*Resolver) Resolve ¶
func (r *Resolver) Resolve(ctx context.Context, resource authn.Resource) (authn.Authenticator, bool, error)
Resolve authenticates explicitly bound hosts and leaves other hosts to the caller. A configured identity's failure is terminal, never an ambient-credential fallback.