-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
52 lines (48 loc) · 1.08 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"gopkg.in/urfave/cli.v1"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "stork"
app.Usage = "retrieve tokens from a Vault server via EC2 metadata"
app.Version = "1.0.0"
app.Commands = []cli.Command{
{
Name: "login",
Aliases: []string{"l"},
Usage: "login to vault via EC2 authentication",
Action: func(c *cli.Context) error {
return login_to_vault(c)
},
Flags: []cli.Flag{
cli.BoolFlag{
Name: "verbose",
Usage: "Verbose mode",
},
cli.StringFlag{
Name: "nonce",
Usage: "A file for storing the Vault nonce",
},
cli.StringFlag{
Name: "token",
Usage: "A file for storing the Vault token",
},
cli.StringFlag{
Name: "role",
Usage: "Role to authenticate to Vault as. If unset, we will try to guess from IAM data.",
},
cli.StringFlag{
Name: "pkcs7",
Usage: "You probably don't need to set this, we will get it from IAM data.",
},
cli.StringFlag{
Name: "server",
Usage: "URL to Vault server",
},
},
},
}
app.Run(os.Args)
}