Documentation
¶
Index ¶
- Variables
- func Credentials(username, password string) (string, string, error)
- func Execute()
- func SetFatalExitWriter(w io.Writer)
- func SetJournalWriter(w io.Writer)
- func UpdateAwsConfigFile(profileName, id, secret, session string) error
- type AccountAliasCache
- type Arn
- type AttributeValue
- type RoleAlias
- type SSO
- type Saml
- type SamlDocument
Constants ¶
This section is empty.
Variables ¶
var RootCmd = &cobra.Command{
Use: "awsSts2",
Short: "Small AWS toolkit",
Long: `Prime useage is to allow single sign on session for CLI`,
}
RootCmd represents the base command when called without any subcommands
Functions ¶
func Credentials ¶
Credentials extract the usrename and password from config or interactivly
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func UpdateAwsConfigFile ¶
UpdateAwsConfigFile in .aws home folder
Types ¶
type AccountAliasCache ¶
type AccountAliasCache struct {
//Aliases list
Roles []*RoleAlias `json:"roles"`
}
AccountAliasCache stores previously looked up aliases
type Arn ¶
type Arn struct {
// contains filtered or unexported fields
}
Arn principal and role
func ExtractRoles ¶
func ExtractRoles(saml *Saml, cache *AccountAliasCache) (arns []Arn, err error)
ExtractRoles from the saml single sign on response
func SelectRole ¶
SelectRole to create tokens for
type AttributeValue ¶
AttributeValue contains the core information for role based assertion
type RoleAlias ¶
type RoleAlias struct {
//Account number
Role string `json:"role"`
//Aliases list, typicaly a single entry
Names []string `json:"names"`
}
RoleAlias single account
type Saml ¶
type Saml string
Saml response body
func (Saml) AsAssertion ¶
AsAssertion returns the assertion blob to send to AWS AssumeRole
type SamlDocument ¶
type SamlDocument struct {
XMLName xml.Name `xml:"Response"`
Assertion []AttributeValue `xml:"Assertion>AttributeStatement>Attribute"`
}
SamlDocument contains the payload of the STS authentication