deferred

package
v1.231.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package deferred resolves Atmos authentication at the first credential request.

Package deferred is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthDisabled

func AuthDisabled(manager any) bool

AuthDisabled distinguishes explicit disable from deferred credentials.

func ConfigureAuth

func ConfigureAuth(ac *schema.AtmosConfiguration, identity string) bool

ConfigureAuth defers implicit authentication and records explicit disable. False means an explicit identity was requested and the caller must authenticate it.

func Credentials

Credentials defers identity selection and authentication until resolution. Configuration and stack info are copied so nested consumers cannot overwrite their caller's selected identity or populated credentials.

func DefaultIdentity

func DefaultIdentity(ac *schema.AtmosConfiguration, info *schema.ConfigAndStacksInfo) (string, error)

DefaultIdentity selects a backend's default without authenticating it.

func IsDeferred

func IsDeferred(manager any) bool

IsDeferred reports the manager's evaluation policy, without resolving credentials.

Types

type AuthFactory

type AuthFactory interface {
	Create(*schema.AtmosConfiguration, *schema.AuthConfig, string) (auth.AuthManager, error)
}

AuthFactory authenticates when a list/describe value needs credentials.

type AuthOptions

type AuthOptions struct {
	Disabled bool
	Factory  AuthFactory
	Config   *schema.AtmosConfiguration
}

AuthOptions supplies invocation-local dependencies and the explicit disable policy.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Results are created on demand and memoize either an authenticated manager or a failure. Disabled remains an explicit policy, not an absent manager.

func NewManager

func NewManager(opts AuthOptions) *Manager

NewManager creates an invocation-scoped resolver with an empty result cache.

func (*Manager) Authenticate

func (m *Manager) Authenticate(ctx context.Context, identityName string) (*types.WhoamiInfo, error)

Authenticate delegates an explicitly requested auth operation.

func (*Manager) AuthenticateProvider

func (m *Manager) AuthenticateProvider(ctx context.Context, providerName string) (*types.WhoamiInfo, error)

AuthenticateProvider delegates an explicitly requested auth operation.

func (*Manager) CredentialStoreType

func (m *Manager) CredentialStoreType() string

CredentialStoreType delegates an explicitly requested auth operation.

func (*Manager) Disabled

func (r *Manager) Disabled() bool

Disabled reports an explicit request not to use Atmos authentication.

func (*Manager) EnsureIdentityEnvironment

func (m *Manager) EnsureIdentityEnvironment(ctx context.Context, identityName string) (map[string]string, error)

EnsureIdentityEnvironment delegates an explicitly requested auth operation.

func (*Manager) ExecuteIdentityIntegrations

func (m *Manager) ExecuteIdentityIntegrations(ctx context.Context, identityName string) error

ExecuteIdentityIntegrations delegates an explicitly requested auth operation.

func (*Manager) ExecuteIntegration

func (m *Manager) ExecuteIntegration(ctx context.Context, integrationName string) error

ExecuteIntegration delegates an explicitly requested auth operation.

func (*Manager) GetCachedCredentials

func (m *Manager) GetCachedCredentials(ctx context.Context, identityName string) (*types.WhoamiInfo, error)

GetCachedCredentials delegates an explicitly requested auth operation.

func (*Manager) GetChain

func (m *Manager) GetChain() []string

GetChain never initializes or authenticates an unused manager.

func (*Manager) GetDefaultIdentity

func (m *Manager) GetDefaultIdentity(forceSelect bool) (string, error)

GetDefaultIdentity delegates an explicitly requested auth operation.

func (*Manager) GetEnvironmentVariables

func (m *Manager) GetEnvironmentVariables(identityName string) (map[string]string, error)

GetEnvironmentVariables delegates an explicitly requested auth operation.

func (*Manager) GetFilesDisplayPath

func (m *Manager) GetFilesDisplayPath(providerName string) string

GetFilesDisplayPath delegates an explicitly requested auth operation.

func (*Manager) GetIdentities

func (m *Manager) GetIdentities() map[string]schema.Identity

GetIdentities delegates an explicitly requested auth operation.

