@vurb/jwt 3.6.6 → 3.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +79 -79
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,79 +1,79 @@
1
- <p align="center">
2
- <h1 align="center">@vurb/jwt</h1>
3
- <p align="center">
4
- <strong>JWT Verification Middleware</strong> — Standards-compliant token validation for Vurb.ts servers
5
- </p>
6
- </p>
7
-
8
- <p align="center">
9
- <a href="https://www.npmjs.com/package/@vurb/jwt"><img src="https://img.shields.io/npm/v/@vurb/jwt?color=blue" alt="npm" /></a>
10
- <a href="https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License" /></a>
11
- <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node" />
12
- </p>
13
-
14
- ---
15
-
16
- > JWT verification middleware for MCP servers built with Vurb.ts. Timing-safe validation with `jose`, JWKS auto-discovery, and self-healing error responses.
17
-
18
- ## Quick Start
19
-
20
- ```typescript
21
- import { initVurb } from '@vurb/core';
22
- import { jwtGuard } from '@vurb/jwt';
23
-
24
- const f = initVurb<AppContext>();
25
-
26
- const withJwt = jwtGuard({
27
- secret: process.env.JWT_SECRET!,
28
- algorithms: ['HS256'],
29
- });
30
-
31
- export default f.query('billing.invoices')
32
- .use(withJwt)
33
- .handle(async (input, ctx) => {
34
- // ctx.jwt contains the decoded payload
35
- return db.invoices.findMany({ where: { tenantId: ctx.jwt.sub } });
36
- });
37
- ```
38
-
39
- ## Features
40
-
41
- | Feature | Description |
42
- |---------|-------------|
43
- | **Algorithms** | HS256, RS256, ES256 — all standard algorithms via `jose` |
44
- | **JWKS** | Auto-discovery from `/.well-known/jwks.json` with key rotation |
45
- | **Self-Healing** | Expired/invalid tokens return actionable hints to the LLM agent |
46
- | **Timing-Safe** | Constant-time signature verification |
47
- | **Zero Config** | Works with Auth0, Clerk, Supabase, Firebase, any OIDC provider |
48
-
49
- ## JWKS Auto-Discovery
50
-
51
- ```typescript
52
- const withJwt = jwtGuard({
53
- jwksUri: 'https://auth.example.com/.well-known/jwks.json',
54
- issuer: 'https://auth.example.com/',
55
- audience: 'my-mcp-server',
56
- });
57
- ```
58
-
59
- ## Installation
60
-
61
- ```bash
62
- npm install @vurb/jwt jose
63
- ```
64
-
65
- ### Peer Dependencies
66
-
67
- | Package | Version |
68
- |---------|---------|
69
- | `vurb` | `^2.0.0` |
70
- | `jose` | `^5.0.0` (optional) |
71
-
72
- ## Requirements
73
-
74
- - **Node.js** ≥ 18.0.0
75
- - **Vurb.ts** ≥ 2.0.0 (peer dependency)
76
-
77
- ## License
78
-
79
- [Apache-2.0](https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE)
1
+ <p align="center">
2
+ <h1 align="center">@vurb/jwt</h1>
3
+ <p align="center">
4
+ <strong>JWT Verification Middleware</strong> — Standards-compliant token validation for Vurb.ts servers
5
+ </p>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/@vurb/jwt"><img src="https://img.shields.io/npm/v/@vurb/jwt?color=blue" alt="npm" /></a>
10
+ <a href="https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License" /></a>
11
+ <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="Node" />
12
+ </p>
13
+
14
+ ---
15
+
16
+ > JWT verification middleware for MCP servers built with Vurb.ts. Timing-safe validation with `jose`, JWKS auto-discovery, and self-healing error responses.
17
+
18
+ ## Quick Start
19
+
20
+ ```typescript
21
+ import { initVurb } from '@vurb/core';
22
+ import { jwtGuard } from '@vurb/jwt';
23
+
24
+ const f = initVurb<AppContext>();
25
+
26
+ const withJwt = jwtGuard({
27
+ secret: process.env.JWT_SECRET!,
28
+ algorithms: ['HS256'],
29
+ });
30
+
31
+ export default f.query('billing.invoices')
32
+ .use(withJwt)
33
+ .handle(async (input, ctx) => {
34
+ // ctx.jwt contains the decoded payload
35
+ return db.invoices.findMany({ where: { tenantId: ctx.jwt.sub } });
36
+ });
37
+ ```
38
+
39
+ ## Features
40
+
41
+ | Feature | Description |
42
+ |---------|-------------|
43
+ | **Algorithms** | HS256, RS256, ES256 — all standard algorithms via `jose` |
44
+ | **JWKS** | Auto-discovery from `/.well-known/jwks.json` with key rotation |
45
+ | **Self-Healing** | Expired/invalid tokens return actionable hints to the LLM agent |
46
+ | **Timing-Safe** | Constant-time signature verification |
47
+ | **Zero Config** | Works with Auth0, Clerk, Supabase, Firebase, any OIDC provider |
48
+
49
+ ## JWKS Auto-Discovery
50
+
51
+ ```typescript
52
+ const withJwt = jwtGuard({
53
+ jwksUri: 'https://auth.example.com/.well-known/jwks.json',
54
+ issuer: 'https://auth.example.com/',
55
+ audience: 'my-mcp-server',
56
+ });
57
+ ```
58
+
59
+ ## Installation
60
+
61
+ ```bash
62
+ npm install @vurb/jwt jose
63
+ ```
64
+
65
+ ### Peer Dependencies
66
+
67
+ | Package | Version |
68
+ |---------|---------|
69
+ | `vurb` | `^2.0.0` |
70
+ | `jose` | `^5.0.0` (optional) |
71
+
72
+ ## Requirements
73
+
74
+ - **Node.js** ≥ 18.0.0
75
+ - **Vurb.ts** ≥ 2.0.0 (peer dependency)
76
+
77
+ ## License
78
+
79
+ [Apache-2.0](https://github.com/vinkius-labs/vurb.ts/blob/main/LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vurb/jwt",
3
- "version": "3.6.6",
3
+ "version": "3.6.7",
4
4
  "description": "JWT verification middleware for MCP servers built with vurb. Standards-compliant token validation with jose, JWKS support, and self-healing error responses.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",