@arcblock/did-connect-service 4.1.13 → 4.1.15

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 (53) hide show
  1. package/dist/_generated/asset-bytes.js +1 -1
  2. package/dist/_generated/asset-manifest.js +1 -1
  3. package/dist/assets/{admin.c26bb17a.css → admin.dfeedbe4.css} +10 -0
  4. package/dist/blocklet-service-rpc.d.ts.map +1 -1
  5. package/dist/blocklet-service-rpc.js +4 -3
  6. package/dist/blocklet-service-rpc.js.map +1 -1
  7. package/dist/blocklet-service.d.ts.map +1 -1
  8. package/dist/blocklet-service.js +5 -1
  9. package/dist/blocklet-service.js.map +1 -1
  10. package/dist/handlers/access-key-connect-handler.d.ts +3 -0
  11. package/dist/handlers/access-key-connect-handler.d.ts.map +1 -1
  12. package/dist/handlers/access-key-connect-handler.js +6 -1
  13. package/dist/handlers/access-key-connect-handler.js.map +1 -1
  14. package/dist/handlers/auth-handler.d.ts.map +1 -1
  15. package/dist/handlers/auth-handler.js +17 -1
  16. package/dist/handlers/auth-handler.js.map +1 -1
  17. package/dist/handlers/federation-admin-handler.d.ts +2 -0
  18. package/dist/handlers/federation-admin-handler.d.ts.map +1 -1
  19. package/dist/handlers/federation-admin-handler.js +57 -6
  20. package/dist/handlers/federation-admin-handler.js.map +1 -1
  21. package/dist/handlers/oauth-as-handler.d.ts +47 -0
  22. package/dist/handlers/oauth-as-handler.d.ts.map +1 -0
  23. package/dist/handlers/oauth-as-handler.js +213 -0
  24. package/dist/handlers/oauth-as-handler.js.map +1 -0
  25. package/dist/handlers/passkey-handler.d.ts.map +1 -1
  26. package/dist/handlers/passkey-handler.js +5 -4
  27. package/dist/handlers/passkey-handler.js.map +1 -1
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +1 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/pages/admin/styles.d.ts +1 -1
  33. package/dist/pages/admin/styles.d.ts.map +1 -1
  34. package/dist/pages/admin/styles.js +10 -0
  35. package/dist/pages/admin/styles.js.map +1 -1
  36. package/package.json +5 -5
  37. package/dist/assets/admin-core.a13c2729.js +0 -1461
  38. package/dist/assets/admin-core.c0b5af61.js +0 -1393
  39. package/dist/assets/admin-core.cbbdbe6d.js +0 -1465
  40. package/dist/assets/admin-core.e83fd379.js +0 -1397
  41. package/dist/assets/admin-extra.143b5774.js +0 -2543
  42. package/dist/assets/admin-extra.35b91f98.js +0 -2543
  43. package/dist/assets/admin-extra.7ca9c16b.js +0 -2529
  44. package/dist/assets/admin-extra.841b2bbe.js +0 -2530
  45. package/dist/assets/admin-extra.afcb3651.js +0 -2528
  46. package/dist/assets/login.4404e695.js +0 -720
  47. package/dist/assets/login.bb9f8b03.js +0 -720
  48. package/dist/assets/login.d3f05790.js +0 -720
  49. package/dist/assets/login.fa25f37a.js +0 -720
  50. package/dist/http/security-headers.d.ts +0 -38
  51. package/dist/http/security-headers.d.ts.map +0 -1
  52. package/dist/http/security-headers.js +0 -67
  53. package/dist/http/security-headers.js.map +0 -1
