@btravstack/testing / jwt
jwt
Type Aliases
LocalIssuer
ts
type LocalIssuer = object;Defined in: testing/src/jwt.ts:23
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
audience | readonly | string | - | testing/src/jwt.ts:29 |
close | readonly | () => AsyncResult<void, never> | - | testing/src/jwt.ts:31 |
issuer | readonly | string | - | testing/src/jwt.ts:28 |
jwk | readonly | JWK | The public key as served, with kid/alg/use already set. | testing/src/jwt.ts:27 |
jwks | readonly | string | http://127.0.0.1:<port>/jwks.json — served on ANY path, so a caller need not match it exactly. | testing/src/jwt.ts:25 |
sign | readonly | (claims?, options?) => AsyncResult<string, never> | - | testing/src/jwt.ts:30 |
LocalIssuerOptions
ts
type LocalIssuerOptions = object;Defined in: testing/src/jwt.ts:9
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
algorithm? | readonly | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | Asymmetric only, the same list jwtAuthenticator accepts; default "RS256". | testing/src/jwt.ts:13 |
audience | readonly | string | - | testing/src/jwt.ts:11 |
issuer | readonly | string | - | testing/src/jwt.ts:10 |
SignOptions
ts
type SignOptions = object;Defined in: testing/src/jwt.ts:16
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
audience? | readonly | string | - | testing/src/jwt.ts:18 |
expiresIn? | readonly | string | false | "5m" by default; false mints a token with no exp at all. | testing/src/jwt.ts:20 |
issuer? | readonly | string | - | testing/src/jwt.ts:17 |
Functions
localIssuer()
ts
function localIssuer(options): AsyncResult<LocalIssuer, never>;Defined in: testing/src/jwt.ts:42
A real JWKS endpoint and a matching signer, for a test that wants a genuine fetch and a genuine verify rather than a double for either.
The whole LocalIssuer is minted from one call: a key pair, a node:http listener answering the JWKS on any path, and sign closing over the private key. close() stops the listener; nothing else needs tearing down.
Parameters
| Parameter | Type |
|---|---|
options | LocalIssuerOptions |
Returns
AsyncResult<LocalIssuer, never>