Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Rename AssumeRoleFromCache (it doesn't always use cache)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbvigilante authored and mipearson committed May 6, 2021
1 parent 801ad1e commit 7641d00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cli/assume_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var notARoleErrorMessage = `'%s' is neither an IAM role ARN nor a configured ali
Run 'yak --list-roles' to see which roles and aliases you can use.`

func AssumeRoleFromCache(role string) (*sts.AssumeRoleWithSAMLOutput, error) {
func AssumeRole(role string) (*sts.AssumeRoleWithSAMLOutput, error) {

creds := getAssumedRoleFromCache(role)

Expand All @@ -33,7 +33,7 @@ func AssumeRoleFromCache(role string) (*sts.AssumeRoleWithSAMLOutput, error) {
}

CacheLoginRoles(loginData.Roles)
creds, err = AssumeRole(loginData, role)
creds, err = assumeRoleFromAws(loginData, role)

if err != nil {
return nil, err
Expand Down Expand Up @@ -69,7 +69,7 @@ func ResolveRole(roleName string) (string, error) {
return "", fmt.Errorf(notARoleErrorMessage, roleName)
}

func AssumeRole(login saml.LoginData, desiredRole string) (*sts.AssumeRoleWithSAMLOutput, error) {
func assumeRoleFromAws(login saml.LoginData, desiredRole string) (*sts.AssumeRoleWithSAMLOutput, error) {
role, err := login.GetLoginRole(desiredRole)

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/print_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func printCredentialsCmd(cmd *cobra.Command, args []string) error {
return err
}

creds, err := cli.AssumeRoleFromCache(roleName)
creds, err := cli.AssumeRole(roleName)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func shimCmd(cmd *cobra.Command, args []string) error {

command := args[1:]

creds, err := cli.AssumeRoleFromCache(roleName)
creds, err := cli.AssumeRole(roleName)
if err != nil {
return err
}
Expand Down

0 comments on commit 7641d00

Please sign in to comment.