Skip to content

Commit

Permalink
[chore] change help text and revisit diagrams
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Hanel <mh@synadia.com>
  • Loading branch information
matthiashanel committed Jan 29, 2021
1 parent f4662e9 commit 1f2f493
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/describejwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions cmd/generatediagram.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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("}")

Expand Down

0 comments on commit 1f2f493

Please sign in to comment.