This repository has been archived by the owner on Aug 29, 2022. It is now read-only.
forked from apprenda-kismatic/kubernetes-ldap
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/golang/glog" | ||
"github.com/proofpoint/kubernetes-ldap/token" | ||
"github.com/spf13/cobra" | ||
"os" | ||
) | ||
|
||
// genKeypairCmd represents the genKeypair command | ||
var genKeypairCmd = &cobra.Command{ | ||
Use: "gen-keypair", | ||
Short: "generate a new keypair for signing/verifying the token", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
os.MkdirAll(keypairDir, 0700) | ||
|
||
if err := token.GenerateKeypair(keypairDir); err != nil { | ||
glog.Fatalf("Error generating key pair: %v", err) | ||
} | ||
fmt.Printf("Generated keypair in %s\n", keypairDir) | ||
}, | ||
} | ||
|
||
func init() { | ||
RootCmd.AddCommand(genKeypairCmd) | ||
} |
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