@arcblock/did-connect-service 4.1.30 → 4.1.31

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 (42) 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-extra.d12f05bb.js → admin-extra.8243c7f4.js} +12 -3
  4. package/dist/handlers/branding-handler.d.ts.map +1 -1
  5. package/dist/handlers/branding-handler.js +37 -1
  6. package/dist/handlers/branding-handler.js.map +1 -1
  7. package/dist/og/worker.d.ts +29 -0
  8. package/dist/og/worker.d.ts.map +1 -1
  9. package/dist/og/worker.js +79 -2
  10. package/dist/og/worker.js.map +1 -1
  11. package/dist/pages/admin/scripts/cropper.d.ts +1 -1
  12. package/dist/pages/admin/scripts/cropper.d.ts.map +1 -1
  13. package/dist/pages/admin/scripts/cropper.js +12 -3
  14. package/dist/pages/admin/scripts/cropper.js.map +1 -1
  15. package/package.json +4 -3
  16. package/dist/assets/admin-core.1fc3260c.js +0 -1623
  17. package/dist/assets/admin-core.5a2d69b0.js +0 -2067
  18. package/dist/assets/admin-core.9fff6042.js +0 -2083
  19. package/dist/assets/admin-core.a13c2729.js +0 -1461
  20. package/dist/assets/admin-core.a63bbc69.js +0 -1464
  21. package/dist/assets/admin-core.c0b5af61.js +0 -1393
  22. package/dist/assets/admin-core.cbbdbe6d.js +0 -1465
  23. package/dist/assets/admin-core.e83fd379.js +0 -1397
  24. package/dist/assets/admin-extra.143b5774.js +0 -2543
  25. package/dist/assets/admin-extra.35b91f98.js +0 -2543
  26. package/dist/assets/admin-extra.531b187f.js +0 -2552
  27. package/dist/assets/admin-extra.5b309e5e.js +0 -2547
  28. package/dist/assets/admin-extra.7ca9c16b.js +0 -2529
  29. package/dist/assets/admin-extra.841b2bbe.js +0 -2530
  30. package/dist/assets/admin-extra.afcb3651.js +0 -2528
  31. package/dist/assets/admin.c26bb17a.css +0 -2219
  32. package/dist/assets/admin.dfeedbe4.css +0 -2229
  33. package/dist/assets/login.0bf3d739.js +0 -720
  34. package/dist/assets/login.4404e695.js +0 -720
  35. package/dist/assets/login.76c483c2.js +0 -720
  36. package/dist/assets/login.bb9f8b03.js +0 -720
  37. package/dist/assets/login.d3f05790.js +0 -720
  38. package/dist/assets/login.fa25f37a.js +0 -720
  39. package/dist/http/security-headers.d.ts +0 -38
  40. package/dist/http/security-headers.d.ts.map +0 -1
  41. package/dist/http/security-headers.js +0 -67
  42. 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"}