Skip to content

Commit

Permalink
Change cmd name login -> get-cred
Browse files Browse the repository at this point in the history
  • Loading branch information
wadahiro committed Oct 13, 2018
1 parent a9f161f commit 640d8d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Usage:
aws-cli-oidc [command]
Available Commands:
get-cred Get AWS credentials and out to stdout
help Help about any command
login Interactive login
setup Interactive setup of aws-cli-oidc
Flags:
Expand All @@ -59,12 +59,12 @@ Use `aws-cli-oidc setup` command and follow the guide.

### Get AWS temporary credentials

Use `aws-cli-oidc login <your oidc provider name>` command. It opens your browser.
Use `aws-cli-oidc get-cred <your oidc provider name>` command. It opens your browser.
Now you can see the login page which the OIDC provider offers. Then do login.
If successful, AWS temporary credentials will be shown as below.

```
aws-cli-oidc login myop
aws-cli-oidc get-cred myop
Using config file: /home/wadahiro/.aws-cli-oidc/config.yaml
Login successful!
Selected role: arn:aws:iam::123456789012:role/developer
Expand Down
2 changes: 1 addition & 1 deletion cmd/aws_saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func loginToStsUsingRole(role *saml2aws.AWSRole, samlResponse string) (*AWSCrede
DurationSeconds: aws.Int64(int64(900)),
}

Traceln("Requesting AWS credentials using SAML assertion")
Writeln("Requesting AWS credentials using SAML assertion")

resp, err := svc.AssumeRoleWithSAML(params)
if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions cmd/login.go → cmd/get_cred.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
"golang.org/x/net/context"
)

var loginCmd = &cobra.Command{
Use: "login <OIDC provider name>",
Short: "Interactive login",
Long: `Interactive login to AWS using the OIDC provider.`,
Run: login,
var getCredCmd = &cobra.Command{
Use: "get-cred <OIDC provider name>",
Short: "Get AWS credentials and out to stdout",
Long: `Get AWS credentials and out to stdout through your OIDC provider authentication.`,
Run: getCred,
}

type TokenResponse struct {
Expand All @@ -43,7 +43,7 @@ type AWSCredentials struct {
}

func init() {
rootCmd.AddCommand(loginCmd)
rootCmd.AddCommand(getCredCmd)
}

type LoginParams struct {
Expand All @@ -60,7 +60,7 @@ type param struct {
mask bool
}

func login(cmd *cobra.Command, args []string) {
func getCred(cmd *cobra.Command, args []string) {
if len(args) < 1 {
Writeln("The OIDC provider name is required")
Exit(nil)
Expand Down

0 comments on commit 640d8d2

Please sign in to comment.