Documentation
¶
Index ¶
- Constants
- type Attributes
- type Clock
- type Config
- func (c *Config) AWSCredentials() string
- func (c *Config) AWSIAMIdP() string
- func (c *Config) AWSIAMRole() string
- func (c *Config) AWSRegion() string
- func (c *Config) AWSSTSRoleSessionName() string
- func (c *Config) AWSSessionDuration() int64
- func (c *Config) AllProfiles() bool
- func (c *Config) AuthzID() string
- func (c *Config) CacheAccessToken() bool
- func (c *Config) Clock() Clock
- func (c *Config) CustomScope() string
- func (c *Config) Debug() bool
- func (c *Config) DebugAPICalls() bool
- func (c *Config) Exec() bool
- func (c *Config) ExpiryAWSVariables() bool
- func (c *Config) FedAppID() string
- func (c *Config) Format() string
- func (c *Config) HTTPClient() *http.Client
- func (c *Config) IsProcessCredentialsFormat() bool
- func (c *Config) KeyID() string
- func (c *Config) LegacyAWSVariables() bool
- func (c *Config) OIDCAppID() string
- func (c *Config) OpenBrowser() bool
- func (c *Config) OpenBrowserCommand() string
- func (c *Config) OrgDomain() string
- func (c *Config) Password() string
- func (c *Config) PrivateKey() string
- func (c *Config) PrivateKeyFile() string
- func (c *Config) Profile() string
- func (c *Config) QRCode() bool
- func (c *Config) ReadConfigProfileKeys() ([]string, error)
- func (c *Config) RunConfigChecks() (err error)
- func (c *Config) SetAWSCredentials(credentials string) error
- func (c *Config) SetAWSIAMIdP(idp string) error
- func (c *Config) SetAWSIAMRole(role string) error
- func (c *Config) SetAWSRegion(region string) error
- func (c *Config) SetAWSSTSRoleSessionName(name string) error
- func (c *Config) SetAWSSessionDuration(duration int64) error
- func (c *Config) SetAllProfiles(allProfiles bool) error
- func (c *Config) SetAuthzID(authzID string) error
- func (c *Config) SetCacheAccessToken(cacheAccessToken bool) error
- func (c *Config) SetClock(clock Clock)
- func (c *Config) SetCustomScope(customScope string) error
- func (c *Config) SetDebug(debug bool) error
- func (c *Config) SetDebugAPICalls(debugAPICalls bool) error
- func (c *Config) SetExec(exec bool) error
- func (c *Config) SetExpiryAWSVariables(expiryAWSVariables bool) error
- func (c *Config) SetFedAppID(appID string) error
- func (c *Config) SetFormat(format string) error
- func (c *Config) SetHTTPClient(client *http.Client) error
- func (c *Config) SetKeyID(keyID string) error
- func (c *Config) SetLegacyAWSVariables(legacyAWSVariables bool) error
- func (c *Config) SetOIDCAppID(appID string) error
- func (c *Config) SetOpenBrowser(openBrowser bool) error
- func (c *Config) SetOpenBrowserCommand(openBrowserCommand string) error
- func (c *Config) SetOrgDomain(domain string) error
- func (c *Config) SetPassword(password string) error
- func (c *Config) SetPrivateKey(privateKey string) error
- func (c *Config) SetPrivateKeyFile(privateKeyFile string) error
- func (c *Config) SetProfile(profile string) error
- func (c *Config) SetQRCode(qrCode bool) error
- func (c *Config) SetShortUserAgent(shortUserAgent bool) error
- func (c *Config) SetUsername(username string) error
- func (c *Config) SetWriteAWSCredentials(writeCredentials bool) error
- func (c *Config) ShortUserAgent() bool
- func (c *Config) UserAgent() string
- func (c *Config) Username() string
- func (c *Config) WriteAWSCredentials() bool
- type OktaYamlConfig
- type OktaYamlConfigProfile
Constants ¶
const ( // Version app version Version = "2.6.0" // AWSCredentialsFormat format const AWSCredentialsFormat = "aws-credentials" // EnvVarFormat format const EnvVarFormat = "env-var" // ProcessCredentialsFormat format const ProcessCredentialsFormat = "process-credentials" // NoopFormat format const NoopFormat = "noop" // AllProfilesFlag cli flag const AllProfilesFlag = "all-profiles" // AuthzIDFlag cli flag const AuthzIDFlag = "authz-id" // AWSAcctFedAppIDFlag cli flag const AWSAcctFedAppIDFlag = "aws-acct-fed-app-id" // AWSCredentialsFlag cli flag const AWSCredentialsFlag = "aws-credentials" // AWSIAMIdPFlag cli flag const AWSIAMIdPFlag = "aws-iam-idp" // AWSIAMRoleFlag cli flag const AWSIAMRoleFlag = "aws-iam-role" // AWSRegionFlag cli flag const AWSRegionFlag = "aws-region" // AWSSessionDurationFlag cli flag const AWSSessionDurationFlag = "aws-session-duration" // AWSSTSRoleSessionNameFlag cli flag const AWSSTSRoleSessionNameFlag = "aws-sts-role-session-name" // CustomScopeFlag cli flag const CustomScopeFlag = "custom-scope" // DebugFlag cli flag const DebugFlag = "debug" // DebugAPICallsFlag cli flag const DebugAPICallsFlag = "debug-api-calls" // ExecFlag cli flag const ExecFlag = "exec" // FormatFlag cli flag const FormatFlag = "format" // OIDCClientIDFlag cli flag const OIDCClientIDFlag = "oidc-client-id" // OpenBrowserFlag cli flag const OpenBrowserFlag = "open-browser" // OpenBrowserCommandFlag cli flag const OpenBrowserCommandFlag = "open-browser-command" // OrgDomainFlag cli flag const OrgDomainFlag = "org-domain" // PrivateKeyFlag cli flag const PrivateKeyFlag = "private-key" // PrivateKeyFileFlag cli flag const PrivateKeyFileFlag = "private-key-file" // KeyIDFlag cli flag const KeyIDFlag = "key-id" // ProfileFlag cli flag const ProfileFlag = "profile" // QRCodeFlag cli flag const QRCodeFlag = "qr-code" // SessionDurationFlag DEPRECATED cli flag const SessionDurationFlag = "session-duration" // ShortUserAgentFlag cli flag const ShortUserAgentFlag = "short-user-agent" // WriteAWSCredentialsFlag cli flag const WriteAWSCredentialsFlag = "write-aws-credentials" // LegacyAWSVariablesFlag cli flag const LegacyAWSVariablesFlag = "legacy-aws-variables" // ExpiryAWSVariablesFlag cli flag const ExpiryAWSVariablesFlag = "expiry-aws-variables" // CacheAccessTokenFlag cli flag const CacheAccessTokenFlag = "cache-access-token" // UsernameFlag cli flag const UsernameFlag = "username" // PasswordFlag cli flag const PasswordFlag = "password" // AllProfilesEnvVar env var const AllProfilesEnvVar = "OKTA_AWSCLI_ALL_PROFILES" // AuthzIDEnvVar env var const AuthzIDEnvVar = "OKTA_AWSCLI_AUTHZ_ID" // AWSCredentialsEnvVar env var const AWSCredentialsEnvVar = "OKTA_AWSCLI_AWS_CREDENTIALS" // AWSIAMIdPEnvVar env var const AWSIAMIdPEnvVar = "OKTA_AWSCLI_IAM_IDP" // AWSIAMRoleEnvVar env var const AWSIAMRoleEnvVar = "OKTA_AWSCLI_IAM_ROLE" // AWSSessionDurationEnvVar env var const AWSSessionDurationEnvVar = "OKTA_AWSCLI_SESSION_DURATION" // AWSRegionEnvVar env var const AWSRegionEnvVar = "OKTA_AWSCLI_AWS_REGION" // AWSSTSRoleSessionNameEnvVar env var const AWSSTSRoleSessionNameEnvVar = "OKTA_AWSCLI_STS_ROLE_SESSION_NAME" // CacheAccessTokenEnvVar env var const CacheAccessTokenEnvVar = "OKTA_AWSCLI_CACHE_ACCESS_TOKEN" // CustomScopeEnvVar env var const CustomScopeEnvVar = "OKTA_AWSCLI_CUSTOM_SCOPE" // DebugEnvVar env var const DebugEnvVar = "OKTA_AWSCLI_DEBUG" // DebugAPICallsEnvVar env var const DebugAPICallsEnvVar = "OKTA_AWSCLI_DEBUG_API_CALLS" // ExpiryAWSVariablesEnvVar env var const ExpiryAWSVariablesEnvVar = "OKTA_AWSCLI_EXPIRY_AWS_VARIABLES" // ExecEnvVar env var const ExecEnvVar = "OKTA_AWSCLI_EXEC" // FormatEnvVar env var const FormatEnvVar = "OKTA_AWSCLI_FORMAT" // LegacyAWSVariablesEnvVar env var const LegacyAWSVariablesEnvVar = "OKTA_AWSCLI_LEGACY_AWS_VARIABLES" // OktaOIDCClientIDEnvVar env var const OktaOIDCClientIDEnvVar = "OKTA_AWSCLI_OIDC_CLIENT_ID" // OldOktaOIDCClientIDEnvVar env var const OldOktaOIDCClientIDEnvVar = "OKTA_OIDC_CLIENT_ID" // OktaOrgDomainEnvVar env var const OktaOrgDomainEnvVar = "OKTA_AWSCLI_ORG_DOMAIN" // OldOktaOrgDomainEnvVar env var const OldOktaOrgDomainEnvVar = "OKTA_ORG_DOMAIN" // OktaAWSAccountFederationAppIDEnvVar env var const OktaAWSAccountFederationAppIDEnvVar = "OKTA_AWSCLI_AWS_ACCOUNT_FEDERATION_APP_ID" // OldOktaAWSAccountFederationAppIDEnvVar env var const OldOktaAWSAccountFederationAppIDEnvVar = "OKTA_AWS_ACCOUNT_FEDERATION_APP_ID" // OpenBrowserEnvVar env var const OpenBrowserEnvVar = "OKTA_AWSCLI_OPEN_BROWSER" // OpenBrowserCommandEnvVar env var const OpenBrowserCommandEnvVar = "OKTA_AWSCLI_OPEN_BROWSER_COMMAND" // PrivateKeyEnvVar env var const PrivateKeyEnvVar = "OKTA_AWSCLI_PRIVATE_KEY" // PrivateKeyFileEnvVar env var const PrivateKeyFileEnvVar = "OKTA_AWSCLI_PRIVATE_KEY_FILE" // KeyIDEnvVar env var const KeyIDEnvVar = "OKTA_AWSCLI_KEY_ID" // ProfileEnvVar env var const ProfileEnvVar = "OKTA_AWSCLI_PROFILE" // QRCodeEnvVar env var const QRCodeEnvVar = "OKTA_AWSCLI_QR_CODE" // ShortUserAgentEnvVar env var const ShortUserAgentEnvVar = "OKTA_AWSCLI_DEBUG_SHORT_USER_AGENT" // WriteAWSCredentialsEnvVar env var const WriteAWSCredentialsEnvVar = "OKTA_AWSCLI_WRITE_AWS_CREDENTIALS" // UsernameEnvVar env var const UsernameEnvVar = "OKTA_AWSCLI_USERNAME" // PasswordEnvVar env var const PasswordEnvVar = "OKTA_AWSCLI_PASSWORD" // CannotBeBlankErrMsg error message const CannotBeBlankErrMsg = "cannot be blank" // OrgDomainMsg error message const OrgDomainMsg = "Org Domain" // DotOkta string const DotOkta = ".okta" // OktaYaml string const OktaYaml = "okta.yaml" )
const PrependDebug = "[DEBUG] "
PrependDebug debug logline label
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes struct {
AllProfiles bool
AuthzID string
AWSCredentials string
AWSIAMIdP string
AWSIAMRole string
AWSRegion string
AWSSessionDuration int64
AWSSTSRoleSessionName string
CacheAccessToken bool
CustomScope string
Debug bool
DebugAPICalls bool
Exec bool
ExpiryAWSVariables bool
FedAppID string
Format string
KeyID string
LegacyAWSVariables bool
OIDCAppID string
OpenBrowser bool
OpenBrowserCommand string
OrgDomain string
PrivateKey string
PrivateKeyFile string
Profile string
QRCode bool
ShortUserAgent bool
WriteAWSCredentials bool
Username string
Password string
}
Attributes attributes for config construction
type Config ¶
Config A config object for the CLI
External consumers of Config use its setters and getters to interact with the underlying data values encapsulated on the Attribute. This allows Config to control data access, be concerned with evaluation, validation, and not allowing direct access to values as is done on structs in the generic case.
func NewConfig ¶
func NewConfig(attrs *Attributes) (*Config, error)
NewConfig create config from attributes
func NewEvaluatedConfig ¶
NewEvaluatedConfig Returns a new config loading and evaluating attributes in this order of precedence:
- CLI flags
- ENV variables
- .env file
func (*Config) AWSSTSRoleSessionName ¶
AWSSTSRoleSessionName --
func (*Config) AWSSessionDuration ¶
AWSSessionDuration --
func (*Config) ExpiryAWSVariables ¶
ExpiryAWSVariables --
func (*Config) IsProcessCredentialsFormat ¶
IsProcessCredentialsFormat is our format process credentials?
func (*Config) LegacyAWSVariables ¶
LegacyAWSVariables --
func (*Config) OpenBrowserCommand ¶
OpenBrowserCommand --
func (*Config) ReadConfigProfileKeys ¶
ReadConfigProfileKeys returns the config profile names
func (*Config) RunConfigChecks ¶
RunConfigChecks runs a series of checks on the okta.yaml config file
func (*Config) SetAWSCredentials ¶
SetAWSCredentials --
func (*Config) SetAWSSTSRoleSessionName ¶
SetAWSSTSRoleSessionName --
func (*Config) SetAWSSessionDuration ¶
SetAWSSessionDuration --
func (*Config) SetAllProfiles ¶
SetAllProfiles --
func (*Config) SetCacheAccessToken ¶
SetCacheAccessToken --
func (*Config) SetCustomScope ¶
SetCustomScope --
func (*Config) SetDebugAPICalls ¶
SetDebugAPICalls --
func (*Config) SetExpiryAWSVariables ¶
SetExpiryAWSVariables --
func (*Config) SetHTTPClient ¶
SetHTTPClient --
func (*Config) SetLegacyAWSVariables ¶
SetLegacyAWSVariables --
func (*Config) SetOpenBrowser ¶
SetOpenBrowser --
func (*Config) SetOpenBrowserCommand ¶
SetOpenBrowserCommand --
func (*Config) SetPrivateKey ¶
SetPrivateKey --
func (*Config) SetPrivateKeyFile ¶
SetPrivateKeyFile --
func (*Config) SetShortUserAgent ¶
SetShortUserAgent --
func (*Config) SetWriteAWSCredentials ¶
SetWriteAWSCredentials --
func (*Config) WriteAWSCredentials ¶
WriteAWSCredentials --
type OktaYamlConfig ¶
type OktaYamlConfig struct {
AWSCLI struct {
IDPS map[string]string `yaml:"idps"`
ROLES map[string]string `yaml:"roles"`
PROFILES map[string]OktaYamlConfigProfile `yaml:"profiles"`
} `yaml:"awscli"`
}
OktaYamlConfig represents config settings from $HOME/.okta/okta.yaml
func NewOktaYamlConfig ¶
func NewOktaYamlConfig() (config *OktaYamlConfig, err error)
NewOktaYamlConfig returns an Okta YAML Config object representation of $HOME/.okta/okta.yaml
type OktaYamlConfigProfile ¶
type OktaYamlConfigProfile struct {
AllProfiles string `yaml:"all-profiles"`
AuthzID string `yaml:"authz-id"`
AWSAcctFedAppID string `yaml:"aws-acct-fed-app-id"`
AWSCredentials string `yaml:"aws-credentials"`
AWSIAMIdP string `yaml:"aws-iam-idp"`
AWSIAMRole string `yaml:"aws-iam-role"`
AWSRegion string `yaml:"aws-region"`
AWSSessionDuration string `yaml:"aws-session-duration"`
AWSSTSRoleSessionName string `yaml:"aws-sts-role-session-name"`
CustomScope string `yaml:"custom-scope"`
Debug string `yaml:"debug"`
DebugAPICalls string `yaml:"debug-api-calls"`
Exec string `yaml:"exec"`
Format string `yaml:"format"`
OIDCClientID string `yaml:"oidc-client-id"`
OpenBrowser string `yaml:"open-browser"`
OpenBrowserCommand string `yaml:"open-browser-command"`
OrgDomain string `yaml:"org-domain"`
PrivateKey string `yaml:"private-key"`
PrivateKeyFile string `yaml:"private-key-file"`
KeyID string `yaml:"key-id"`
Profile string `yaml:"profile"`
QRCode string `yaml:"qr-code"`
SessionDuration string `yaml:"session-duration"`
WriteAWSCredentials string `yaml:"write-aws-credentials"`
LegacyAWSVariables string `yaml:"legacy-aws-variables"`
ExpiryAWSVariables string `yaml:"expiry-aws-variables"`
CacheAccessToken string `yaml:"cache-access-token"`
Username string `yaml:"username"`
Password string `yaml:"password"`
}
OktaYamlConfigProfile represents config settings that are indexed by profile name. This is a convenience struct pretty printing profile information from the list profiles command cmd/root/profileslist/profiles-list.go