func (*Manager) GetIntegration

func (m *Manager) GetIntegration(integrationName string) (*schema.Integration, error)

GetIntegration delegates an explicitly requested auth operation.

func (*Manager) GetProviderForIdentity

func (m *Manager) GetProviderForIdentity(identityName string) string

GetProviderForIdentity delegates an explicitly requested auth operation.

func (*Manager) GetProviderKindForIdentity

func (m *Manager) GetProviderKindForIdentity(identityName string) (string, error)

GetProviderKindForIdentity delegates an explicitly requested auth operation.

func (*Manager) GetProviders

func (m *Manager) GetProviders() map[string]schema.Provider

GetProviders delegates an explicitly requested auth operation.

func (*Manager) GetRealm

func (m *Manager) GetRealm() realm.RealmInfo

GetRealm delegates an explicitly requested auth operation.

func (*Manager) GetStackInfo

func (m *Manager) GetStackInfo() *schema.ConfigAndStacksInfo

GetStackInfo never initializes or authenticates an unused manager.

func (*Manager) ListIdentities

func (m *Manager) ListIdentities() []string

ListIdentities delegates an explicitly requested auth operation.

func (*Manager) ListProviders

func (m *Manager) ListProviders() []string

ListProviders delegates an explicitly requested auth operation.

func (*Manager) Logout

func (m *Manager) Logout(ctx context.Context, identityName string, deleteKeychain bool) error

Logout delegates an explicitly requested auth operation.

func (*Manager) LogoutAll

func (m *Manager) LogoutAll(ctx context.Context, deleteKeychain bool) error

LogoutAll delegates an explicitly requested auth operation.

func (*Manager) LogoutProvider

func (m *Manager) LogoutProvider(ctx context.Context, providerName string, deleteKeychain bool) error

LogoutProvider delegates an explicitly requested auth operation.

func (*Manager) MaybeOfferAnyProfileFallback

func (m *Manager) MaybeOfferAnyProfileFallback(ctx context.Context) error

MaybeOfferAnyProfileFallback delegates an explicitly requested auth operation.

func (*Manager) PrepareShellEnvironment

func (m *Manager) PrepareShellEnvironment(ctx context.Context, identityName string, currentEnv []string) ([]string, error)

PrepareShellEnvironment delegates an explicitly requested auth operation.

func (*Manager) Resolve

func (*Manager) ResolvePrincipalSetting

func (m *Manager) ResolvePrincipalSetting(identityName, key string) (interface{}, bool)

ResolvePrincipalSetting delegates an explicitly requested auth operation.

func (*Manager) ResolveProviderConfig

func (m *Manager) ResolveProviderConfig(identityName string) (*schema.Provider, bool)

ResolveProviderConfig delegates an explicitly requested auth operation.

func (*Manager) RevokeEphemeralIntegrations

func (m *Manager) RevokeEphemeralIntegrations(ctx context.Context, identityName string, globalDefault *bool) error

RevokeEphemeralIntegrations delegates an explicitly requested auth operation.

func (*Manager) Validate

func (m *Manager) Validate() error

Validate delegates an explicitly requested auth operation.

func (*Manager) Whoami

func (m *Manager) Whoami(ctx context.Context, identityName string) (*types.WhoamiInfo, error)

Whoami delegates an explicitly requested auth operation.

type MockAuthFactory

type MockAuthFactory struct {
	// contains filtered or unexported fields
}

MockAuthFactory is a mock of AuthFactory interface.

func NewMockAuthFactory

func NewMockAuthFactory(ctrl *gomock.Controller) *MockAuthFactory

NewMockAuthFactory creates a new mock instance.

func (*MockAuthFactory) Create

Create mocks base method.

func (*MockAuthFactory) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockAuthFactoryMockRecorder

type MockAuthFactoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockAuthFactoryMockRecorder is the mock recorder for MockAuthFactory.

func (*MockAuthFactoryMockRecorder) Create

func (mr *MockAuthFactoryMockRecorder) Create(arg0, arg1, arg2 any) *gomock.Call

Create indicates an expected call of Create.

Jump to

Keyboard shortcuts

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