vault/command/auth.go

53 lines
1.1 KiB
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
2015-03-04 02:34:32 -05:00
package command
import (
"strings"
2015-03-30 13:55:41 -04:00
"github.com/hashicorp/cli"
2015-03-04 02:34:32 -05:00
)
2017-09-07 21:56:39 -04:00
var _ cli.Command = (*AuthCommand)(nil)
2015-03-04 02:34:32 -05:00
type AuthCommand struct {
2017-09-04 23:59:24 -04:00
*BaseCommand
2015-03-04 02:34:32 -05:00
}
2017-09-04 23:59:24 -04:00
func (c *AuthCommand) Synopsis() string {
2017-09-07 21:56:39 -04:00
return "Interact with auth methods"
2017-09-04 23:59:24 -04:00
}
2015-03-04 02:34:32 -05:00
2017-09-04 23:59:24 -04:00
func (c *AuthCommand) Help() string {
2017-09-07 21:56:39 -04:00
return strings.TrimSpace(`
Usage: vault auth <subcommand> [options] [args]
2015-05-20 22:43:47 -04:00
2017-09-07 21:56:39 -04:00
This command groups subcommands for interacting with Vault's auth methods.
Users can list, enable, disable, and get help for different auth methods.
2017-09-07 21:56:39 -04:00
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.
2015-05-20 22:43:47 -04:00
2017-09-07 21:56:39 -04:00
List all enabled auth methods:
2015-03-30 13:55:41 -04:00
2017-09-07 21:56:39 -04:00
$ vault auth list
2017-09-07 21:56:39 -04:00
Enable a new auth method "userpass";
2017-09-07 21:56:39 -04:00
$ vault auth enable userpass
2017-09-07 21:56:39 -04:00
Get detailed help information about how to authenticate to a particular auth
method:
2015-04-06 12:38:16 -04:00
2017-09-07 21:56:39 -04:00
$ vault auth help github
2017-09-07 21:56:39 -04:00
Please see the individual subcommand help for detailed usage information.
`)
2017-09-04 23:59:24 -04:00
}
func (c *AuthCommand) Run(args []string) int {
2019-02-14 14:54:47 -05:00
return cli.RunResultHelp
}