Documentation ¶
Index ¶
- Variables
- func ClearSSOToken(profileKey string)
- func PollToken(ctx context.Context, c *ssooidc.Client, clientSecret string, clientID string, ...) (*ssooidc.CreateTokenOutput, error)
- func StoreSSOToken(profileKey string, ssoTokenValue SSOToken)
- func TypeCredsToAwsCreds(c types.Credentials) aws.Credentials
- func TypeRoleCredsToAwsCreds(c ssotypes.RoleCredentials) aws.Credentials
- func UpdateFrecencyCache(selectedProfile string)
- type CFSharedConfig
- func (c *CFSharedConfig) Assume(ctx context.Context) (aws.Credentials, error)
- func (c *CFSharedConfig) AwsConfig(ctx context.Context, useSSORegion bool) (aws.Config, error)
- func (c *CFSharedConfig) CallerIdentity(ctx context.Context) (*sts.GetCallerIdentityOutput, error)
- func (c CFSharedConfig) Region(ctx context.Context) (string, bool, error)
- func (c *CFSharedConfig) SSOLogin(ctx context.Context) (aws.Credentials, error)
- type CFSharedConfigs
- type CredProv
- type FrecentProfiles
- type PollingConfig
- type ProfileType
- type SSOToken
Constants ¶
This section is empty.
Variables ¶
var ErrTimeout error = errors.New("polling for device authorization token timed out")
Functions ¶
func ClearSSOToken ¶
func ClearSSOToken(profileKey string)
Attempts to clear the token, any errors will be logged to debug logging
func PollToken ¶
func PollToken(ctx context.Context, c *ssooidc.Client, clientSecret string, clientID string, deviceCode string, cfg PollingConfig) (*ssooidc.CreateTokenOutput, error)
PollToken will poll for a token and return it once the authentication/authorization flow has been completed in the browser
func StoreSSOToken ¶
Attempts to store the token, any errors will be logged to debug logging
func TypeCredsToAwsCreds ¶
func TypeCredsToAwsCreds(c types.Credentials) aws.Credentials
func TypeRoleCredsToAwsCreds ¶
func TypeRoleCredsToAwsCreds(c ssotypes.RoleCredentials) aws.Credentials
func UpdateFrecencyCache ¶
func UpdateFrecencyCache(selectedProfile string)
use this to update frecency cache when the profile is supplied by the commandline
Types ¶
type CFSharedConfig ¶
type CFSharedConfig struct { // the original config, some values may be empty strings depending on the type or profile Parents []*CFSharedConfig }
func (*CFSharedConfig) Assume ¶
func (c *CFSharedConfig) Assume(ctx context.Context) (aws.Credentials, error)
func (*CFSharedConfig) CallerIdentity ¶
func (c *CFSharedConfig) CallerIdentity(ctx context.Context) (*sts.GetCallerIdentityOutput, error)
func (CFSharedConfig) Region ¶
Region will attempt to load the reason on this profile, if it is not set, attempts to load the default config returns a region, and bool = true if the default region was used
func (*CFSharedConfig) SSOLogin ¶
func (c *CFSharedConfig) SSOLogin(ctx context.Context) (aws.Credentials, error)
type CFSharedConfigs ¶
type CFSharedConfigs map[string]*CFSharedConfig
func GetProfilesFromDefaultSharedConfig ¶
func GetProfilesFromDefaultSharedConfig(ctx context.Context) (CFSharedConfigs, error)
GetProfilesFromDefaultSharedConfig returns initialised profiles these profiles state their type and parents
func (CFSharedConfigs) GetFrecentProfiles ¶
func (c CFSharedConfigs) GetFrecentProfiles() (*FrecentProfiles, []string)
loads the frecency cache and generates a list of profiles with frecently used profiles first, followed by alphabetically sorted profiles that have not been used with assume this method returns a FrecentProfiles pointer which should be used after selecting a profile to update the cache, it will also remove any entries which no longer exist in the aws config
func (CFSharedConfigs) IAMProfileNames ¶
func (c CFSharedConfigs) IAMProfileNames() []string
func (CFSharedConfigs) ProfileNames ¶
func (c CFSharedConfigs) ProfileNames() []string
func (CFSharedConfigs) SSOProfileNames ¶
func (c CFSharedConfigs) SSOProfileNames() []string
type CredProv ¶
type CredProv struct{ aws.Credentials }
CredProv implements the aws.CredentialProvider interface
type FrecentProfiles ¶
type FrecentProfiles struct {
// contains filtered or unexported fields
}
func (*FrecentProfiles) Update ¶
func (f *FrecentProfiles) Update(selectedProfile string)
should be called after selecting a profile to update frecency cache wrap this method in a go routine to avoid blocking the user
type PollingConfig ¶
type SSOToken ¶
func GetValidCachedToken ¶
GetValidCachedToken returns nil if no token was found, or if it is expired
func SSODeviceCodeFlow ¶
func SSODeviceCodeFlow(ctx context.Context, cfg aws.Config, rootProfile *CFSharedConfig) (*SSOToken, error)
SSODeviceCodeFlow contains all the steps to complete a device code flow to retrieve an sso token