Documentation
¶
Index ¶
- Constants
- Variables
- func AliyunConfigPath(getenv func(string) string) string
- func ConfigPath(getenv func(string) string) string
- func CredentialProfileAuthDigest(profile map[string]any) [sha256.Size]byte
- func EcctlConfigPath(getenv func(string) string) string
- func NormalizeOAuthAccountID(accountID string) (string, error)
- func NormalizeOAuthProfileName(name string) (string, error)
- func ProfileName(explicit string, getenv func(string) string) string
- func ResolveRegion(explicit string, getenv func(string) string) (string, *ecerrors.AppError)
- func ResolveRegionForProfile(explicit string, profile string, configPath string, getenv func(string) string) (string, *ecerrors.AppError)
- func TelemetryEnabled(path string) bool
- func ValidRegion(region string) bool
- type ConfigItem
- type ConfigValue
- type NativeOAuthProfileState
- type Profile
- type RegionSource
- type ResolvedRegion
- type Store
- func (s *Store) ConfigItems(name string, showSecret bool) ([]ConfigItem, error)
- func (s *Store) Current() string
- func (s *Store) GetValue(name string, key string, showSecret bool) (ConfigValue, error)
- func (s *Store) NativeOAuthProfileState(name string) NativeOAuthProfileState
- func (s *Store) PreflightNativeOAuthWrite(ctx context.Context) error
- func (s *Store) Profile(name string) (Profile, bool)
- func (s *Store) RequestedPath() string
- func (s *Store) ResolvedPath() string
- func (s *Store) Save() error
- func (s *Store) SaveContext(ctx context.Context) error
- func (s *Store) SetCurrentProfile(name string) error
- func (s *Store) SetNativeOAuthProfile(state NativeOAuthProfileState, siteType, generation, accountID string) error
- func (s *Store) SetRegion(name string, region string) error
- func (s *Store) SetValue(name string, key string, value string) (ConfigValue, error)
- func (s *Store) UseProfile(name string) error
Constants ¶
View Source
const DefaultProfileName = "default"
Variables ¶
View Source
var ErrCredentialProfileChanged = errors.New("credential profile changed during OAuth login")
Functions ¶
func AliyunConfigPath ¶
func ConfigPath ¶
func CredentialProfileAuthDigest ¶ added in v0.2.2
func EcctlConfigPath ¶
func NormalizeOAuthAccountID ¶ added in v0.2.2
func NormalizeOAuthProfileName ¶ added in v0.2.2
func ResolveRegion ¶
func ResolveRegionForProfile ¶
func TelemetryEnabled ¶ added in v0.2.0
TelemetryEnabled reads the global, profile-independent telemetry switch. Missing configuration defaults to true; malformed configuration fails closed so telemetry can never make an otherwise usable CLI fail.
func ValidRegion ¶
Types ¶
type ConfigItem ¶
type ConfigItem struct {
Key string `json:"key"`
StoredAs string `json:"stored_as"`
Description string `json:"description"`
Value string `json:"value,omitempty"`
Type string `json:"type"`
Allowed []string `json:"allowed,omitempty"`
Sensitive bool `json:"sensitive,omitempty"`
SetExample string `json:"set_example"`
}
func EffectiveItems ¶
func SupportedItems ¶
func SupportedItems() []ConfigItem
type ConfigValue ¶
type ConfigValue struct {
Key string `json:"key"`
Value string `json:"value"`
Sensitive bool `json:"sensitive,omitempty"`
}
func ConfigValueFromProfile ¶
func ConfigValueFromProfile(profile Profile, key string, showSecret bool) (ConfigValue, error)
func EffectiveValue ¶
type NativeOAuthProfileState ¶ added in v0.2.2
type Profile ¶
type RegionSource ¶ added in v0.2.1
type RegionSource uint8
RegionSource records which input won region resolution. Callers must keep this provenance until credential profile policy has been applied: ignoring credential profiles must discard a stored profile region, but it must not discard an explicit flag or ECCTL_REGION.
const ( RegionSourceUnset RegionSource = iota RegionSourceExplicit RegionSourceECCTL RegionSourceAlibabaEnv RegionSourceProfile )
type ResolvedRegion ¶ added in v0.2.1
type ResolvedRegion struct {
Value string
Source RegionSource
}
func ResolveRegionForProfileWithSource ¶ added in v0.2.1
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func LoadNativeOAuthStore ¶ added in v0.2.2
LoadNativeOAuthStore freezes and strictly validates the ecctl configuration target before an interactive login begins. OAuth tokens are never stored in this general configuration file.
func (*Store) ConfigItems ¶
func (s *Store) ConfigItems(name string, showSecret bool) ([]ConfigItem, error)
func (*Store) NativeOAuthProfileState ¶ added in v0.2.2
func (s *Store) NativeOAuthProfileState(name string) NativeOAuthProfileState
func (*Store) PreflightNativeOAuthWrite ¶ added in v0.2.2
func (*Store) RequestedPath ¶ added in v0.2.2
func (*Store) ResolvedPath ¶ added in v0.2.2
func (*Store) SetCurrentProfile ¶
func (*Store) SetNativeOAuthProfile ¶ added in v0.2.2
func (s *Store) SetNativeOAuthProfile(state NativeOAuthProfileState, siteType, generation, accountID string) error
func (*Store) UseProfile ¶
Click to show internal directories.
Click to hide internal directories.