From 1f2f4934a4a4d237fd7e280c3536c4d97842ebc2 Mon Sep 17 00:00:00 2001 From: Matthias Hanel Date: Fri, 29 Jan 2021 15:52:57 -0500 Subject: [PATCH] [chore] change help text and revisit diagrams Signed-off-by: Matthias Hanel --- cmd/describejwt.go | 2 +- cmd/generatediagram.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/describejwt.go b/cmd/describejwt.go index 44bda8d1..73cdb8ff 100644 --- a/cmd/describejwt.go +++ b/cmd/describejwt.go @@ -29,7 +29,7 @@ func createDescribeJwtCmd() *cobra.Command { var params DescribeFile var cmd = &cobra.Command{ Use: "jwt", - Short: "Describe a jwt file", + Short: "Describe a jwt/creds file", Args: MaxArgs(0), Example: fmt.Sprintf(`%s describe -f pathorurl`, GetToolName()), SilenceUsage: true, diff --git a/cmd/generatediagram.go b/cmd/generatediagram.go index b9afdbd1..80bfd714 100644 --- a/cmd/generatediagram.go +++ b/cmd/generatediagram.go @@ -288,7 +288,8 @@ func objectDiagram(users bool, showKeys bool, detail bool) error { bldrPrntf("note right of %s\n%s %s\nend note", ref, cli.WrapString(20, i.Description), link) } } - addValue := func(name string, value interface{}) { + addValue := func(name string, format string, args ...interface{}) { + value := fmt.Sprintf(format, args...) if value != "" || detail { bldrPrntf(`%s = %s`, name, value) } @@ -467,8 +468,9 @@ func objectDiagram(users bool, showKeys bool, detail bool) error { bldrPrntf(`title Object Diagram`) bldrPrntf(`object "%s" as %s << operator >> {`, op.Name, op.Subject) addClaims(op.ClaimsData, op.Tags) - addValue("JWT Version", fmt.Sprintf("%d", op.Version)) + addValue("JWT Version", "%d", op.Version) addValue("account server", op.AccountServerURL) + addValue("Strict signing key usage", "%t", op.StrictSigningKeyUsage) addValidationResults(op) bldrPrntf("}")