Documentation
¶
Index ¶
- func New(ui cli.Ui) *cmd
- func NewWithDependencies(ui cli.Ui, ssoClientFactory func(aws.Config) SSOClient, ...) *cmd
- type ConfigGenerator
- func (g *ConfigGenerator) GetAccountRolesWithClient(ssoClient SSOClient, token *string, accountID string) ([]types.RoleInfo, error)
- func (g *ConfigGenerator) ListAccountsWithClient(ssoClient SSOClient, token *string) ([]types.AccountInfo, error)
- func (g *ConfigGenerator) WriteSectionToConfig(configParser *configparser.ConfigParser, sectionName string, ...) error
- type ConfigGeneratorIface
- type DefaultTokenGenerator
- type SSOClient
- type TokenGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWithDependencies ¶
func NewWithDependencies(ui cli.Ui, ssoClientFactory func(aws.Config) SSOClient, tokenGenerator TokenGenerator, configLoader func() aws.Config) *cmd
NewWithDependencies creates a new command with injected dependencies for testing
Types ¶
type ConfigGenerator ¶
ConfigGenerator holds the config generator implementation
func NewConfigGenerator ¶
func NewConfigGenerator(ssoStartURL, ssoRegion, defaultRegion string) *ConfigGenerator
Returns a new config generator with the given parameters
func (*ConfigGenerator) GetAccountRolesWithClient ¶
func (g *ConfigGenerator) GetAccountRolesWithClient(ssoClient SSOClient, token *string, accountID string) ([]types.RoleInfo, error)
GetAccountRolesWithClient gets AWS account roles using the provided SSO client
func (*ConfigGenerator) ListAccountsWithClient ¶
func (g *ConfigGenerator) ListAccountsWithClient(ssoClient SSOClient, token *string) ([]types.AccountInfo, error)
ListAccountsWithClient lists AWS accounts with the provided SSO client
func (*ConfigGenerator) WriteSectionToConfig ¶
func (g *ConfigGenerator) WriteSectionToConfig(configParser *configparser.ConfigParser, sectionName string, values map[string]string) error
WriteSectionToConfig writes a section to the config parser
type ConfigGeneratorIface ¶
type ConfigGeneratorIface interface {
GenerateConfigFile(ssoClient SSOClient, token *string, configFile string, showDiff bool, appCfg *appconfig.Config) error
ListAccountsWithClient(ssoClient SSOClient, token *string) ([]types.AccountInfo, error)
GetAccountRolesWithClient(ssoClient SSOClient, token *string, accountID string) ([]types.RoleInfo, error)
WriteSectionToConfig(configParser *configparser.ConfigParser, sectionName string, values map[string]string) error
}
ConfigGeneratorIface defines the interface for config generator operations
type DefaultTokenGenerator ¶
type DefaultTokenGenerator struct{}
DefaultTokenGenerator implements TokenGenerator using the real AWS functions
func (*DefaultTokenGenerator) GenerateTokenWithConfig ¶
type SSOClient ¶
type SSOClient interface {
GetRoleCredentials(ctx context.Context, params *sso.GetRoleCredentialsInput, optFns ...func(*sso.Options)) (*sso.GetRoleCredentialsOutput, error)
ListAccounts(ctx context.Context, params *sso.ListAccountsInput, optFns ...func(*sso.Options)) (*sso.ListAccountsOutput, error)
ListAccountRoles(ctx context.Context, params *sso.ListAccountRolesInput, optFns ...func(*sso.Options)) (*sso.ListAccountRolesOutput, error)
}
Interface for AWS SSO operations to allow mocking in tests
Click to show internal directories.
Click to hide internal directories.