@@ -1,38 +0,0 @@
1
- /**
2
- * Shared security headers for server-rendered HTML responses (see issue #72).
3
- *
4
- * connect-service renders login/homepage/admin/invite/OAuth/error pages as raw
5
- * HTML strings from several different handlers (there is no single Hono app /
6
- * router that all of them funnel through — see the handlers listed at each
7
- * `htmlResponse` call site). Without a common send point, every one of those
8
- * handlers previously built its own `new Response(html, { headers: {...} })`
9
- * and could silently drop hardening headers. `htmlResponse` is the one place
10
- * that guarantees they don't: every HTML response gets `X-Frame-Options`,
11
- * `X-Content-Type-Options`, and a CSP, even though the pages themselves stay
12
- * wherever they are.
13
- *
14
- * This is defense-in-depth, not a substitute for fixing individual XSS sinks
15
- * (see #62/#63/#64) — it limits what an attacker can do *if* one of those sinks
16
- * is (or becomes) exploitable: no clickjacking (`frame-ancestors 'none'` +
17
- * `X-Frame-Options: DENY`), no cross-origin script/style loads, no MIME-sniff
18
- * smuggling (`nosniff`).
19
- *
20
- * CSP trade-off (intentional, see #72 discussion): connect-service's pages rely
21
- * heavily on inline `<script>` blocks (see `packages/connect-service/CLAUDE.md` —
22
- * Browser Asset Externalization) — the login/OAuth/admin/invite pages all inline
23
- * small bootstrap scripts alongside externalized asset bundles. Migrating every
24
- * inline script to a nonce- or hash-based CSP is a much larger, higher-regression-risk
25
- * change than this issue calls for, so `script-src`/`style-src` keep `'unsafe-inline'`
26
- * for now. The policy still meaningfully narrows the blast radius (no foreign script
27
- * origins, no framing, no arbitrary form submission targets). Tightening to a
28
- * nonce-based CSP is a good follow-up once the inline-script surface is consolidated.
29
- */
30
- export declare const HTML_SECURITY_HEADERS: Readonly<Record<string, string>>;
31
- /**
32
- * Build a `Response` for server-rendered HTML. Merges the shared security headers
33
- * (always applied — they are not overridable via `init.headers`, see #72) with
34
- * caller-supplied headers (`Content-Type` defaults to `text/html; charset=utf-8`
35
- * unless the caller sets its own, `Cache-Control` etc. pass through untouched).
36
- */
37
- export declare function htmlResponse(html: string, init?: ResponseInit): Response;
38
- //# sourceMappingURL=security-headers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"security-headers.d.ts","sourceRoot":"","sources":["../../src/http/security-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAmBH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIjE,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CASxE"}
@@ -1,67 +0,0 @@
1
- /**
2
- * Shared security headers for server-rendered HTML responses (see issue #72).
3
- *
4
- * connect-service renders login/homepage/admin/invite/OAuth/error pages as raw
5
- * HTML strings from several different handlers (there is no single Hono app /
6
- * router that all of them funnel through — see the handlers listed at each
7
- * `htmlResponse` call site). Without a common send point, every one of those
8
- * handlers previously built its own `new Response(html, { headers: {...} })`
9
- * and could silently drop hardening headers. `htmlResponse` is the one place
10
- * that guarantees they don't: every HTML response gets `X-Frame-Options`,
11
- * `X-Content-Type-Options`, and a CSP, even though the pages themselves stay
12
- * wherever they are.
13
- *
14
- * This is defense-in-depth, not a substitute for fixing individual XSS sinks
15
- * (see #62/#63/#64) — it limits what an attacker can do *if* one of those sinks
16
- * is (or becomes) exploitable: no clickjacking (`frame-ancestors 'none'` +
17
- * `X-Frame-Options: DENY`), no cross-origin script/style loads, no MIME-sniff
18
- * smuggling (`nosniff`).
19
- *
20
- * CSP trade-off (intentional, see #72 discussion): connect-service's pages rely
21
- * heavily on inline `<script>` blocks (see `packages/connect-service/CLAUDE.md` —
22
- * Browser Asset Externalization) — the login/OAuth/admin/invite pages all inline
23
- * small bootstrap scripts alongside externalized asset bundles. Migrating every
24
- * inline script to a nonce- or hash-based CSP is a much larger, higher-regression-risk
25
- * change than this issue calls for, so `script-src`/`style-src` keep `'unsafe-inline'`
26
- * for now. The policy still meaningfully narrows the blast radius (no foreign script
27
- * origins, no framing, no arbitrary form submission targets). Tightening to a
28
- * nonce-based CSP is a good follow-up once the inline-script surface is consolidated.
29
- */
30
- /** Directives shared by every HTML response. Keep in sync with the pages this
31
- * protects: assets are same-origin (`assetUrl()` — see `asset-registry.ts`),
32
- * avatars/branding logos may be arbitrary external `https:` URLs, and all forms /
33
- * XHR calls target this same origin (OAuth provider redirects are top-level
34
- * navigations, which CSP does not gate). */
35
- const CONTENT_SECURITY_POLICY = [
36
- "default-src 'self'",
37
- "script-src 'self' 'unsafe-inline'",
38
- "style-src 'self' 'unsafe-inline'",
39
- "img-src 'self' data: https:",
40
- "font-src 'self' data:",
41
- "connect-src 'self'",
42
- "frame-ancestors 'none'",
43
- "base-uri 'self'",
44
- "form-action 'self'",
45
- ].join("; ");
46
- export const HTML_SECURITY_HEADERS = Object.freeze({
47
- "X-Frame-Options": "DENY",
48
- "X-Content-Type-Options": "nosniff",
49
- "Content-Security-Policy": CONTENT_SECURITY_POLICY,
50
- });
51
- /**
52
- * Build a `Response` for server-rendered HTML. Merges the shared security headers
53
- * (always applied — they are not overridable via `init.headers`, see #72) with
54
- * caller-supplied headers (`Content-Type` defaults to `text/html; charset=utf-8`
55
- * unless the caller sets its own, `Cache-Control` etc. pass through untouched).
56
- */
57
- export function htmlResponse(html, init) {
58
- const headers = new Headers(init?.headers);
59
- if (!headers.has("Content-Type")) {
60
- headers.set("Content-Type", "text/html; charset=utf-8");
61
- }
62
- for (const [name, value] of Object.entries(HTML_SECURITY_HEADERS)) {
63
- headers.set(name, value);
64
- }
65
- return new Response(html, { ...init, headers });
66
- }
67
- //# sourceMappingURL=security-headers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"security-headers.js","sourceRoot":"","sources":["../../src/http/security-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;4CAI4C;AAC5C,MAAM,uBAAuB,GAAG;IAC9B,oBAAoB;IACpB,mCAAmC;IACnC,kCAAkC;IAClC,6BAA6B;IAC7B,uBAAuB;IACvB,oBAAoB;IACpB,wBAAwB;IACxB,iBAAiB;IACjB,oBAAoB;CACrB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,qBAAqB,GAAqC,MAAM,CAAC,MAAM,CAAC;IACnF,iBAAiB,EAAE,MAAM;IACzB,wBAAwB,EAAE,SAAS;IACnC,yBAAyB,EAAE,uBAAuB;CACnD,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,IAAmB;IAC5D,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;IAC1D,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,CAAC;QAClE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC"}