Documentation
¶
Overview ¶
Package mint makes the NATS user JWT and creds of one endpoint: signed by the account signing key and carrying the endpoint's own permission set (admin.Permissions). There is no per-zone scoped signing key and no tag (ADR 0091): the address is the fence, and the key that signs a user is the account's own. It does no network I/O; the key comes through the Keys seam (ADR 0052).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignUser ¶ added in v0.5.5
SignUser signs the user JWT of the endpoint at addr for userPub, a user public key the endpoint made: no seed is involved. The claims are Mint's: the dotted address as name, admin.Permissions(addr), no tag, signed by the account signing key. It returns the JWT and the account public key.
Types ¶
type Keys ¶
type Keys interface {
Account() (nkeys.KeyPair, string, error)
Signing() (nkeys.KeyPair, string, error)
}
Keys is the key store Mint signs with; *ctlkeys.Authority satisfies it.
Account is the account IDENTITY key. Signing is the account SIGNING key an operator with strict_signing_key_usage requires; it returns ctlkeys.ErrNoSigningKey (tested with errors.Is) when none is configured, and then the identity key signs, as before.
type Minted ¶
type Minted struct {
Name string
UserPub string
AccountPub string
JWT string
Creds []byte // the creds file contents (JWT and seed): a secret
}
Minted is one issued user. Creds holds the user seed: never log or print it.