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

Function New

token/provision/provision.go:23–30  ·  view source on GitHub ↗

New returns a new unsigned One-Time-Token for authorizing a single request from a newly provisioned end-entity. The current implementation uses jwt.Token and is generated using sane defaults for the claims. See token/options.go for default claim definitions.

(subject string, opts ...token.Options)

Source from the content-addressed store, hash-verified

21// for the claims.
22// See token/options.go for default claim definitions.
23func New(subject string, opts ...token.Options) (*Token, error) {
24 o := append([]token.Options{token.WithSubject(subject)}, opts...)
25 c, err := token.NewClaims(o...)
26 if err != nil {
27 return nil, err
28 }
29 return &Token{claims: c}, nil
30}
31
32// SignedString implementation of the Token interface. It returns a JWT using
33// the compact serialization.

Callers 2

TokenMethod · 0.92
TestNewFunction · 0.85

Calls 2

WithSubjectFunction · 0.92
NewClaimsFunction · 0.92

Tested by 1

TestNewFunction · 0.68