Documentation
¶
Overview ¶
Package natsjwt mints the NATS user JWTs of osapi in operator mode: the bootstrap user of a join token, and the user of an agent that joined. It signs them with an account signing key that the NATS administrator gives the controller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSigningKey = errors.New("the signing key file holds no account seed (SA...)")
ErrSigningKey is a signing key file that holds no account seed.
Functions ¶
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer mints user JWTs for one account with one of its signing keys.
func Load ¶
Load is the signer of the account signing key seed in file, for the account with public key account. The key can be the account's own key or one of its signing keys.
func NewSigner ¶
NewSigner is the signer of key, a signing key of the account with public key account.
func (*Signer) Mint ¶
func (s *Signer) Mint( userKey string, name string, p bus.Permissions, expires time.Time, ) (string, error)
Mint is a user JWT for the user nkey userKey, named name, with the permissions p, that expires at expires, or never when it is zero.