-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathauth.go
52 lines (35 loc) · 1.15 KB
/
auth.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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package command
import (
"strings"
"github.com/mitchellh/cli"
)
var _ cli.Command = (*AuthCommand)(nil)
type AuthCommand struct {
*BaseCommand
}
func (c *AuthCommand) Synopsis() string {
return "Interact with auth methods"
}
func (c *AuthCommand) Help() string {
return strings.TrimSpace(`
Usage: vault auth <subcommand> [options] [args]
This command groups subcommands for interacting with Vault's auth methods.
Users can list, enable, disable, and get help for different auth methods.
To authenticate to Vault as a user or machine, use the "vault login" command
instead. This command is for interacting with the auth methods themselves, not
authenticating to Vault.
List all enabled auth methods:
$ vault auth list
Enable a new auth method "userpass";
$ vault auth enable userpass
Get detailed help information about how to authenticate to a particular auth
method:
$ vault auth help github
Please see the individual subcommand help for detailed usage information.
`)
}
func (c *AuthCommand) Run(args []string) int {
return cli.RunResultHelp
}