mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Add token as a subcommand
This commit is contained in:
@@ -8,11 +8,9 @@ import (
|
||||
"github.com/posener/complete"
|
||||
)
|
||||
|
||||
// Ensure we are implementing the right interfaces.
|
||||
var _ cli.Command = (*TokenRevokeCommand)(nil)
|
||||
var _ cli.CommandAutocomplete = (*TokenRevokeCommand)(nil)
|
||||
|
||||
// TokenRevokeCommand is a Command that mounts a new mount.
|
||||
type TokenRevokeCommand struct {
|
||||
*BaseCommand
|
||||
|
||||
@@ -22,12 +20,12 @@ type TokenRevokeCommand struct {
|
||||
}
|
||||
|
||||
func (c *TokenRevokeCommand) Synopsis() string {
|
||||
return "Revokes tokens and their children"
|
||||
return "Revoke a token and its children"
|
||||
}
|
||||
|
||||
func (c *TokenRevokeCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: vault token-revoke [options] [TOKEN | ACCESSOR]
|
||||
Usage: vault token revoke [options] [TOKEN | ACCESSOR]
|
||||
|
||||
Revokes authentication tokens and their children. If a TOKEN is not provided,
|
||||
the locally authenticated token is used. The "-mode" flag can be used to
|
||||
@@ -36,15 +34,15 @@ Usage: vault token-revoke [options] [TOKEN | ACCESSOR]
|
||||
|
||||
Revoke a token and all the token's children:
|
||||
|
||||
$ vault token-revoke 96ddf4bc-d217-f3ba-f9bd-017055595017
|
||||
$ vault token revoke 96ddf4bc-d217-f3ba-f9bd-017055595017
|
||||
|
||||
Revoke a token leaving the token's children:
|
||||
|
||||
$ vault token-revoke -mode=orphan 96ddf4bc-d217-f3ba-f9bd-017055595017
|
||||
$ vault token revoke -mode=orphan 96ddf4bc-d217-f3ba-f9bd-017055595017
|
||||
|
||||
Revoke a token by accessor:
|
||||
|
||||
$ vault token-revoke -accessor 9793c9b3-e04a-46f3-e7b8-748d7da248da
|
||||
$ vault token revoke -accessor 9793c9b3-e04a-46f3-e7b8-748d7da248da
|
||||
|
||||
For a full list of examples, please see the documentation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user