From 23ab36d37643dfa87f2c73b48edef14d9a1930b1 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Thu, 16 Feb 2023 13:00:33 -0500 Subject: [PATCH 1/2] zrok status --secrets (#243) --- cmd/zrok/status.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cmd/zrok/status.go b/cmd/zrok/status.go index 76f43fb6..3cdccb8b 100644 --- a/cmd/zrok/status.go +++ b/cmd/zrok/status.go @@ -14,7 +14,8 @@ func init() { } type statusCommand struct { - cmd *cobra.Command + secrets bool + cmd *cobra.Command } func newStatusCommand() *statusCommand { @@ -25,6 +26,7 @@ func newStatusCommand() *statusCommand { Args: cobra.ExactArgs(0), } command := &statusCommand{cmd: cmd} + cmd.Flags().BoolVar(&command.secrets, "secrets", false, "Show secrets in status output") cmd.Run = command.run return command } @@ -57,8 +59,22 @@ func (cmd *statusCommand) run(_ *cobra.Command, _ []string) { t.SetOutputMirror(os.Stdout) t.SetStyle(table.StyleColoredDark) t.AppendHeader(table.Row{"Property", "Value"}) - t.AppendRow(table.Row{"Secret Token", zrd.Env.Token}) - t.AppendRow(table.Row{"Ziti Identity", zrd.Env.ZId}) + if cmd.secrets { + t.AppendRow(table.Row{"Secret Token", zrd.Env.Token}) + t.AppendRow(table.Row{"Ziti Identity", zrd.Env.ZId}) + } else { + secretToken := "<>" + if zrd.Env.Token == "" { + secretToken = "<>" + } + t.AppendRow(table.Row{"Secret Token", secretToken}) + + zId := "<>" + if zrd.Env.ZId == "" { + zId = "<>" + } + t.AppendRow(table.Row{"Ziti Identity", zId}) + } t.Render() } _, _ = fmt.Fprintf(os.Stdout, "\n") From a8052ed4182cf9cd08ee3e17ead08d6805b0f094 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Thu, 16 Feb 2023 13:02:25 -0500 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed404a70..3ff2ceab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.3.2 + +CHANGE: `zrok status` no longer shows secrets (secret token, ziti identity) unless the `--secrets` flag is passed (https://github.com/openziti/zrok/issues/243) + # v0.3.1 CHANGE: Incorporate initial docker image build (https://github.com/openziti/zrok/issues/217)