auth

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: 38 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

Overview

Package auth adapts native plugin auth services to the shared Atmos auth authregistry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdentityConstructor

func IdentityConstructor(definition *Definition, accepts []string, materialize MaterializerFactory) authregistry.IdentityConfigConstructor

IdentityConstructor registers a native identity with explicit accepted credential types.

func ProviderConstructor

func ProviderConstructor(definition *Definition) authregistry.ProviderConfigConstructor

ProviderConstructor supplies the same full-configuration constructor used by built-in auth.

Types

type Definition

type Definition struct {
	Package    string
	Expected   *pluginv1.DescribeResponse
	Executable string
	Directory  string
	Outputs    []string
	Schema     func(any) error
	// SchemaTarget selects principal or spec for identity validation; empty preserves principal.
	SchemaTarget string
	Services     Services
	Credentials  *credential.Registry
	// Timeout bounds every call into the plugin; zero means no deadline. In an interactive
	// call, time spent waiting for the user to sign in does not count against it.
	Timeout time.Duration
	// InteractionLimit bounds that user wait when Timeout is set; zero means
	// native.DefaultInteractionLimit. It comes from plugins.packages.<alias>.interaction_timeout.
	InteractionLimit time.Duration
	// Alias is the package's key under plugins.packages, so errors can name its configuration.
	Alias string
}

Definition binds a statically validated export to its immutable package executable.

type Materializer

type Materializer interface {
	Apply(context.Context, *types.PostAuthenticateParams) error
	Environment() (map[string]string, error)
	Paths() ([]types.Path, error)
	Logout(context.Context) error
	SetRealm(string)
	Load(context.Context) (types.ICredentials, error)
	PrepareEnvironment(map[string]string) (map[string]string, error)
	SetRootProvider(string)
}

Materializer applies decoded credentials to an Atmos execution environment. Credential contracts provide this seam; the plugin runtime never writes cloud files.

func AWSMaterializer

func AWSMaterializer(name string, config *schema.Identity) Materializer

AWSMaterializer reuses the built-in AWS profile and auth-context implementation.

func EnvironmentMaterializer

func EnvironmentMaterializer(string, *schema.Identity) Materializer

EnvironmentMaterializer keeps environment credentials scoped to this identity.

type MaterializerFactory

type MaterializerFactory func(string, *schema.Identity) Materializer

MaterializerFactory creates invocation-local cloud file/environment state.

type Services

type Services struct {
	HTTP            api.HTTP
	Keyring         keyring.Keyring
	CredentialStore types.CredentialStore
	Browser         api.Browser
	Interactive     func() bool
	LockDirectory   string
	Secrets         func(string, map[string]any) bridge.SecretReader
}

Services are Atmos-owned dependencies; plugin configuration cannot replace them.

Jump to

Keyboard shortcuts

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