MCPcopy
hub / github.com/smallstep/cli / WithClaim

Function WithClaim

token/options.go:31–39  ·  view source on GitHub ↗

WithClaim is an Options function that adds a custom claim to the JWT.

(name string, value interface{})

Source from the content-addressed store, hash-verified

29
30// WithClaim is an Options function that adds a custom claim to the JWT.
31func WithClaim(name string, value interface{}) Options {
32 return func(c *Claims) error {
33 if name == "" {
34 return errors.New("name cannot be empty")
35 }
36 c.Set(name, value)
37 return nil
38 }
39}
40
41// WithRootCA returns an Options function that calculates the SHA256 of the
42// given root certificate to be used in the token claims. If this method it's

Callers 2

TestNewFunction · 0.92
TestOptionsFunction · 0.85

Calls 1

SetMethod · 0.80

Tested by 2

TestNewFunction · 0.74
TestOptionsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…