sso

package
v0.11.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureProfiles

func ConfigureProfiles(ctx context.Context) error

func CopyFile

func CopyFile(src, dst string) error

func GetCredentials

func GetCredentials(ctx context.Context, profile string, ask bool) (*aws.Credentials, error)

func Init

func Init(parser *flags.Parser)

func LoadSsoProfiles

func LoadSsoProfiles() (map[string]AwsProfile, error)

func NewAwsConfig

func NewAwsConfig(ctx context.Context, creds *aws.Credentials, opts ...func(*config.LoadOptions) error) (aws.Config, error)

func NewSsoProfiles

func NewSsoProfiles() map[string]AwsProfile

func PrintCredentials

func PrintCredentials(creds *aws.Credentials)

func WriteSsoProfiles

func WriteSsoProfiles(profiles map[string]AwsProfile) error

Types

type AwsProfile

type AwsProfile struct {
	StartUrl  string `ini:"sso_start_url"`
	Region    string `ini:"sso_region"`
	AccountId string `ini:"sso_account_id"`
	Role      string `ini:"sso_role_name"`
}

func GetAccount

func GetAccount(account string) (*string, *AwsProfile, error)

type ConfigureCommand

type ConfigureCommand struct{}

func (*ConfigureCommand) Execute

func (p *ConfigureCommand) Execute(args []string) error

type LoginCommand

type LoginCommand struct {
	Profile string `short:"p" long:"profile" env:"AWS_PROFILE" default:"default" description:"What profile to use"`
	Ask     bool   `long:"ask" env:"AWSFUZZY_ASK" description:"Ask before continuing"`
}

func (*LoginCommand) Execute

func (p *LoginCommand) Execute(args []string) error

type RoleCredentials

type RoleCredentials struct {
	AccessKey    *string
	SecretKey    *string
	SessionToken *string
	Expires      rfc3339
}

type SsoDeviceCredentials

type SsoDeviceCredentials struct {
	ClientId     *string `json:"clientId"`
	ClientSecret *string `json:"clientSecret"`
	ExpiresAt    rfc3339 `json:"expiresAt"`
}

type SsoSessionCredentials

type SsoSessionCredentials struct {
	StartUrl    *string `json:"startUrl"`
	Region      string  `json:"region"`
	AccessToken *string `json:"accessToken"`
	ExpiresAt   rfc3339 `json:"expiresAt"`
}

func NewSsoCredentials

func NewSsoCredentials(ctx context.Context, cfg aws.Config, oidc *ssooidc.Client, startUrl *string) (*SsoSessionCredentials, error)

func SsoLogin

func SsoLogin(ctx context.Context) (*SsoSessionCredentials, error)

Jump to

Keyboard shortcuts

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