@rudderjs/passport 0.1.2 → 0.1.4

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.
package/README.md ADDED
@@ -0,0 +1,375 @@
1
+ # @rudderjs/passport
2
+
3
+ OAuth 2 server for RudderJS — the Laravel Passport equivalent. Turns your app into an OAuth 2 provider that issues JWT-signed access tokens, refresh tokens, and personal access tokens.
4
+
5
+ ## Features
6
+
7
+ - **Four OAuth 2 grants** — authorization code (with PKCE), client credentials, refresh token, device code
8
+ - **Personal access tokens** — Laravel-style `user.createToken()` via the `HasApiTokens` mixin
9
+ - **JWT with RS256** — signed with an RSA private key; third parties can verify tokens without calling your server
10
+ - **Auto-registered routes** — `/oauth/authorize`, `/oauth/token`, `/oauth/scopes`, `/oauth/device/*`, plus token revocation
11
+ - **Bearer middleware** — `RequireBearer()` + `scope('read', 'write')` for per-route API auth
12
+ - **Customization hooks** — swap any model, wire a custom consent screen, disable routes selectively
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pnpm add @rudderjs/passport @rudderjs/auth @rudderjs/orm-prisma
18
+ ```
19
+
20
+ Add the Prisma schema to your playground's multi-file schema setup:
21
+
22
+ ```prisma
23
+ // prisma/schema/passport.prisma
24
+ // Copy the models from @rudderjs/passport/schema/passport.prisma
25
+ ```
26
+
27
+ Then regenerate the client and push the schema:
28
+
29
+ ```bash
30
+ pnpm exec prisma generate
31
+ pnpm exec prisma db push
32
+ ```
33
+
34
+ Generate RSA keys (required before issuing tokens):
35
+
36
+ ```bash
37
+ pnpm rudder passport:keys
38
+ ```
39
+
40
+ Keys land in `storage/oauth-{private,public}.key`. In production, load them from env vars instead — see **Configuration** below.
41
+
42
+ ## Setup
43
+
44
+ ```ts
45
+ // config/passport.ts
46
+ import type { PassportConfig } from '@rudderjs/passport'
47
+
48
+ export default {
49
+ scopes: {
50
+ read: 'Read access',
51
+ write: 'Write access',
52
+ admin: 'Full administrative access',
53
+ },
54
+ tokensExpireIn: 15 * 24 * 60 * 60 * 1000, // 15 days
55
+ refreshTokensExpireIn: 30 * 24 * 60 * 60 * 1000, // 30 days
56
+ personalAccessTokensExpireIn: 6 * 30 * 24 * 60 * 60 * 1000, // ~6 months
57
+ } satisfies PassportConfig
58
+ ```
59
+
60
+ Add the provider — auto-discovery picks it up automatically after `pnpm rudder providers:discover`. Or register explicitly:
61
+
62
+ ```ts
63
+ // bootstrap/providers.ts
64
+ import { PassportProvider } from '@rudderjs/passport'
65
+
66
+ export default [
67
+ // ...auth, session, orm first
68
+ PassportProvider,
69
+ ]
70
+ ```
71
+
72
+ Register the OAuth routes. API routes are the right home because they're stateless — but the consent + device-approve endpoints both need a signed-in user, so if you use those, mount them on the `web` group:
73
+
74
+ ```ts
75
+ // routes/api.ts
76
+ import { registerPassportRoutes } from '@rudderjs/passport'
77
+
78
+ export default (router) => {
79
+ registerPassportRoutes(router)
80
+ }
81
+ ```
82
+
83
+ ## Protecting API Routes
84
+
85
+ `RequireBearer()` validates the JWT signature, checks expiration, and confirms the token hasn't been revoked. `scope(...)` enforces OAuth scopes on the token.
86
+
87
+ ```ts
88
+ import { RequireBearer, scope } from '@rudderjs/passport'
89
+
90
+ router.get('/api/user', [RequireBearer()], (req) => req.user)
91
+ router.get('/api/posts', [RequireBearer(), scope('read')], listPosts)
92
+ router.post('/api/posts', [RequireBearer(), scope('write')], createPost)
93
+ router.post('/api/admin', [RequireBearer(), scope('admin')], adminAction)
94
+ ```
95
+
96
+ A valid request attaches the resolved user to `req.user`, so handlers read it the same way they would under session auth.
97
+
98
+ The wildcard scope `*` grants everything — useful for personal access tokens issued without a specific scope restriction.
99
+
100
+ ## OAuth Flows
101
+
102
+ ### Authorization Code + PKCE (web apps, SPAs, mobile)
103
+
104
+ Standard 3-legged flow. Client redirects the user to `/oauth/authorize`, user approves, client exchanges the auth code at `/oauth/token`.
105
+
106
+ ```bash
107
+ # 1. User is redirected to:
108
+ GET /oauth/authorize
109
+ ?response_type=code
110
+ &client_id=<id>
111
+ &redirect_uri=https://app.example.com/callback
112
+ &scope=read+write
113
+ &state=<csrf>
114
+ &code_challenge=<s256-hash>
115
+ &code_challenge_method=S256
116
+
117
+ # 2. After user approves (POST /oauth/authorize), they're redirected back with:
118
+ # https://app.example.com/callback?code=<authcode>&state=<csrf>
119
+
120
+ # 3. App exchanges the code for tokens:
121
+ POST /oauth/token
122
+ {
123
+ "grant_type": "authorization_code",
124
+ "code": "<authcode>",
125
+ "client_id": "<id>",
126
+ "client_secret": "<secret>", // omit for public clients
127
+ "redirect_uri": "https://app.example.com/callback",
128
+ "code_verifier": "<pkce-verifier>"
129
+ }
130
+ ```
131
+
132
+ **PKCE is required for public clients.** Confidential clients may skip it but are still allowed to use it.
133
+
134
+ ### Client Credentials (machine-to-machine)
135
+
136
+ For service-to-service auth with no end-user. Only confidential clients.
137
+
138
+ ```bash
139
+ POST /oauth/token
140
+ {
141
+ "grant_type": "client_credentials",
142
+ "client_id": "<id>",
143
+ "client_secret": "<secret>",
144
+ "scope": "read write"
145
+ }
146
+ ```
147
+
148
+ ### Refresh Token
149
+
150
+ Rotates the access/refresh token pair. The old pair is revoked atomically — reusing a refresh token fails.
151
+
152
+ ```bash
153
+ POST /oauth/token
154
+ {
155
+ "grant_type": "refresh_token",
156
+ "refresh_token": "<jwt>",
157
+ "client_id": "<id>",
158
+ "client_secret": "<secret>"
159
+ }
160
+ ```
161
+
162
+ ### Device Code (CLIs, smart TVs, IoT)
163
+
164
+ Device requests a short user code, user approves it in a browser, device polls the token endpoint.
165
+
166
+ ```bash
167
+ # 1. Device requests a code
168
+ POST /oauth/device/code
169
+ { "client_id": "<id>", "scope": "read" }
170
+
171
+ # Response:
172
+ {
173
+ "device_code": "<long-opaque>",
174
+ "user_code": "ABCD-1234",
175
+ "verification_uri": "https://app.example.com/oauth/device",
176
+ "expires_in": 600,
177
+ "interval": 5
178
+ }
179
+
180
+ # 2. User visits verification_uri, enters user_code, approves:
181
+ POST /oauth/device/approve (web — needs signed-in user)
182
+ { "user_code": "ABCD-1234", "approved": true }
183
+
184
+ # 3. Device polls:
185
+ POST /oauth/token
186
+ {
187
+ "grant_type": "urn:ietf:params:oauth:grant-type:device_code",
188
+ "device_code": "<long-opaque>",
189
+ "client_id": "<id>"
190
+ }
191
+ # Returns 400 authorization_pending / 429 slow_down until approved,
192
+ # then 200 with the token pair.
193
+ ```
194
+
195
+ ## Personal Access Tokens
196
+
197
+ For long-lived API tokens — like GitHub personal access tokens. The user generates a token from their account UI; the token is shown once and never re-displayed.
198
+
199
+ Enable on your User model with the `HasApiTokens` mixin:
200
+
201
+ ```ts
202
+ // app/Models/User.ts
203
+ import { Model } from '@rudderjs/orm'
204
+ import { HasApiTokens } from '@rudderjs/passport'
205
+
206
+ export class User extends HasApiTokens(Model) {
207
+ static table = 'user'
208
+ // ...
209
+ }
210
+ ```
211
+
212
+ Then issue and manage tokens:
213
+
214
+ ```ts
215
+ const user = await User.find(userId)
216
+
217
+ // Create — returns the JWT once + the persisted record
218
+ const { plainTextToken, token } = await user.createToken('my-cli', ['read', 'write'])
219
+ // plainTextToken: 'eyJ...' — show this to the user ONCE
220
+
221
+ // List
222
+ const tokens = await user.tokens()
223
+
224
+ // Revoke all
225
+ const count = await user.revokeAllTokens()
226
+
227
+ // Check current request token's scope (inside a BearerMiddleware-protected route)
228
+ if (user.tokenCan('admin')) { ... }
229
+ ```
230
+
231
+ Personal access tokens are issued against an internal `__personal_access__` OAuth client that Passport auto-creates on first use.
232
+
233
+ ## Customization Hooks
234
+
235
+ Every surface — models, consent screen, route registration — can be swapped.
236
+
237
+ ### Custom Models
238
+
239
+ Extend any Passport model to add columns or override behavior, then register:
240
+
241
+ ```ts
242
+ import { Passport, OAuthClient } from '@rudderjs/passport'
243
+
244
+ class CustomOAuthClient extends OAuthClient {
245
+ static table = 'myOAuthClient'
246
+ // ...extra columns, overrides
247
+ }
248
+
249
+ // In a provider's boot()
250
+ Passport.useClientModel(CustomOAuthClient)
251
+ ```
252
+
253
+ Same pattern for `useTokenModel`, `useRefreshTokenModel`, `useAuthCodeModel`, `useDeviceCodeModel`.
254
+
255
+ ### Custom Consent Screen
256
+
257
+ `GET /oauth/authorize` returns JSON by default. Wire a `@rudderjs/view` page for real consent UX:
258
+
259
+ ```ts
260
+ import { Passport } from '@rudderjs/passport'
261
+ import { view } from '@rudderjs/view'
262
+
263
+ // In a provider's boot()
264
+ Passport.authorizationView((ctx) => {
265
+ return view('oauth.authorize', {
266
+ client: ctx.client,
267
+ scopes: ctx.scopes,
268
+ redirectUri: ctx.redirectUri,
269
+ state: ctx.state,
270
+ codeChallenge: ctx.codeChallenge,
271
+ })
272
+ })
273
+ ```
274
+
275
+ The view posts back to `POST /oauth/authorize` with the same params + the current user's session.
276
+
277
+ ### Selective Route Registration
278
+
279
+ Skip route groups you want to handle yourself:
280
+
281
+ ```ts
282
+ registerPassportRoutes(router, {
283
+ except: ['authorize', 'scopes'], // mount your own consent + scopes endpoints
284
+ prefix: '/api/oauth', // default is '/oauth'
285
+ })
286
+ ```
287
+
288
+ Available groups: `authorize`, `token`, `revoke`, `scopes`, `device`.
289
+
290
+ To disable route registration entirely, call `Passport.ignoreRoutes()` before the provider boots. `registerPassportRoutes()` becomes a no-op.
291
+
292
+ ## Configuration
293
+
294
+ ### Key Management
295
+
296
+ Three ways to provide the RSA keypair, in precedence order:
297
+
298
+ 1. **Env vars** (recommended for production):
299
+ ```ts
300
+ // config/passport.ts
301
+ export default {
302
+ privateKey: process.env.PASSPORT_PRIVATE_KEY,
303
+ publicKey: process.env.PASSPORT_PUBLIC_KEY,
304
+ }
305
+ ```
306
+
307
+ 2. **Custom key directory**:
308
+ ```ts
309
+ export default { keyPath: 'secure/keys' }
310
+ // Reads secure/keys/oauth-private.key + oauth-public.key
311
+ ```
312
+
313
+ 3. **Default** — files in `storage/oauth-{private,public}.key`, generated by `rudder passport:keys`.
314
+
315
+ ### Token Lifetimes
316
+
317
+ All in milliseconds:
318
+
319
+ | Option | Default | Purpose |
320
+ |---|---|---|
321
+ | `tokensExpireIn` | 15 days | Access token lifetime |
322
+ | `refreshTokensExpireIn` | 30 days | Refresh token lifetime |
323
+ | `personalAccessTokensExpireIn` | ~6 months | Personal access token lifetime |
324
+
325
+ ## CLI Commands
326
+
327
+ ```bash
328
+ # Generate an RSA keypair (refuses to overwrite without --force)
329
+ pnpm rudder passport:keys [--force]
330
+
331
+ # Create an OAuth client
332
+ pnpm rudder passport:client "My App"
333
+ pnpm rudder passport:client "SPA" --public # public (PKCE-required)
334
+ pnpm rudder passport:client "Service" --client-credentials # M2M
335
+ pnpm rudder passport:client "TV App" --device # device code
336
+ pnpm rudder passport:client "__personal_access__" --personal # personal token issuer
337
+
338
+ # Remove expired + revoked tokens, auth codes, device codes
339
+ pnpm rudder passport:purge
340
+ ```
341
+
342
+ `passport:client` prints the client ID and (for confidential clients) the secret. Secrets are SHA-256 hashed on write — store the printed secret immediately; it is not recoverable.
343
+
344
+ ## Architecture
345
+
346
+ **Tables** — five in `schema/passport.prisma`:
347
+
348
+ | Table | Purpose |
349
+ |---|---|
350
+ | `oauth_clients` | Registered client apps + their secrets |
351
+ | `oauth_access_tokens` | Issued access tokens (for revocation lookup) |
352
+ | `oauth_refresh_tokens` | Refresh tokens, linked 1:1 to an access token |
353
+ | `oauth_auth_codes` | Short-lived authorization codes (single-use, 10 min) |
354
+ | `oauth_device_codes` | Device authorization flow state |
355
+
356
+ **Token shape** — JWTs carry `jti` (token ID), `sub` (user ID), `aud` (client ID), `scopes`, `iat`, `exp`. Revocation is checked against the DB row keyed by `jti`.
357
+
358
+ **Provider order** — `PassportProvider` boots at the `infrastructure` stage and depends on `@rudderjs/auth` + `@rudderjs/orm-prisma`. Auto-discovery resolves the order automatically.
359
+
360
+ ## Pitfalls
361
+
362
+ - **Missing keys** — `pnpm rudder passport:keys` before issuing any token, or set `PASSPORT_PRIVATE_KEY` + `PASSPORT_PUBLIC_KEY`.
363
+ - **Schema not migrated** — copy `schema/passport.prisma` into your project's Prisma schema and run `prisma db push`.
364
+ - **Bearer middleware on web routes** — use it on `api.ts` routes. Web routes have session-based auth already via `AuthMiddleware` on the `web` group.
365
+ - **PKCE on public clients** — public clients *must* send `code_challenge` + `code_challenge_method=S256`. No PKCE = `invalid_request`.
366
+ - **Refresh token replay** — reusing an old refresh token returns `invalid_grant`; the rotation already revoked it.
367
+ - **Stale personal-access client cache** — `resetPersonalAccessClient()` is test-only. Don't call it at runtime.
368
+ - **Prisma delegate vs `@@map`** — if you override a model, `static table` must be the Prisma delegate name (camelCase), not the `@@map`'d SQL name. `oauthClient`, not `oauth_clients`.
369
+ - **Scope middleware ordering** — `scope(...)` must run after `RequireBearer()` or `BearerMiddleware()`. It reads token scopes from the request state set by the bearer middleware.
370
+
371
+ ## Related
372
+
373
+ - [`@rudderjs/auth`](../auth) — session-based web auth (login, register, password reset)
374
+ - [`@rudderjs/orm`](../orm) — ORM for the OAuth models
375
+ - [OAuth 2.1 draft](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-10) — the spec Passport targets
package/dist/index.js CHANGED
@@ -92,7 +92,7 @@ export class PassportProvider extends ServiceProvider {
92
92
  }).description('Remove expired tokens and auth codes');
93
93
  // Register make:* scaffolder for passport
94
94
  try {
95
- const { registerMakeSpecs } = await import('@rudderjs/rudder');
95
+ const { registerMakeSpecs } = await import('@rudderjs/console');
96
96
  registerMakeSpecs({
97
97
  command: 'make:passport-client',
98
98
  description: 'Create a new OAuth client seeder',
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAExD,6DAA6D;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGlE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB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gBACtD,OAAO,CAAC,GAAG,CAAC,uBAAuB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;YAC1D,CAAC,CAAC,CAAC,WAAW,CAAC,sCAAsC,CAAC,CAAA;YAEtD,0CAA0C;YAC1C,IAAI,CAAC;gBACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAA;gBAC/D,iBAAiB,CAAC;oBAChB,OAAO,EAAM,sBAAsB;oBACnC,WAAW,EAAE,kCAAkC;oBAC/C,KAAK,EAAQ,gCAAgC;oBAC7C,SAAS,EAAI,aAAa;oBAC1B,IAAI,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;;wBAEP,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;;;;;;;;;;CAUrE;iBACQ,CAAC,CAAA;YACJ,CAAC;YAAC,MAAM,CAAC,CAAC,0BAA0B,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC,CAAC,0BAA0B,CAAC,CAAC;IACxC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudderjs/passport",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "rudderjs": {
5
5
  "provider": "PassportProvider",
6
6
  "stage": "infrastructure",
@@ -33,15 +33,15 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@rudderjs/contracts": "0.1.0",
37
- "@rudderjs/core": "0.1.1",
38
- "@rudderjs/orm": "0.1.1"
36
+ "@rudderjs/core": "^0.1.4",
37
+ "@rudderjs/contracts": "^0.2.0",
38
+ "@rudderjs/orm": "^0.1.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^20.0.0",
42
42
  "typescript": "^5.4.0",
43
43
  "tsx": "^4.0.0",
44
- "@rudderjs/rudder": "0.0.3"
44
+ "@rudderjs/console": "^0.0.4"
45
45
  },
46
46
  "author": "Suleiman Shahbari",
47
47
  "scripts": {