integrations

package
v1.235.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	KindAWSECR       = "aws/ecr"
	KindAWSECRPublic = "aws/ecr-public"
	KindAWSEKS       = "aws/eks"
	KindAzureACR     = "azure/acr"
	KindAzureAKS     = "azure/aks"
	KindGCPGKE       = "gcp/gke"
	KindGitHubSTS    = "github/sts"
)

Integration kind constants.

Variables

This section is empty.

Functions

func ExchangeRegistryCredentials

func ExchangeRegistryCredentials(ctx context.Context, config *IntegrationConfig, credentials types.ICredentials) (*types.OCICredentials, error)

ExchangeRegistryCredentials acquires the selected integration's registry credentials without round-tripping through a shared Docker configuration that another login can replace.

func IsRegistered

func IsRegistered(kind string) bool

IsRegistered checks if an integration kind is registered.

func ListKinds

func ListKinds() []string

ListKinds returns all registered integration kinds in sorted order.

func Register

func Register(kind string, factory IntegrationFactory)

Register adds an integration factory for a kind. This should be called from init() functions in integration packages. Panics if kind is empty or factory is nil to catch configuration errors early.

Types

type Integration

type Integration interface {
	// Kind returns the integration type (e.g., "aws/ecr", "aws/eks").
	Kind() string

	// Execute performs the integration using the provided credentials.
	// Returns nil on success, error on failure.
	Execute(ctx context.Context, creds types.ICredentials) error

	// Cleanup reverses the effects of Execute (e.g., removes kubeconfig entries, docker logout).
	// Called during identity/provider logout to clean up integration artifacts.
	// Idempotent — returns nil if nothing to clean up.
	// Errors do not block logout: the remaining cleanup still runs, and the logout is
	// reported as partial with the error, so artifacts left behind are not hidden.
	Cleanup(ctx context.Context) error

	// Environment returns environment variables contributed by this integration.
	// Returns vars based on configuration (deterministic), not Execute() output.
	// Called by the manager when composing env vars for atmos auth env / auth shell.
	Environment() (map[string]string, error)
}

Integration represents a client-only credential materialization. Integrations derive credentials from identities for service-specific access (e.g., ECR docker login, EKS kubeconfig).

func Create

func Create(config *IntegrationConfig) (Integration, error)

Create instantiates an integration from config.

type IntegrationConfig

type IntegrationConfig struct {
	Name   string
	Config *schema.Integration
	// Realm is the credential isolation realm. Integrations that persist secret
	// material to disk (e.g., github/sts) use it to scope their state paths so
	// minted credentials are isolated per repository/customer environment.
	// Kubeconfig integrations (aws/eks, azure/aks, gcp/gke) use it to scope
	// their kube user and context names, but only when RealmExplicit reports
	// true. Integrations that don't need it (aws/ecr) may ignore it.
	Realm string
	// RealmSource is how Realm was determined: realm.SourceEnv or
	// realm.SourceConfig for a realm set by ATMOS_AUTH_REALM or auth.realm, or
	// realm.SourceAuto for one Atmos derived because none is configured (a hash
	// of the atmos.yaml path). Empty counts as explicit, for callers that set
	// Realm directly.
	RealmSource string
}

IntegrationConfig wraps the schema.Integration with the integration name.

func (*IntegrationConfig) RealmExplicit

func (c *IntegrationConfig) RealmExplicit() bool

RealmExplicit reports whether Realm was configured explicitly, so names that users type (kube contexts) and see (kube users) may include it. A derived realm still isolates credentials, but must not change those names.

type IntegrationFactory

type IntegrationFactory func(config *IntegrationConfig) (Integration, error)

IntegrationFactory creates integrations from configuration.

type RegistryCredentialProvider

type RegistryCredentialProvider interface {
	ExchangeCredentials(context.Context, types.ICredentials) (*types.OCICredentials, error)
}

RegistryCredentialProvider exchanges identity credentials directly for a registry token. It does not publish credentials to shared Docker files or invoke ambient helpers.

Directories

Path Synopsis
Package github implements the github/sts auth integration: a just-in-time, least-privilege GitHub token broker for CI.
Package github implements the github/sts auth integration: a just-in-time, least-privilege GitHub token broker for CI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL