-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd: support private keys in
kes identity
(#461)
* cmd: support private keys in `kes identity` This commit is part of the CLI refactoring https://github.com/minio/kes/milestone/6 This commit adds support for parsing PEM private key files and printing their private key as API key. Now, the `kes identity` command is now able to generate API keys, print identities of API keys or certificates and convert private key files to API keys. The existing sub-commands `new`, `of`, `info` `ls` are still supported. As of now, only private keys of type Ed25519 are supported. Signed-off-by: Andreas Auernhammer <[email protected]> * Update cmd/kes/identity.go Co-authored-by: Shubhendu <[email protected]> Signed-off-by: Andreas Auernhammer <[email protected]> * Update internal/cli/term.go Co-authored-by: Harshavardhana <[email protected]> Signed-off-by: Andreas Auernhammer <[email protected]> --------- Signed-off-by: Andreas Auernhammer <[email protected]> Co-authored-by: Shubhendu <[email protected]> Co-authored-by: Harshavardhana <[email protected]>
- Loading branch information
1 parent
e06e710
commit 802ce81
Showing
8 changed files
with
198 additions
and
181 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,15 @@ | ||
// 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 cli | ||
|
||
// Environment variable used by the KES CLI. | ||
const ( | ||
// EnvServer is the server endpoint the client uses. If not set, | ||
// clients will use '127.0.0.1:7373'. | ||
EnvServer = "MINIO_KES_SERVER" | ||
|
||
// EnvAPIKey is used by the client to authenticate to the server. | ||
EnvAPIKey = "MINIO_KES_API_KEY" | ||
) |
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,30 @@ | ||
// 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 cli | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
tui "github.com/charmbracelet/lipgloss" | ||
) | ||
|
||
// Exit prints args as error message and aborts with exit code 1. | ||
func Exit(args ...any) { | ||
const FG tui.Color = "#ac0000" | ||
s := tui.NewStyle().Foreground(FG).Render("Error: ") | ||
|
||
fmt.Fprintln(os.Stderr, s+fmt.Sprint(args...)) | ||
os.Exit(1) | ||
} | ||
|
||
// Exitf formats args as error message and aborts with exit code 1. | ||
func Exitf(format string, args ...any) { | ||
const FG tui.Color = "#ac0000" | ||
s := tui.NewStyle().Foreground(FG).Render("Error: ") | ||
|
||
fmt.Fprintln(os.Stderr, s+fmt.Sprintf(format, args...)) | ||
os.Exit(1) | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.