-
|
I have been looking at the implementation for "encodeUser" [1] and wondered why the function that creates a signed User JWT needs the KeyPair of the User, i.e. including the Seed, but not just the Public Key. From my understanding of the NATS security and JWT model, this does not align with the intended trust boundaries. The User's Seed never should leave the client [2], but in this implementation the Account Manager (who is the one signing the User's JWT) would require the Seed. [1] https://github.com/nats-io/jwt.js/blob/main/src/jwt.ts#L123-L146 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
@aricart |
Beta Was this translation helpful? Give feedback.
(Perhaps what you are confused about is that the argument is a
Key) - A Key can be private/public etc. It just simplifies the interaction with the API - also private and public keys are nkeys.KeyPair - the difference is that it public won't be able to sign only verify. See https://github.com/nats-io/jwt.js/blob/main/src/keys.ts