-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the `kes ls` command that lists keys, policies and identities. ``` Usage: kes ls [-a KEY] [-k] [--json] [-i] [-p] [-s HOST[:PORT]] [PREFIX] Options: -a, --api-key KEY API key to authenticate to the KES server. Defaults to $MINIO_KES_API_KEY. -s, --server HOST[:PORT] Use the server HOST[:PORT] instead of $MINIO_KES_SERVER. --json Print output in JSON format. -i, --identity List identities. -p, --policy List policy names. -k, --insecure Skip server certificate verification. ``` This command replaces `kes key ls`, `kes policy ls` and `kes identity ls` mid-term. Signed-off-by: Andreas Auernhammer <[email protected]>
- Loading branch information
Showing
12 changed files
with
438 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2024 - MinIO, Inc. All rights reserved. | ||
// Use of this source code is governed by the AGPLv3 | ||
// license that can be found in the LICENSE file. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/minio/kes/internal/cli" | ||
flag "github.com/spf13/pflag" | ||
) | ||
|
||
// Use register functions for common flags exposed by | ||
// many commands. Common flags should have common names | ||
// to make command usage consistent. | ||
|
||
// flagsInsecureSkipVerify adds a bool flag '-k, --insecure' | ||
// that sets insecureSkipVerify to true if provided on the | ||
// command line. | ||
func flagsInsecureSkipVerify(f *flag.FlagSet, insecureSkipVerify *bool) { | ||
f.BoolVarP(insecureSkipVerify, "insecure", "k", false, "Skip server certificate verification") | ||
} | ||
|
||
func flagsAPIKey(f *flag.FlagSet, apiKey *string) { | ||
f.StringVarP(apiKey, "api-key", "a", cli.Env(cli.EnvAPIKey), "API key to authenticate to the KES server") | ||
} | ||
|
||
func flagsOutputJSON(f *flag.FlagSet, jsonOutput *bool) { | ||
f.BoolVar(jsonOutput, "json", false, "Print output in JSON format") | ||
} | ||
|
||
func flagsServer(f *flag.FlagSet, host *string) { | ||
f.StringVarP(host, "server", "s", cli.Env(cli.EnvServer), "Use the server HOST[:PORT]") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.