@arcblock/did-connect-service 4.1.41 → 4.1.43
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/dist/_generated/asset-bytes.js +1 -1
- package/dist/_generated/asset-manifest.js +2 -2
- package/dist/app-identity.d.ts +83 -11
- package/dist/app-identity.d.ts.map +1 -1
- package/dist/app-identity.js +108 -20
- package/dist/app-identity.js.map +1 -1
- package/dist/assets/{admin-extra.c7a0720f.js → admin-extra.da2c9785.js} +164 -10
- package/dist/assets/{admin.ab0009f2.css → admin.d99b416e.css} +23 -0
- package/dist/blocklet-service.d.ts +7 -0
- package/dist/blocklet-service.d.ts.map +1 -1
- package/dist/blocklet-service.js +17 -1
- package/dist/blocklet-service.js.map +1 -1
- package/dist/branding-sources.d.ts +60 -0
- package/dist/branding-sources.d.ts.map +1 -0
- package/dist/branding-sources.js +55 -0
- package/dist/branding-sources.js.map +1 -0
- package/dist/embedded.d.ts +11 -0
- package/dist/embedded.d.ts.map +1 -1
- package/dist/embedded.js +42 -32
- package/dist/embedded.js.map +1 -1
- package/dist/handlers/auth-handler.d.ts +18 -0
- package/dist/handlers/auth-handler.d.ts.map +1 -1
- package/dist/handlers/auth-handler.js +5 -0
- package/dist/handlers/auth-handler.js.map +1 -1
- package/dist/handlers/blocklet-js-handler.d.ts.map +1 -1
- package/dist/handlers/blocklet-js-handler.js +30 -18
- package/dist/handlers/blocklet-js-handler.js.map +1 -1
- package/dist/handlers/branding-handler.d.ts +67 -0
- package/dist/handlers/branding-handler.d.ts.map +1 -1
- package/dist/handlers/branding-handler.js +146 -97
- package/dist/handlers/branding-handler.js.map +1 -1
- package/dist/http/security-headers.d.ts +38 -0
- package/dist/http/security-headers.d.ts.map +1 -0
- package/dist/http/security-headers.js +67 -0
- package/dist/http/security-headers.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/locale.d.ts +4 -1
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +11 -5
- package/dist/locale.js.map +1 -1
- package/dist/logo-paths.d.ts +23 -0
- package/dist/logo-paths.d.ts.map +1 -1
- package/dist/logo-paths.js +57 -2
- package/dist/logo-paths.js.map +1 -1
- package/dist/package-branding.d.ts +95 -0
- package/dist/package-branding.d.ts.map +1 -1
- package/dist/package-branding.js +85 -4
- package/dist/package-branding.js.map +1 -1
- package/dist/pages/admin/i18n.d.ts.map +1 -1
- package/dist/pages/admin/i18n.js +32 -0
- package/dist/pages/admin/i18n.js.map +1 -1
- package/dist/pages/admin/index.d.ts.map +1 -1
- package/dist/pages/admin/index.js +44 -13
- package/dist/pages/admin/index.js.map +1 -1
- package/dist/pages/admin/styles.d.ts +1 -1
- package/dist/pages/admin/styles.d.ts.map +1 -1
- package/dist/pages/admin/styles.js +23 -0
- package/dist/pages/admin/styles.js.map +1 -1
- package/dist/pages/admin/tab-branding.d.ts.map +1 -1
- package/dist/pages/admin/tab-branding.js +180 -15
- package/dist/pages/admin/tab-branding.js.map +1 -1
- package/dist/theme-utils.d.ts +41 -0
- package/dist/theme-utils.d.ts.map +1 -1
- package/dist/theme-utils.js +124 -0
- package/dist/theme-utils.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type AppIdentity, type AppIdentityInput, type InstanceIdentityRows, type LogoType, type Origin, resolveAppIdentity, resolveAppInfo, } from "./app-identity.js";
|
|
1
|
+
export { type AppIdentity, type AppIdentityInput, type InstanceIdentityRows, LOGO_TYPES, type LogoType, logoFallbackChain, type Origin, resolveAppIdentity, resolveAppInfo, } from "./app-identity.js";
|
|
2
2
|
export { type BlockletServiceEnv, type BuildHandlerOptions, buildHandler, getOrBuildHandler, invalidateConfigCache, } from "./blocklet-service.js";
|
|
3
3
|
export { createBlockletServiceClient, getCookie } from "./blocklet-service-client.js";
|
|
4
4
|
export { BlockletServiceRPCImpl, type BlockletServiceRPCOptions } from "./blocklet-service-rpc.js";
|
|
@@ -6,7 +6,7 @@ export type { AuditLogDTO, BlockletServiceRPCInterface, CallerIdentityDTO, Creat
|
|
|
6
6
|
export { type ResolvedServiceConfig, resolveServiceConfig } from "./env-config.js";
|
|
7
7
|
export type { SessionContext } from "./identity/session-context.js";
|
|
8
8
|
export { buildSessionContext, deserializeSessionContext, serializeSessionContext, } from "./identity/session-context.js";
|
|
9
|
-
export { type AppInfo, type PackageBranding, packageBrandingCacheToken, parsePackageBrandingHeader, sanitizePackageBranding, } from "./package-branding.js";
|
|
9
|
+
export { type AppInfo, type PackageBranding, type PackagePalette, type PackageTheme, packageBrandingCacheToken, parsePackageBrandingHeader, sanitizePackageBranding, } from "./package-branding.js";
|
|
10
10
|
export type { AuthHandler, AuthHandlerOptions, RuleWithPolicyForInstance, StoredMembership, } from "./handlers/auth-handler.js";
|
|
11
11
|
export { createAuthHandler } from "./handlers/auth-handler.js";
|
|
12
12
|
export { MembershipHandler } from "./handlers/membership-handler.js";
|
|
@@ -21,7 +21,7 @@ export { LOGIN_PROVIDER } from "./constants.js";
|
|
|
21
21
|
export { AccessKeyHandler } from "./handlers/access-key-handler.js";
|
|
22
22
|
export type { BlockletJsOptions } from "./handlers/blocklet-js-handler.js";
|
|
23
23
|
export { BlockletJsHandler } from "./handlers/blocklet-js-handler.js";
|
|
24
|
-
export type { BrandingHandlerOptions } from "./handlers/branding-handler.js";
|
|
24
|
+
export type { BrandingHandlerOptions, PurgeBrandingPaths } from "./handlers/branding-handler.js";
|
|
25
25
|
export { BrandingHandler } from "./handlers/branding-handler.js";
|
|
26
26
|
export type { CimdClient, CimdDeps } from "./handlers/cimd.js";
|
|
27
27
|
export type { DIDConnectHandlerOptions } from "./handlers/did-connect-handler.js";
|
|
@@ -49,6 +49,7 @@ export { generateDelegation, resolveWalletIdentity } from "./identity/wallet-ide
|
|
|
49
49
|
export { detectLocale, detectTheme } from "./locale.js";
|
|
50
50
|
export type { BuildLoginUrlOptions } from "./login-url.js";
|
|
51
51
|
export { buildLoginUrl, CANCEL_TO_PARAM, LOGIN_PATH, RETURN_TO_PARAM, resolveSameOrigin } from "./login-url.js";
|
|
52
|
+
export { BRANDING_PUBLIC_PATHS } from "./logo-paths.js";
|
|
52
53
|
export type { AppleProviderConfig } from "./oauth-adapters/apple.js";
|
|
53
54
|
export { AppleAdapter } from "./oauth-adapters/apple.js";
|
|
54
55
|
export type { Auth0ProviderConfig } from "./oauth-adapters/auth0.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,KAAK,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACnG,YAAY,EACV,WAAW,EACX,2BAA2B,EAC3B,iBAAiB,EACjB,mBAAmB,IAAI,sBAAsB,EAC7C,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,uBAAu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,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ─── Blocklet Service (Service Binding) ─────────────────────────────
|
|
2
|
-
export { resolveAppIdentity, resolveAppInfo, } from "./app-identity.js";
|
|
2
|
+
export { LOGO_TYPES, logoFallbackChain, resolveAppIdentity, resolveAppInfo, } from "./app-identity.js";
|
|
3
3
|
export { buildHandler, getOrBuildHandler, invalidateConfigCache, } from "./blocklet-service.js";
|
|
4
4
|
export { createBlockletServiceClient, getCookie } from "./blocklet-service-client.js";
|
|
5
5
|
export { BlockletServiceRPCImpl } from "./blocklet-service-rpc.js";
|
|
@@ -36,6 +36,7 @@ export { generateDelegation, resolveWalletIdentity } from "./identity/wallet-ide
|
|
|
36
36
|
// ─── Locale ─────────────────────────────────────────────────────────
|
|
37
37
|
export { detectLocale, detectTheme } from "./locale.js";
|
|
38
38
|
export { buildLoginUrl, CANCEL_TO_PARAM, LOGIN_PATH, RETURN_TO_PARAM, resolveSameOrigin } from "./login-url.js";
|
|
39
|
+
export { BRANDING_PUBLIC_PATHS } from "./logo-paths.js";
|
|
39
40
|
export { AppleAdapter } from "./oauth-adapters/apple.js";
|
|
40
41
|
export { Auth0Adapter } from "./oauth-adapters/auth0.js";
|
|
41
42
|
export { Auth0LegacyAdapter } from "./oauth-adapters/auth0-legacy.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,EAIL,UAAU,EAEV,iBAAiB,EAEjB,kBAAkB,EAClB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,YAAY,EACZ,iBAAiB,EACjB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,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/locale.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ declare const THEMES: readonly ["dark", "light", "auto"];
|
|
|
12
12
|
type SupportedTheme = (typeof THEMES)[number];
|
|
13
13
|
/**
|
|
14
14
|
* Detect theme preference from request.
|
|
15
|
-
* Priority: ?theme= URL param > did_connect_theme cookie > 'dark'
|
|
15
|
+
* Priority: ?theme= URL param > did_connect_theme cookie > arc_mode cookie > 'dark'.
|
|
16
|
+
*
|
|
17
|
+
* `arc_mode` is the cookie arc web-device writes beside localStorage `web-mode`.
|
|
18
|
+
* It only carries `light` or `dark`. `auto` stays on `did_connect_theme`.
|
|
16
19
|
*/
|
|
17
20
|
export declare function detectTheme(request: Request): SupportedTheme;
|
|
18
21
|
export declare function detectLocale(request: Request, enabled?: readonly LocaleCode[]): SupportedLocale;
|
package/dist/locale.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAIL,KAAK,UAAU,EAGhB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC;AAkCzC,QAAA,MAAM,MAAM,oCAAqC,CAAC;AAClD,KAAK,cAAc,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAA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;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAMhH"}
|
package/dist/locale.js
CHANGED
|
@@ -45,7 +45,10 @@ function isTheme(v) {
|
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Detect theme preference from request.
|
|
48
|
-
* Priority: ?theme= URL param > did_connect_theme cookie > 'dark'
|
|
48
|
+
* Priority: ?theme= URL param > did_connect_theme cookie > arc_mode cookie > 'dark'.
|
|
49
|
+
*
|
|
50
|
+
* `arc_mode` is the cookie arc web-device writes beside localStorage `web-mode`.
|
|
51
|
+
* It only carries `light` or `dark`. `auto` stays on `did_connect_theme`.
|
|
49
52
|
*/
|
|
50
53
|
export function detectTheme(request) {
|
|
51
54
|
// 1. URL parameter (highest priority)
|
|
@@ -53,11 +56,14 @@ export function detectTheme(request) {
|
|
|
53
56
|
const themeParam = url.searchParams.get('theme');
|
|
54
57
|
if (themeParam && isTheme(themeParam))
|
|
55
58
|
return themeParam;
|
|
56
|
-
// 2. Cookie
|
|
57
59
|
const cookie = request.headers.get('Cookie') ?? '';
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
60
|
+
const didTheme = parseCookie(cookie, 'did_connect_theme');
|
|
61
|
+
if (didTheme && isTheme(didTheme))
|
|
62
|
+
return didTheme;
|
|
63
|
+
// arc web-device's SSR cookie. Absent did_connect_theme should still follow it.
|
|
64
|
+
const arcMode = parseCookie(cookie, 'arc_mode');
|
|
65
|
+
if (arcMode === 'light' || arcMode === 'dark')
|
|
66
|
+
return arcMode;
|
|
61
67
|
return 'dark';
|
|
62
68
|
}
|
|
63
69
|
export function detectLocale(request, enabled) {
|
package/dist/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../src/locale.ts"],"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C,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IACjE,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/logo-paths.d.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* The logo URL contract shared by BrandingHandler (which serves these paths)
|
|
3
3
|
* and the admin console (which renders them).
|
|
4
4
|
*
|
|
5
|
+
* It is also the home of {@link BRANDING_PUBLIC_PATHS}, the one list of public
|
|
6
|
+
* branding paths that both routing and host-side cache purges read.
|
|
7
|
+
*
|
|
5
8
|
* Dependency-free on purpose: the admin page modules that import it are loaded
|
|
6
9
|
* by `build-assets.mjs` in plain Node, so nothing here may drag in a handler,
|
|
7
10
|
* a store, or a Workers-only binding.
|
|
@@ -34,6 +37,26 @@ export declare const LOGO_PREVIEW_BASE = "/.well-known/service/blocklet/logo-pre
|
|
|
34
37
|
* is a 404, never a fall-through to some other type's bytes).
|
|
35
38
|
*/
|
|
36
39
|
export declare function previewLogoType(pathname: string): string | null;
|
|
40
|
+
/**
|
|
41
|
+
* The public OG card. Branding-derived (name, description, logo, og-image
|
|
42
|
+
* background) and publicly cacheable, so it belongs to the purge set; served by
|
|
43
|
+
* the OG renderer rather than as a stored logo, hence not a logo route.
|
|
44
|
+
*/
|
|
45
|
+
export declare const OG_PNG_PATH = "/.well-known/service/blocklet/og.png";
|
|
46
|
+
/**
|
|
47
|
+
* Every public, cacheable path whose bytes derive from an instance's branding —
|
|
48
|
+
* the single list a host purges after branding changes (a release, or an admin
|
|
49
|
+
* save via the `purgeBrandingPaths` hook) and the list `fetchPublic` routes.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately excluded:
|
|
52
|
+
* - `logo-preview/*` ({@link LOGO_PREVIEW_BASE}) — `no-store`, cached by nothing,
|
|
53
|
+
* so there is nothing to purge; it is the admin console's cache-proof view.
|
|
54
|
+
* - `theme/styles.css`, `theme/init.js` — derived from `app:theme`, not branding,
|
|
55
|
+
* and served with a 60s max-age.
|
|
56
|
+
*/
|
|
57
|
+
export declare const BRANDING_PUBLIC_PATHS: readonly string[];
|
|
58
|
+
/** The logo type a canonical public logo path serves, or null when it is not one. */
|
|
59
|
+
export declare function publicLogoType(pathname: string): string | null;
|
|
37
60
|
/** Cache policy for the canonical logo paths — short, so branding changes reflect quickly. */
|
|
38
61
|
export declare const LOGO_CACHE_CONTROL = "public, max-age=300";
|
|
39
62
|
/** Cache policy for the preview alias — stored by nothing, anywhere. */
|
package/dist/logo-paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo-paths.d.ts","sourceRoot":"","sources":["../src/logo-paths.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logo-paths.d.ts","sourceRoot":"","sources":["../src/logo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB,+CAA+C,CAAC;AA2B9E;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI/D;AA8BD;;;;GAIG;AACH,eAAO,MAAM,WAAW,yCAAyC,CAAC;AAElE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAGjD,CAAC;AAEH,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AAExD,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,wBAAwB,CAAC"}
|
package/dist/logo-paths.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* The logo URL contract shared by BrandingHandler (which serves these paths)
|
|
3
3
|
* and the admin console (which renders them).
|
|
4
4
|
*
|
|
5
|
+
* It is also the home of {@link BRANDING_PUBLIC_PATHS}, the one list of public
|
|
6
|
+
* branding paths that both routing and host-side cache purges read.
|
|
7
|
+
*
|
|
5
8
|
* Dependency-free on purpose: the admin page modules that import it are loaded
|
|
6
9
|
* by `build-assets.mjs` in plain Node, so nothing here may drag in a handler,
|
|
7
10
|
* a store, or a Workers-only binding.
|
|
@@ -30,8 +33,8 @@
|
|
|
30
33
|
export const LOGO_PREVIEW_BASE = "/.well-known/service/blocklet/logo-preview";
|
|
31
34
|
/**
|
|
32
35
|
* Matched positionally rather than as a full prefix, so a prefixed mount still
|
|
33
|
-
* resolves
|
|
34
|
-
*
|
|
36
|
+
* resolves the type. (`fetchPublic` itself only routes the full
|
|
37
|
+
* {@link LOGO_PREVIEW_BASE} prefix.)
|
|
35
38
|
*/
|
|
36
39
|
const LOGO_PREVIEW_SEGMENT = "/logo-preview/";
|
|
37
40
|
/**
|
|
@@ -62,6 +65,58 @@ export function previewLogoType(pathname) {
|
|
|
62
65
|
return null;
|
|
63
66
|
return PREVIEW_LOGO_TYPES.get(pathname.slice(at + LOGO_PREVIEW_SEGMENT.length)) ?? null;
|
|
64
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* The canonical public logo routes, keyed by exact pathname → logo type.
|
|
70
|
+
*
|
|
71
|
+
* This table IS the router: `BrandingHandler.fetchPublic` matches a public logo
|
|
72
|
+
* request only by looking its pathname up here, and `resolveLogoType` reads the
|
|
73
|
+
* type from here. {@link BRANDING_PUBLIC_PATHS} is projected from the same table,
|
|
74
|
+
* so a logo type added here is served AND listed for purge in one edit — the two
|
|
75
|
+
* can never drift apart (EPIC arc#7073 red line 5; the hand-maintained-twice
|
|
76
|
+
* failure mode is the one `isMutableSiteArtifactPath` in arc records, where
|
|
77
|
+
* arc#3336's shard path was silently missed).
|
|
78
|
+
*
|
|
79
|
+
* Exact pathnames, never prefixes: a prefix would let the purge list and the
|
|
80
|
+
* router disagree about what "a logo path" is.
|
|
81
|
+
*/
|
|
82
|
+
const PUBLIC_LOGO_ROUTES = new Map([
|
|
83
|
+
["/favicon.ico", "favicon"],
|
|
84
|
+
["/.well-known/service/blocklet/logo", "square"],
|
|
85
|
+
["/.well-known/service/blocklet/logo-dark", "squareDark"],
|
|
86
|
+
["/.well-known/service/blocklet/logo-rect", "rect"],
|
|
87
|
+
["/.well-known/service/blocklet/logo-rect-dark", "rectDark"],
|
|
88
|
+
["/.well-known/service/blocklet/logo-favicon", "favicon"],
|
|
89
|
+
// alias added for blocklet-server parity
|
|
90
|
+
["/.well-known/service/blocklet/favicon", "favicon"],
|
|
91
|
+
["/.well-known/service/blocklet/splash/portrait", "splashPortrait"],
|
|
92
|
+
["/.well-known/service/blocklet/splash/landscape", "splashLandscape"],
|
|
93
|
+
["/.well-known/service/blocklet/og-image", "ogImage"],
|
|
94
|
+
]);
|
|
95
|
+
/**
|
|
96
|
+
* The public OG card. Branding-derived (name, description, logo, og-image
|
|
97
|
+
* background) and publicly cacheable, so it belongs to the purge set; served by
|
|
98
|
+
* the OG renderer rather than as a stored logo, hence not a logo route.
|
|
99
|
+
*/
|
|
100
|
+
export const OG_PNG_PATH = "/.well-known/service/blocklet/og.png";
|
|
101
|
+
/**
|
|
102
|
+
* Every public, cacheable path whose bytes derive from an instance's branding —
|
|
103
|
+
* the single list a host purges after branding changes (a release, or an admin
|
|
104
|
+
* save via the `purgeBrandingPaths` hook) and the list `fetchPublic` routes.
|
|
105
|
+
*
|
|
106
|
+
* Deliberately excluded:
|
|
107
|
+
* - `logo-preview/*` ({@link LOGO_PREVIEW_BASE}) — `no-store`, cached by nothing,
|
|
108
|
+
* so there is nothing to purge; it is the admin console's cache-proof view.
|
|
109
|
+
* - `theme/styles.css`, `theme/init.js` — derived from `app:theme`, not branding,
|
|
110
|
+
* and served with a 60s max-age.
|
|
111
|
+
*/
|
|
112
|
+
export const BRANDING_PUBLIC_PATHS = Object.freeze([
|
|
113
|
+
...PUBLIC_LOGO_ROUTES.keys(),
|
|
114
|
+
OG_PNG_PATH,
|
|
115
|
+
]);
|
|
116
|
+
/** The logo type a canonical public logo path serves, or null when it is not one. */
|
|
117
|
+
export function publicLogoType(pathname) {
|
|
118
|
+
return PUBLIC_LOGO_ROUTES.get(pathname) ?? null;
|
|
119
|
+
}
|
|
65
120
|
/** Cache policy for the canonical logo paths — short, so branding changes reflect quickly. */
|
|
66
121
|
export const LOGO_CACHE_CONTROL = "public, max-age=300";
|
|
67
122
|
/** Cache policy for the preview alias — stored by nothing, anywhere. */
|
package/dist/logo-paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo-paths.js","sourceRoot":"","sources":["../src/logo-paths.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logo-paths.js","sourceRoot":"","sources":["../src/logo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,4CAA4C,CAAC;AAE9E;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAiB;IACjD,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,WAAW,EAAE,UAAU,CAAC;IACzB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,UAAU,EAAE,SAAS,CAAC;IACvB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC;IACrC,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;CACxC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClD,IAAI,EAAE,KAAK,CAAC,CAAC;QAAE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|
|
3
|
+
* palette preset (arc#7078). Every field is optional; whatever is absent is completed
|
|
4
|
+
* from the built-in defaults by `formatThemeForOutput`'s deep merge.
|
|
5
|
+
*/
|
|
6
|
+
export interface PackagePalette {
|
|
7
|
+
primary?: {
|
|
8
|
+
main?: string;
|
|
9
|
+
contrastText?: string;
|
|
10
|
+
};
|
|
11
|
+
background?: {
|
|
12
|
+
default?: string;
|
|
13
|
+
paper?: string;
|
|
14
|
+
};
|
|
15
|
+
text?: {
|
|
16
|
+
primary?: string;
|
|
17
|
+
secondary?: string;
|
|
18
|
+
};
|
|
19
|
+
divider?: string;
|
|
20
|
+
success?: {
|
|
21
|
+
main?: string;
|
|
22
|
+
};
|
|
23
|
+
error?: {
|
|
24
|
+
main?: string;
|
|
25
|
+
};
|
|
26
|
+
warning?: {
|
|
27
|
+
main?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface PackageTheme {
|
|
31
|
+
light?: PackagePalette;
|
|
32
|
+
dark?: PackagePalette;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Host-supplied package identity — the `x-arc-pkg-branding` header on Workers
|
|
36
|
+
* (base64url, no padding, of UTF-8 JSON), or the same object in-process on the
|
|
37
|
+
* embedded (Node) host. connect-service never reads the package itself
|
|
38
|
+
* (ArcBlock/arc#7073 red line 1); the host projects it into exactly this shape.
|
|
39
|
+
*
|
|
40
|
+
* Wire shape (pinned by test/package-branding-wire.test.ts — arc encodes to it):
|
|
41
|
+
*
|
|
42
|
+
* ```jsonc
|
|
43
|
+
* {
|
|
44
|
+
* "name": "Market Pulse", // ≤ 256 UTF-8 bytes
|
|
45
|
+
* "description": "Real-time dashboard.", // ≤ 2048 UTF-8 bytes
|
|
46
|
+
* "logo": { "v": "3f9a0c1d2e4b5a67" }, // exactly 16 chars [A-Za-z0-9_-]: the first 16
|
|
47
|
+
* // chars of a content hash of the logo bytes
|
|
48
|
+
* // (red line 4). No path, no slot list.
|
|
49
|
+
* "theme": {
|
|
50
|
+
* "light": { // partial MUI palette; each key optional
|
|
51
|
+
* "primary": { "main": "#8a6208", "contrastText": "#fef7e5" },
|
|
52
|
+
* "background": { "default": "#f5f3ef", "paper": "#fefdfb" },
|
|
53
|
+
* "text": { "primary": "#2c2418", "secondary": "#736756" },
|
|
54
|
+
* "divider": "#e0dcd4",
|
|
55
|
+
* "success": { "main": "#4d8a30" },
|
|
56
|
+
* "error": { "main": "#c53030" },
|
|
57
|
+
* "warning": { "main": "#a16207" }
|
|
58
|
+
* },
|
|
59
|
+
* "dark": { ...same keys... }
|
|
60
|
+
* },
|
|
61
|
+
* "passportColor": "#8a6208" // #rrggbb only (the OG gradient parses 6-hex)
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* Colors: `#rgb`/`#rgba`/`#rrggbb`/`#rrggbbaa`, or `rgb()`/`rgba()`/`hsl()`/`hsla()` with
|
|
66
|
+
* 3–4 comma-separated numeric arguments (`12`, `12.5`, `.5`, optional `%`; literal ASCII
|
|
67
|
+
* spaces only) — what MUI's `decomposeColor` accepts, and a subset of the character
|
|
68
|
+
* whitelist `serveThemeStyles` applies — at most 64 UTF-8 bytes. In every group whose
|
|
69
|
+
* `main` the package sets (primary / success / error / warning), the default
|
|
70
|
+
* `light` / `dark` / `contrastText` are dropped so MUI derives them from that `main`
|
|
71
|
+
* (`contrastText` is kept when the package sends one).
|
|
72
|
+
*
|
|
73
|
+
* Trust boundary: this is an INTERNAL header. connect-service trusts it as the package's
|
|
74
|
+
* own declaration, so it must only be set by a host that first deletes any
|
|
75
|
+
* client-supplied `x-arc-pkg-branding` from the incoming request (arc-worker does:
|
|
76
|
+
* `handle-fetch.ts` deletes then re-injects it). A host that forwards client headers
|
|
77
|
+
* unfiltered must not use `parsePackageBrandingHeader` — a client could otherwise set
|
|
78
|
+
* any app's name, palette and passportColor on its own responses and on shared caches.
|
|
79
|
+
*
|
|
80
|
+
* Degradation: `name` / `description` keep their all-or-nothing rule (a wrong type or an
|
|
81
|
+
* over-limit value, or a dangerous / accessor top-level key, discards the whole object).
|
|
82
|
+
* The newer parts degrade individually: an invalid `logo` or `passportColor` is dropped on
|
|
83
|
+
* its own, and inside `theme` each invalid color is dropped on its own (a group or mode
|
|
84
|
+
* left empty disappears); unknown keys are ignored. None of them ever takes `name` /
|
|
85
|
+
* `description` down.
|
|
86
|
+
*/
|
|
1
87
|
export interface PackageBranding {
|
|
2
88
|
name?: string;
|
|
3
89
|
description?: string;
|
|
90
|
+
logo?: {
|
|
91
|
+
v: string;
|
|
92
|
+
};
|
|
93
|
+
theme?: PackageTheme;
|
|
94
|
+
passportColor?: string;
|
|
4
95
|
}
|
|
5
96
|
export interface AppInfo extends PackageBranding {
|
|
6
97
|
name: string;
|
|
7
98
|
icon?: string;
|
|
8
99
|
}
|
|
9
100
|
export declare function sanitizePackageBranding(value: unknown): PackageBranding | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Decode `x-arc-pkg-branding`. Call ONLY with a value the host itself injected after
|
|
103
|
+
* deleting any client-supplied copy — see the trust boundary on {@link PackageBranding}.
|
|
104
|
+
*/
|
|
10
105
|
export declare function parsePackageBrandingHeader(value: string | null | undefined): PackageBranding | undefined;
|
|
11
106
|
export declare function packageBrandingCacheToken(value: unknown): string;
|
|
12
107
|
//# sourceMappingURL=package-branding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-branding.d.ts","sourceRoot":"","sources":["../src/package-branding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-branding.d.ts","sourceRoot":"","sources":["../src/package-branding.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,UAAU,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,K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 +1,4 @@
|
|
|
1
|
+
import { isPackageThemeColor } from "./theme-utils.js";
|
|
1
2
|
const HEADER_MAX_BYTES = 4096;
|
|
2
3
|
const JSON_MAX_BYTES = 3072;
|
|
3
4
|
const NAME_MAX_BYTES = 256;
|
|
@@ -22,12 +23,85 @@ export function sanitizePackageBranding(value) {
|
|
|
22
23
|
return undefined;
|
|
23
24
|
result[key] = descriptor.value;
|
|
24
25
|
}
|
|
26
|
+
const logo = sanitizeLogo(dataValue(descriptors.logo));
|
|
27
|
+
if (logo)
|
|
28
|
+
result.logo = logo;
|
|
29
|
+
const theme = sanitizeTheme(dataValue(descriptors.theme));
|
|
30
|
+
if (theme)
|
|
31
|
+
result.theme = theme;
|
|
32
|
+
const passportColor = dataValue(descriptors.passportColor);
|
|
33
|
+
if (typeof passportColor === "string" && PASSPORT_COLOR.test(passportColor))
|
|
34
|
+
result.passportColor = passportColor;
|
|
25
35
|
return result;
|
|
26
36
|
}
|
|
27
37
|
catch {
|
|
28
38
|
return undefined;
|
|
29
39
|
}
|
|
30
40
|
}
|
|
41
|
+
// ─── The newer parts: each degrades on its own ────────────────────────────
|
|
42
|
+
const LOGO_VERSION = /^[A-Za-z0-9_-]{16}$/;
|
|
43
|
+
const PASSPORT_COLOR = /^#[0-9a-fA-F]{6}$/;
|
|
44
|
+
/** The palette keys the wire carries, in canonical order. `null` = a bare color. */
|
|
45
|
+
const PALETTE_SCHEMA = [
|
|
46
|
+
["primary", ["main", "contrastText"]],
|
|
47
|
+
["background", ["default", "paper"]],
|
|
48
|
+
["text", ["primary", "secondary"]],
|
|
49
|
+
["divider", null],
|
|
50
|
+
["success", ["main"]],
|
|
51
|
+
["error", ["main"]],
|
|
52
|
+
["warning", ["main"]],
|
|
53
|
+
];
|
|
54
|
+
function isPlainObject(value) {
|
|
55
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56
|
+
}
|
|
57
|
+
/** A descriptor's value only when it is a data property (never runs a getter). */
|
|
58
|
+
function dataValue(descriptor) {
|
|
59
|
+
return descriptor && "value" in descriptor ? descriptor.value : undefined;
|
|
60
|
+
}
|
|
61
|
+
/** An own data property of a plain object; anything else (accessor, throw) → undefined. */
|
|
62
|
+
function ownData(object, key) {
|
|
63
|
+
if (!isPlainObject(object))
|
|
64
|
+
return undefined;
|
|
65
|
+
try {
|
|
66
|
+
return dataValue(Object.getOwnPropertyDescriptor(object, key));
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function sanitizeLogo(value) {
|
|
73
|
+
const v = ownData(value, "v");
|
|
74
|
+
return typeof v === "string" && LOGO_VERSION.test(v) ? { v } : undefined;
|
|
75
|
+
}
|
|
76
|
+
function sanitizePalette(value) {
|
|
77
|
+
const palette = {};
|
|
78
|
+
for (const [group, keys] of PALETTE_SCHEMA) {
|
|
79
|
+
const raw = ownData(value, group);
|
|
80
|
+
if (keys === null) {
|
|
81
|
+
if (isPackageThemeColor(raw))
|
|
82
|
+
palette[group] = raw;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const colors = {};
|
|
86
|
+
for (const key of keys) {
|
|
87
|
+
const color = ownData(raw, key);
|
|
88
|
+
if (isPackageThemeColor(color))
|
|
89
|
+
colors[key] = color;
|
|
90
|
+
}
|
|
91
|
+
if (Object.keys(colors).length > 0)
|
|
92
|
+
palette[group] = colors;
|
|
93
|
+
}
|
|
94
|
+
return Object.keys(palette).length > 0 ? palette : undefined;
|
|
95
|
+
}
|
|
96
|
+
function sanitizeTheme(value) {
|
|
97
|
+
const theme = {};
|
|
98
|
+
for (const mode of ["light", "dark"]) {
|
|
99
|
+
const palette = sanitizePalette(ownData(value, mode));
|
|
100
|
+
if (palette)
|
|
101
|
+
theme[mode] = palette;
|
|
102
|
+
}
|
|
103
|
+
return theme.light || theme.dark ? theme : undefined;
|
|
104
|
+
}
|
|
31
105
|
function decodeBase64Url(value) {
|
|
32
106
|
if (!value || value.length > HEADER_MAX_BYTES || !/^[A-Za-z0-9_-]+$/.test(value))
|
|
33
107
|
return undefined;
|
|
@@ -44,6 +118,10 @@ function decodeBase64Url(value) {
|
|
|
44
118
|
return undefined;
|
|
45
119
|
}
|
|
46
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Decode `x-arc-pkg-branding`. Call ONLY with a value the host itself injected after
|
|
123
|
+
* deleting any client-supplied copy — see the trust boundary on {@link PackageBranding}.
|
|
124
|
+
*/
|
|
47
125
|
export function parsePackageBrandingHeader(value) {
|
|
48
126
|
if (value == null)
|
|
49
127
|
return undefined;
|
|
@@ -62,10 +140,13 @@ export function packageBrandingCacheToken(value) {
|
|
|
62
140
|
const branding = sanitizePackageBranding(value);
|
|
63
141
|
if (!branding)
|
|
64
142
|
return "-1:";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
143
|
+
// `sanitizePackageBranding` rebuilds every part in a fixed key order, so its JSON is
|
|
144
|
+
// canonical. It covers name/description AND logo.v / theme / passportColor: this
|
|
145
|
+
// token keys the CF `getOrBuildHandler` cache, the embedded `brandedHandlers` map
|
|
146
|
+
// and (through those handlers) `BrandingHandler._themeCache` — a part missing here
|
|
147
|
+
// would let two tenants share a handler and serve each other's logo or palette.
|
|
148
|
+
// Branding with only name/description yields the same bytes as before S5.
|
|
149
|
+
const canonical = JSON.stringify(branding);
|
|
69
150
|
return `${encoder.encode(canonical).byteLength}:${canonical}`;
|
|
70
151
|
}
|
|
71
152
|
// `resolveAppInfo` moved to app-identity.ts (did#247) — it is now a view over
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-branding.js","sourceRoot":"","sources":["../src/package-branding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-branding.js","sourceRoot":"","sources":["../src/package-branding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAwFvD,MAAM,gBAAgB,GAAG,IAAI,C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