Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

Commit

Permalink
added mfa support
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanfoo committed Jul 1, 2016
1 parent 54e2a7c commit b2498bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commands/assume.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *CmdAssume) getArnFromAliasFile(aliasFile string) string {
return arn.String()
}

func (c *CmdAssume) getMfaSerialNumber(arn string) (string, error) {
func (c *CmdAssume) getMfaSerialNumber(arn string) string {
svc := iam.New(session.New())
re := regexp.MustCompile(`iam\:\:\d+\:\w+\/([\w=\-\,\.\=\@]+)`)
userName := re.FindStringSubmatch(arn)[1]
Expand All @@ -150,7 +150,7 @@ func (c *CmdAssume) getMfaSerialNumber(arn string) (string, error) {
fmt.Errorf("Error getting mfa serial number")
}

return *mfaDevice.MFADevices[0].SerialNumber, nil
return *mfaDevice.MFADevices[0].SerialNumber
}

func (c *CmdAssume) saveAWSCredentials(credentialsFile string) error {
Expand Down

0 comments on commit b2498bd

Please sign in to comment.