@willyim/idp 0.5.0 → 0.6.0
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 +25 -1
- package/dist/src/client.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/react-router/index.d.ts +3 -0
- package/dist/src/react-router/index.d.ts.map +1 -1
- package/dist/src/react-router/index.js +24 -1
- package/dist/src/schemas/index.d.ts +2 -0
- package/dist/src/schemas/index.d.ts.map +1 -1
- package/dist/src/schemas/index.js +3 -0
- package/dist/src/schemas/operations.d.ts +1 -0
- package/dist/src/schemas/operations.d.ts.map +1 -1
- package/dist/src/session.d.ts +20 -0
- package/dist/src/session.d.ts.map +1 -1
- package/dist/src/session.js +13 -0
- package/openapi/idp-api.json +37 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,7 +82,8 @@ return requestHandler(request, {
|
|
|
82
82
|
})
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
**`app/routes/auth.$.tsx`** — serves `/auth/login`, `/auth/callback`, `/auth/logout
|
|
85
|
+
**`app/routes/auth.$.tsx`** — serves `/auth/login`, `/auth/callback`, `/auth/logout`
|
|
86
|
+
and `/auth/me`:
|
|
86
87
|
|
|
87
88
|
```ts
|
|
88
89
|
import { createAuthRoute } from "@willyim/idp/react-router"
|
|
@@ -110,6 +111,17 @@ export async function loader(args: Route.LoaderArgs) {
|
|
|
110
111
|
}
|
|
111
112
|
```
|
|
112
113
|
|
|
114
|
+
For code that can't reach a loader — a client-only route, a widget mounted
|
|
115
|
+
outside the router, a fetch from a worker — the same route answers `/auth/me`:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
const { user } = await fetch("/auth/me").then((r) => r.json())
|
|
119
|
+
// 200 { user: PublicSession } · 401 { user: null }
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
A server-rendered page should keep using `requireSession`: `/auth/me` is the
|
|
123
|
+
same data, one network hop later.
|
|
124
|
+
|
|
113
125
|
## Env
|
|
114
126
|
|
|
115
127
|
| Var | Purpose |
|
|
@@ -205,6 +217,18 @@ type Session = {
|
|
|
205
217
|
|
|
206
218
|
`can()` matches exactly, and honours `resource:*` and `*` grants.
|
|
207
219
|
|
|
220
|
+
`image` is effectively always set against the willy.im IdP: it renders a
|
|
221
|
+
deterministic [blobatar](https://blobatar.dev) for anyone who never uploaded a
|
|
222
|
+
picture, so `<img src={session.image} />` needs no fallback of its own. The type
|
|
223
|
+
stays nullable for other issuers. Show `session.name || session.email` — a name
|
|
224
|
+
is a person, an email is a login.
|
|
225
|
+
|
|
226
|
+
### `publicSession(session)`
|
|
227
|
+
|
|
228
|
+
`Session` as JSON, without the methods and without the session id — the shape
|
|
229
|
+
that is safe to hand a browser. This is what `/auth/me` (below) returns, and
|
|
230
|
+
what your own `/me` should.
|
|
231
|
+
|
|
208
232
|
### `createIdpClient(options)` — the OIDC relying party on its own
|
|
209
233
|
|
|
210
234
|
```ts
|
package/dist/src/client.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const DEFAULT_SCOPES: readonly IdpScope[];
|
|
|
21
21
|
export type IdpClientOptions = {
|
|
22
22
|
/**
|
|
23
23
|
* The OIDC issuer, including the basepath the IdP is mounted on:
|
|
24
|
-
* `https://idp.willy.im/auth` (or a vanity domain, `https://idp.
|
|
24
|
+
* `https://idp.willy.im/auth` (or a vanity domain, `https://idp.app1.com/auth`).
|
|
25
25
|
* Discovery is `${issuer}/.well-known/openid-configuration`.
|
|
26
26
|
*/
|
|
27
27
|
issuer: string;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @willyim/idp/react-router the auth route and the loader guards
|
|
14
14
|
*/
|
|
15
15
|
export { createIdpClient, createPkce, DEFAULT_SCOPES, IdpError, SUPPORTED_SCOPES, type AuthorizationUrlInput, type Discovery, type IdpClient, type IdpClientOptions, type IdpScope, type Tokens, } from "./client.js";
|
|
16
|
-
export { createIdp, DEFAULT_SESSION_COOKIE, safeNext, type Idp, type IdpOptions, type Session, type SessionOptions, } from "./session.js";
|
|
16
|
+
export { createIdp, DEFAULT_SESSION_COOKIE, publicSession, safeNext, type Idp, type IdpOptions, type PublicSession, type Session, type SessionOptions, } from "./session.js";
|
|
17
17
|
export { memorySessions, type MemorySessionStore, type SessionRecord, type SessionStore, } from "./store.js";
|
|
18
18
|
export { grants, normalizeClaims, PERMISSIONS_CLAIM, WORKSPACES_CLAIM, type Actor, type Claims, type Workspace, } from "./claims.js";
|
|
19
19
|
export { createManagementApi, type ManagementApi, type ManagementApiOptions, } from "./api.js";
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,eAAe,EACf,UAAU,EACV,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,MAAM,GACZ,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,QAAQ,EACR,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,GACpB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,SAAS,GACf,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,oBAAoB,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B,OAAO,EACL,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,SAAS,GACf,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,cAAc,EACd,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,aAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @willyim/idp/react-router the auth route and the loader guards
|
|
14
14
|
*/
|
|
15
15
|
export { createIdpClient, createPkce, DEFAULT_SCOPES, IdpError, SUPPORTED_SCOPES, } from "./client.js";
|
|
16
|
-
export { createIdp, DEFAULT_SESSION_COOKIE, safeNext, } from "./session.js";
|
|
16
|
+
export { createIdp, DEFAULT_SESSION_COOKIE, publicSession, safeNext, } from "./session.js";
|
|
17
17
|
export { memorySessions, } from "./store.js";
|
|
18
18
|
export { grants, normalizeClaims, PERMISSIONS_CLAIM, WORKSPACES_CLAIM, } from "./claims.js";
|
|
19
19
|
export { createManagementApi, } from "./api.js";
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* const session = await requireSession(args)
|
|
10
10
|
* const session = await requirePermission(args, "admin")
|
|
11
11
|
*
|
|
12
|
+
* // from the browser, when there's no loader to read
|
|
13
|
+
* await fetch("/auth/me").then((r) => r.json()) // { user: PublicSession | null }
|
|
14
|
+
*
|
|
12
15
|
* No react-router import: the adapter only ever produces `Response`s and
|
|
13
16
|
* functions, both of which react-router already understands. That keeps the
|
|
14
17
|
* subpath dependency-free too, and makes it usable from any framework whose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-router/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react-router/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGjD,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAC5C,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;CAC3C,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,gBAAqB;mBAmEhE,SAAS;mBACT,SAAS;EAE3B;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oCAAoC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,kFAAkF;AAClF,wBAAsB,UAAU,CAC9B,IAAI,EAAE,SAAS,EACf,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAEzB;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,SAAS,EACf,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAMlB"}
|
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|
* const session = await requireSession(args)
|
|
10
10
|
* const session = await requirePermission(args, "admin")
|
|
11
11
|
*
|
|
12
|
+
* // from the browser, when there's no loader to read
|
|
13
|
+
* await fetch("/auth/me").then((r) => r.json()) // { user: PublicSession | null }
|
|
14
|
+
*
|
|
12
15
|
* No react-router import: the adapter only ever produces `Response`s and
|
|
13
16
|
* functions, both of which react-router already understands. That keeps the
|
|
14
17
|
* subpath dependency-free too, and makes it usable from any framework whose
|
|
15
18
|
* handlers take a `Request`.
|
|
16
19
|
*/
|
|
17
|
-
import { safeNext } from "../session.js";
|
|
20
|
+
import { publicSession, safeNext } from "../session.js";
|
|
18
21
|
/**
|
|
19
22
|
* Serves `/auth/login`, `/auth/callback` and `/auth/logout` from a single splat
|
|
20
23
|
* route. `loader` covers the GET navigations; `action` covers a POSTed logout
|
|
@@ -57,6 +60,26 @@ export function createAuthRoute(getIdp, options = {}) {
|
|
|
57
60
|
// outlives the app's.
|
|
58
61
|
return redirect(endSession ?? redirectTo, headers);
|
|
59
62
|
}
|
|
63
|
+
// The session as JSON, for the code that can't reach a loader: a client-only
|
|
64
|
+
// route, a widget mounted outside the router, a fetch from a worker. A
|
|
65
|
+
// server-rendered page should keep reading `requireSession` — this is the
|
|
66
|
+
// same data one network hop later.
|
|
67
|
+
if (action === "me") {
|
|
68
|
+
const session = await idp.getSession(args.request);
|
|
69
|
+
const headers = new Headers({
|
|
70
|
+
"content-type": "application/json",
|
|
71
|
+
// Per-user and revocable — never let a shared cache hold it.
|
|
72
|
+
"cache-control": "no-store, private",
|
|
73
|
+
});
|
|
74
|
+
if (!session) {
|
|
75
|
+
return new Response(JSON.stringify({ user: null }), { status: 401, headers });
|
|
76
|
+
}
|
|
77
|
+
// Polling this keeps a sliding session alive, same as any other request.
|
|
78
|
+
const renewed = session.renewCookie();
|
|
79
|
+
if (renewed)
|
|
80
|
+
headers.append("set-cookie", renewed);
|
|
81
|
+
return new Response(JSON.stringify({ user: publicSession(session) }), { status: 200, headers });
|
|
82
|
+
}
|
|
60
83
|
return new Response("not found", { status: 404 });
|
|
61
84
|
}
|
|
62
85
|
return {
|
|
@@ -25,6 +25,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
25
25
|
id: z.ZodString;
|
|
26
26
|
email: z.ZodString;
|
|
27
27
|
name: z.ZodNullable<z.ZodString>;
|
|
28
|
+
image: z.ZodString;
|
|
28
29
|
emailVerified: z.ZodBoolean;
|
|
29
30
|
createdAt: z.ZodString;
|
|
30
31
|
}, z.core.$strip>;
|
|
@@ -85,6 +86,7 @@ export declare const UserListSchema: z.ZodObject<{
|
|
|
85
86
|
id: z.ZodString;
|
|
86
87
|
email: z.ZodString;
|
|
87
88
|
name: z.ZodNullable<z.ZodString>;
|
|
89
|
+
image: z.ZodString;
|
|
88
90
|
emailVerified: z.ZodBoolean;
|
|
89
91
|
createdAt: z.ZodString;
|
|
90
92
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB;;;;;;;;;;iBAY5B,CAAA;AAEF,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB;;;;;;;;;;iBAY5B,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;iBASrB,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;iBAM1B,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAAyD,CAAA;AAE3F;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;iBAejC,CAAA;AACF,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAA;AAEF,uEAAuE;AACvE,eAAO,MAAM,sBAAsB;;;;;iBAQjC,CAAA;AAEF,eAAO,MAAM,kBAAkB;;iBAE7B,CAAA;AAEF,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB;;iBAEjC,CAAA;AACF,eAAO,MAAM,oBA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B,CAAA;AACF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;iBAA4C,CAAA;AAEzE,eAAO,MAAM,iBAAiB;;;;iBAM5B,CAAA;AACF,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAA;AAIF,eAAO,MAAM,cAAc;;;;;;;;;;;;;iBASzB,CAAA;AACF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAA8C,CAAA;AAE7E,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAA;AACF,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAA"}
|
|
@@ -27,6 +27,9 @@ export const UserSchema = z.object({
|
|
|
27
27
|
id: z.string(),
|
|
28
28
|
email: z.string(),
|
|
29
29
|
name: z.string().nullable(),
|
|
30
|
+
image: z
|
|
31
|
+
.string()
|
|
32
|
+
.describe("Avatar URL — the user's own picture, or the blobatar the IdP renders for them"),
|
|
30
33
|
emailVerified: z.boolean(),
|
|
31
34
|
createdAt: z.string(),
|
|
32
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/schemas/operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsCvB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEpE,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEnF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,UAAU,E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,GAAG,MAAM,IAAI,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,GAC5F,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,GAC3B,KAAK,CAAA;AAET,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE7E"}
|
package/dist/src/session.d.ts
CHANGED
|
@@ -64,6 +64,26 @@ export type Session = {
|
|
|
64
64
|
*/
|
|
65
65
|
renewCookie(): string | null;
|
|
66
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* A `Session` as JSON — the shape that is safe to hand a browser.
|
|
69
|
+
*
|
|
70
|
+
* Two deliberate omissions. The methods are gone because they don't serialize.
|
|
71
|
+
* The session *id* is gone because it is the thing the signed cookie resolves
|
|
72
|
+
* to: it never needs to be in reach of script, and a projection that leaves it
|
|
73
|
+
* out can't leak it by accident later.
|
|
74
|
+
*/
|
|
75
|
+
export type PublicSession = {
|
|
76
|
+
sub: string;
|
|
77
|
+
email: string;
|
|
78
|
+
name: string | null;
|
|
79
|
+
image: string | null;
|
|
80
|
+
permissions: string[];
|
|
81
|
+
workspaces: Workspace[];
|
|
82
|
+
actor: Actor | null;
|
|
83
|
+
expiresAt: string;
|
|
84
|
+
};
|
|
85
|
+
/** `Session` -> `PublicSession`. What `/auth/me` returns, and what an app's own `/me` should. */
|
|
86
|
+
export declare function publicSession(session: Session): PublicSession;
|
|
67
87
|
export type Idp = ReturnType<typeof createIdp>;
|
|
68
88
|
export declare function createIdp(options: IdpOptions): {
|
|
69
89
|
/** The Layer 0 client, for anything the session layer doesn't wrap. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE3D,OAAO,EAKL,KAAK,gBA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 import { parseDuration } from "./duration.js";
|
|
|
17
17
|
export const DEFAULT_SESSION_COOKIE = "idp_session";
|
|
18
18
|
/** How long the login handshake may take before its state cookie is stale. */
|
|
19
19
|
const STATE_COOKIE_MAX_AGE_MS = 10 * 60_000;
|
|
20
|
+
/** `Session` -> `PublicSession`. What `/auth/me` returns, and what an app's own `/me` should. */
|
|
21
|
+
export function publicSession(session) {
|
|
22
|
+
return {
|
|
23
|
+
sub: session.sub,
|
|
24
|
+
email: session.email,
|
|
25
|
+
name: session.name,
|
|
26
|
+
image: session.image,
|
|
27
|
+
permissions: session.permissions,
|
|
28
|
+
workspaces: session.workspaces,
|
|
29
|
+
actor: session.actor,
|
|
30
|
+
expiresAt: session.expiresAt.toISOString(),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
20
33
|
/**
|
|
21
34
|
* What rides in the login state cookie. HMAC-signed, so tampering is caught
|
|
22
35
|
* before this ever parses — the schema is here to catch a cookie left over
|
package/openapi/idp-api.json
CHANGED
|
@@ -78,6 +78,13 @@
|
|
|
78
78
|
},
|
|
79
79
|
"description": "The app's declared product-permission catalog"
|
|
80
80
|
},
|
|
81
|
+
"resources": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": {
|
|
84
|
+
"type": "string"
|
|
85
|
+
},
|
|
86
|
+
"description": "Protected resource URIs (e.g. the app's MCP server) — valid `resource` audiences for access tokens"
|
|
87
|
+
},
|
|
81
88
|
"redirectUris": {
|
|
82
89
|
"type": "array",
|
|
83
90
|
"items": {
|
|
@@ -98,6 +105,7 @@
|
|
|
98
105
|
"app",
|
|
99
106
|
"allowSignup",
|
|
100
107
|
"permissions",
|
|
108
|
+
"resources",
|
|
101
109
|
"redirectUris",
|
|
102
110
|
"disabled",
|
|
103
111
|
"createdAt"
|
|
@@ -283,6 +291,13 @@
|
|
|
283
291
|
},
|
|
284
292
|
"description": "The app's declared product-permission catalog"
|
|
285
293
|
},
|
|
294
|
+
"resources": {
|
|
295
|
+
"type": "array",
|
|
296
|
+
"items": {
|
|
297
|
+
"type": "string"
|
|
298
|
+
},
|
|
299
|
+
"description": "Protected resource URIs (e.g. the app's MCP server) — valid `resource` audiences for access tokens"
|
|
300
|
+
},
|
|
286
301
|
"redirectUris": {
|
|
287
302
|
"type": "array",
|
|
288
303
|
"items": {
|
|
@@ -303,6 +318,7 @@
|
|
|
303
318
|
"app",
|
|
304
319
|
"allowSignup",
|
|
305
320
|
"permissions",
|
|
321
|
+
"resources",
|
|
306
322
|
"redirectUris",
|
|
307
323
|
"disabled",
|
|
308
324
|
"createdAt"
|
|
@@ -364,6 +380,14 @@
|
|
|
364
380
|
},
|
|
365
381
|
"allowSignup": {
|
|
366
382
|
"type": "boolean"
|
|
383
|
+
},
|
|
384
|
+
"resources": {
|
|
385
|
+
"description": "Replace the app's protected resource URIs — absolute https, no fragment",
|
|
386
|
+
"type": "array",
|
|
387
|
+
"items": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"format": "uri"
|
|
390
|
+
}
|
|
367
391
|
}
|
|
368
392
|
}
|
|
369
393
|
}
|
|
@@ -414,6 +438,13 @@
|
|
|
414
438
|
},
|
|
415
439
|
"description": "The app's declared product-permission catalog"
|
|
416
440
|
},
|
|
441
|
+
"resources": {
|
|
442
|
+
"type": "array",
|
|
443
|
+
"items": {
|
|
444
|
+
"type": "string"
|
|
445
|
+
},
|
|
446
|
+
"description": "Protected resource URIs (e.g. the app's MCP server) — valid `resource` audiences for access tokens"
|
|
447
|
+
},
|
|
417
448
|
"redirectUris": {
|
|
418
449
|
"type": "array",
|
|
419
450
|
"items": {
|
|
@@ -434,6 +465,7 @@
|
|
|
434
465
|
"app",
|
|
435
466
|
"allowSignup",
|
|
436
467
|
"permissions",
|
|
468
|
+
"resources",
|
|
437
469
|
"redirectUris",
|
|
438
470
|
"disabled",
|
|
439
471
|
"createdAt"
|
|
@@ -1242,6 +1274,10 @@
|
|
|
1242
1274
|
}
|
|
1243
1275
|
]
|
|
1244
1276
|
},
|
|
1277
|
+
"image": {
|
|
1278
|
+
"type": "string",
|
|
1279
|
+
"description": "Avatar URL — the user's own picture, or the blobatar the IdP renders for them"
|
|
1280
|
+
},
|
|
1245
1281
|
"emailVerified": {
|
|
1246
1282
|
"type": "boolean"
|
|
1247
1283
|
},
|
|
@@ -1253,6 +1289,7 @@
|
|
|
1253
1289
|
"id",
|
|
1254
1290
|
"email",
|
|
1255
1291
|
"name",
|
|
1292
|
+
"image",
|
|
1256
1293
|
"emailVerified",
|
|
1257
1294
|
"createdAt"
|
|
1258
1295
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willyim/idp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Login for apps that don't own identity \u2014 OIDC client, server sessions, and react-router guards against the willy.im IdP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|