Documentation
¶
Overview ¶
Package aws_sdk_go_v2_sso_login implements the AWS SSO OIDC flow, including optionally opening a browser with the AWS SSO auth URL.
THIS IS NOT AN OFFICIAL PART OF aws-sdk-go-v2. This was not created, endorsed, checked by Amazon/AWS.
Index ¶
- type BrowserOpenError
- type CacheFileCreationError
- type CacheFilepathGenerationError
- type ConfigFileLoadError
- type CredCacheError
- type GetCallerIdError
- type IdentityResult
- type LoadingConfigFileError
- type LoginInput
- type LoginOutput
- type MissingProfileError
- type OsUserError
- type ProfileValidationError
- type SsoOidcClientError
- type SsoOidcTokenCreationError
- type StartDeviceAuthorizationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrowserOpenError ¶ added in v0.2.0
type BrowserOpenError struct {
Err error
}
BrowserOpenError Failed to open a browser
func (BrowserOpenError) Error ¶ added in v0.2.0
func (e BrowserOpenError) Error() string
func (BrowserOpenError) Unwrap ¶ added in v0.2.0
func (e BrowserOpenError) Unwrap() error
type CacheFileCreationError ¶ added in v0.2.0
func (CacheFileCreationError) Error ¶ added in v0.2.0
func (e CacheFileCreationError) Error() string
func (CacheFileCreationError) Unwrap ¶ added in v0.2.0
func (e CacheFileCreationError) Unwrap() error
type CacheFilepathGenerationError ¶ added in v0.2.0
CacheFilepathGenerationError failed to generate a valid filepath for the given SSO start URL
func NewCacheFilepathGenerationError ¶ added in v0.2.0
func NewCacheFilepathGenerationError(ProfileName string, ProfileSSOStartURL string, err error) CacheFilepathGenerationError
func (CacheFilepathGenerationError) Error ¶ added in v0.2.0
func (e CacheFilepathGenerationError) Error() string
func (CacheFilepathGenerationError) Unwrap ¶ added in v0.2.0
func (e CacheFilepathGenerationError) Unwrap() error
type ConfigFileLoadError ¶ added in v0.2.0
type ConfigFileLoadError struct {
Err error
}
ConfigFileLoadError failed to load default config
func (ConfigFileLoadError) Error ¶ added in v0.2.0
func (e ConfigFileLoadError) Error() string
func (ConfigFileLoadError) Unwrap ¶ added in v0.2.0
func (e ConfigFileLoadError) Unwrap() error
type CredCacheError ¶ added in v0.2.0
type CredCacheError struct {
Err error
}
CredCacheError failed to retrieve creds from ssoCredsProvider
func (CredCacheError) Error ¶ added in v0.2.0
func (e CredCacheError) Error() string
func (CredCacheError) Unwrap ¶ added in v0.2.0
func (e CredCacheError) Unwrap() error
type GetCallerIdError ¶ added in v0.2.0
type GetCallerIdError struct {
Err error
}
GetCallerIdError stsClient.GetCallerIdentity failed
func (GetCallerIdError) Error ¶ added in v0.2.0
func (e GetCallerIdError) Error() string
func (GetCallerIdError) Unwrap ¶ added in v0.2.0
func (e GetCallerIdError) Unwrap() error
type IdentityResult ¶ added in v0.1.0
type IdentityResult struct {
Identity *sts.GetCallerIdentityOutput
Error error
}
IdentityResult contains the result of stsClient.GetCallerIdentity. If Identity is nul and error is not nul that can indicate that the credentials might be invalid.
type LoadingConfigFileError ¶ added in v0.2.0
LoadingConfigFileError failed to load the config file
func NewLoadingConfigFileError ¶ added in v0.2.0
func NewLoadingConfigFileError(configFilePath string, err error) LoadingConfigFileError
func (LoadingConfigFileError) Error ¶ added in v0.2.0
func (e LoadingConfigFileError) Error() string
func (LoadingConfigFileError) Unwrap ¶ added in v0.2.0
func (e LoadingConfigFileError) Unwrap() error
type LoginInput ¶ added in v0.0.7
type LoginInput struct {
// ProfileName name of the profile in ~/.aws/config. [profile <ProfileName>]
ProfileName string
// LoginTimeout max time to wait for user to complete the SSO OIDC URL flow. This should be > 60 seconds. Default value is 90 seconds
LoginTimeout time.Duration
// Headed if true a browser will be opened with the URL for the SSO OIDC flow. You will have the [LoginTimeout] to
// complete the flow in the browser.
Headed bool
// ForceLogin if true forces a new SSO OIDC flow even if the cached creds are still valid.
ForceLogin bool
}
type LoginOutput ¶ added in v0.1.0
type LoginOutput struct {
Config *aws.Config
Credentials *aws.Credentials
CredentialsCache *aws.CredentialsCache
IdentityResult *IdentityResult
}
func Login ¶
func Login(ctx context.Context, params *LoginInput) (*LoginOutput, error)
Login runs through the AWS CLI login flow if there isn't a ~/.aws/sso/cache file with valid creds. If ForceLogin is true then the login flow will always be triggered even if the cache is valid
type MissingProfileError ¶ added in v0.2.0
MissingProfileError failed to find the requested profile
func NewMissingProfileError ¶ added in v0.2.0
func NewMissingProfileError(profileName string, configFilePath string, err error) MissingProfileError
func (MissingProfileError) Error ¶ added in v0.2.0
func (e MissingProfileError) Error() string
func (MissingProfileError) Unwrap ¶ added in v0.2.0
func (e MissingProfileError) Unwrap() error
type OsUserError ¶ added in v0.2.0
type OsUserError struct {
Err error
}
OsUserError failed to retrieve user from osUser
func (OsUserError) Error ¶ added in v0.2.0
func (e OsUserError) Error() string
func (OsUserError) Unwrap ¶ added in v0.2.0
func (e OsUserError) Unwrap() error
type ProfileValidationError ¶ added in v0.2.0
type ProfileValidationError struct {
ProfileName string
ConfigFilePath string
FieldName string
CurrentValue string
ExpectedValue string
}
ProfileValidationError error validating the given AWS profile. A required value may be missing.
func NewProfileValidationError ¶ added in v0.2.0
func (ProfileValidationError) Error ¶ added in v0.2.0
func (e ProfileValidationError) Error() string
type SsoOidcClientError ¶ added in v0.2.0
type SsoOidcClientError struct {
Err error
}
SsoOidcClientError Failed to register ssoOidcClient
func (SsoOidcClientError) Error ¶ added in v0.2.0
func (e SsoOidcClientError) Error() string
func (SsoOidcClientError) Unwrap ¶ added in v0.2.0
func (e SsoOidcClientError) Unwrap() error
type SsoOidcTokenCreationError ¶ added in v0.2.0
type SsoOidcTokenCreationError struct {
Err error
}
SsoOidcTokenCreationError failed to retrieve user from osUser
func (SsoOidcTokenCreationError) Error ¶ added in v0.2.0
func (e SsoOidcTokenCreationError) Error() string
func (SsoOidcTokenCreationError) Unwrap ¶ added in v0.2.0
func (e SsoOidcTokenCreationError) Unwrap() error
type StartDeviceAuthorizationError ¶ added in v0.2.0
type StartDeviceAuthorizationError struct {
Err error
}
StartDeviceAuthorizationError Failed to startDeviceAuthorization
func (StartDeviceAuthorizationError) Error ¶ added in v0.2.0
func (e StartDeviceAuthorizationError) Error() string
func (StartDeviceAuthorizationError) Unwrap ¶ added in v0.2.0
func (e StartDeviceAuthorizationError) Unwrap() error