auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEnvToken

func LoadEnvToken() string

Types

type CredentialStore

type CredentialStore interface {
	Save(profile config.Profile, token string) (config.Profile, error)
	Load(profile config.Profile) (*StoredCredential, error)
	Delete(profile config.Profile) error
}

type FileStore

type FileStore struct{}

func (FileStore) Delete

func (s FileStore) Delete(profile config.Profile) error

func (FileStore) Load

func (s FileStore) Load(profile config.Profile) (*StoredCredential, error)

func (FileStore) Save

func (s FileStore) Save(profile config.Profile, token string) (config.Profile, error)

type KeychainStore

type KeychainStore struct{}

func (KeychainStore) Delete

func (s KeychainStore) Delete(profile config.Profile) error

func (KeychainStore) Load

func (s KeychainStore) Load(profile config.Profile) (*StoredCredential, error)

func (KeychainStore) Save

func (s KeychainStore) Save(profile config.Profile, token string) (config.Profile, error)

type LoginInput

type LoginInput struct {
	ProfileName string
	Environment string
	APIKey      string
	StorageMode config.StorageMode
}

type LoginResult

type LoginResult struct {
	Profile           config.Profile `json:"profile"`
	FileSaved         bool           `json:"file_saved"`
	KeychainMirrored  bool           `json:"keychain_mirrored"`
	KeychainAvailable bool           `json:"keychain_available"`
	Warnings          []string       `json:"warnings,omitempty"`
	MCPReady          bool           `json:"mcp_ready"`
}

type ProfileSummary

type ProfileSummary struct {
	Profile                 config.Profile `json:"profile"`
	IsDefault               bool           `json:"is_default"`
	FileCredentialAvailable bool           `json:"file_credential_available"`
	KeychainCredentialAvail bool           `json:"keychain_credential_available"`
	PreferredRuntimeSource  string         `json:"preferred_runtime_source,omitempty"`
	MCPReady                bool           `json:"mcp_ready"`
	CredentialError         string         `json:"credential_error,omitempty"`
	Warnings                []string       `json:"warnings,omitempty"`
}

type ResolveInput

type ResolveInput struct {
	ProfileName string
	Environment string
	APIKey      string
}

type ResolvedAuth

type ResolvedAuth struct {
	ProfileName string
	Environment string
	Token       string
	TokenSource string
}

type Service

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

func NewService

func NewService() Service

func (Service) Export

func (s Service) Export(input ResolveInput) (map[string]string, error)

func (Service) ListProfiles

func (s Service) ListProfiles() ([]ProfileSummary, error)

func (Service) Logout

func (s Service) Logout(profileName string) error

func (Service) Resolve

func (s Service) Resolve(input ResolveInput) (*ResolvedAuth, error)

func (Service) SaveLogin

func (s Service) SaveLogin(input LoginInput) (LoginResult, error)

func (Service) Status

func (s Service) Status(profileName string) (StatusResult, error)

func (Service) UseProfile

func (s Service) UseProfile(profileName string) (ProfileSummary, error)

type StatusResult

type StatusResult struct {
	Profile                 config.Profile `json:"profile"`
	FileCredentialAvailable bool           `json:"file_credential_available"`
	KeychainCredentialAvail bool           `json:"keychain_credential_available"`
	PreferredRuntimeSource  string         `json:"preferred_runtime_source,omitempty"`
	MCPReady                bool           `json:"mcp_ready"`
	CredentialError         string         `json:"credential_error,omitempty"`
	Warnings                []string       `json:"warnings,omitempty"`
}

type StoredCredential

type StoredCredential struct {
	Token  string
	Source string
}

Jump to

Keyboard shortcuts

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