MCPcopy Create free account
hub / github.com/auth0/auth0-cli / TestToken

Method TestToken

internal/display/test.go:34–64  ·  view source on GitHub ↗
(client *management.Client, t *authutil.TokenResponse)

Source from the content-addressed store, hash-verified

32}
33
34func (r *Renderer) TestToken(client *management.Client, t *authutil.TokenResponse) {
35 r.Heading(fmt.Sprintf("token for %s", ansi.Bold(client.GetName())))
36
37 switch r.Format {
38 case OutputFormatJSON:
39 r.JSONResult(t)
40 case OutputFormatJSONCompact:
41 r.JSONCompactResult(t)
42 default:
43 if t.TokenType != "" {
44 r.Output(" TOKEN TYPE " + t.TokenType)
45 r.Newline()
46 }
47 if t.ExpiresIn != 0 {
48 r.Output(" EXPIRES IN " + strconv.FormatInt(t.ExpiresIn/60, 10) + " minute(s)")
49 r.Newline()
50 }
51 if t.RefreshToken != "" {
52 r.Output(" REFRESH TOKEN " + t.RefreshToken)
53 r.Newline()
54 }
55 if t.IDToken != "" {
56 r.Output(" ID TOKEN " + t.IDToken)
57 r.Newline()
58 }
59 if t.AccessToken != "" {
60 r.Output(" ACCESS TOKEN " + t.AccessToken)
61 r.Newline()
62 }
63 }
64}

Callers 1

testTokenCmdFunction · 0.80

Calls 7

HeadingMethod · 0.95
JSONResultMethod · 0.95
JSONCompactResultMethod · 0.95
OutputMethod · 0.95
NewlineMethod · 0.95
BoldFunction · 0.92
GetNameMethod · 0.65

Tested by

no test coverage detected