@zitadel/config 1.0.0-alpha.23 → 1.0.0-alpha.25
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/defaults/README-branding.md +26 -34
- package/defaults/branding/centered/login.liquid +31 -11
- package/defaults/branding/minimal/login.liquid +30 -10
- package/dist/branding-contrast.d.mts +28 -21
- package/dist/branding-contrast.d.mts.map +1 -1
- package/dist/branding-contrast.mjs +1 -1
- package/dist/branding-contrast.mjs.map +1 -1
- package/dist/branding-url.d.mts +1 -2
- package/dist/branding-url.d.mts.map +1 -1
- package/dist/branding-url.mjs.map +1 -1
- package/dist/css-color.d.mts +5 -10
- package/dist/css-color.d.mts.map +1 -1
- package/dist/css-color.mjs +1 -1
- package/dist/css-color.mjs.map +1 -1
- package/dist/{defaults-BxGCGdqS.d.mts → defaults-BtKIcWxW.d.mts} +21 -14
- package/dist/defaults-BtKIcWxW.d.mts.map +1 -0
- package/dist/{defaults-DV6hY2KT.mjs → defaults-COLBFU3S.mjs} +17 -18
- package/dist/defaults-COLBFU3S.mjs.map +1 -0
- package/dist/defaults.d.mts +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/idp/index.d.mts +2 -0
- package/dist/idp/index.mjs +2 -0
- package/dist/idp-ByzXQN85.mjs +207 -0
- package/dist/idp-ByzXQN85.mjs.map +1 -0
- package/dist/idp-connection-CHxGm1Wr.mjs +324 -0
- package/dist/idp-connection-CHxGm1Wr.mjs.map +1 -0
- package/dist/index-Cuxu-zQD.d.mts +210 -0
- package/dist/index-Cuxu-zQD.d.mts.map +1 -0
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +5 -4
- package/dist/{meta-schemas-OowgSUfU.mjs → meta-schemas-C03zgFux.mjs} +36 -333
- package/dist/meta-schemas-C03zgFux.mjs.map +1 -0
- package/dist/meta-schemas.d.mts +5 -6
- package/dist/meta-schemas.d.mts.map +1 -1
- package/dist/meta-schemas.mjs +1 -1
- package/dist/normalize.d.mts +3 -4
- package/dist/normalize.d.mts.map +1 -1
- package/dist/normalize.mjs.map +1 -1
- package/dist/{schemas-7oNU25Qz.mjs → schemas-CUU4Rf8J.mjs} +11 -4
- package/dist/schemas-CUU4Rf8J.mjs.map +1 -0
- package/dist/schemas.d.mts +361 -9
- package/dist/schemas.d.mts.map +1 -1
- package/dist/schemas.mjs +2 -2
- package/dist/template.d.mts +9 -10
- package/dist/template.d.mts.map +1 -1
- package/dist/template.mjs +1 -1
- package/dist/template.mjs.map +1 -1
- package/dist/validate.d.mts +15 -13
- package/dist/validate.d.mts.map +1 -1
- package/dist/validate.mjs +28 -18
- package/dist/validate.mjs.map +1 -1
- package/meta-schemas/branding.json +5 -5
- package/meta-schemas/flow-definition.json +81 -6
- package/meta-schemas/idp-connection.json +6 -6
- package/package.json +18 -8
- package/defaults/branding/hero/login.liquid +0 -238
- package/defaults/branding/split/login.liquid +0 -197
- package/defaults/branding/split-right/login.liquid +0 -197
- package/dist/defaults-BxGCGdqS.d.mts.map +0 -1
- package/dist/defaults-DV6hY2KT.mjs.map +0 -1
- package/dist/meta-schemas-OowgSUfU.mjs.map +0 -1
- package/dist/schemas-7oNU25Qz.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas-CUU4Rf8J.mjs","names":[],"sources":["../src/branding-css.ts","../src/schemas.ts"],"sourcesContent":["/**\n * Mirror of the server's appearance-value gates\n * (`internal/domain/branding_css.go`), so `plan` rejects what `apply` would.\n *\n * The widget writes these values straight into a CSS declaration, so a value\n * able to close its own declaration can emit rules of its own. Both gates are\n * allowlists: a value is accepted only when it matches a form we recognise,\n * never merely because it avoided the characters someone thought to ban.\n */\n\nexport const MAX_BRANDING_COLOR_LENGTH = 128;\nexport const MAX_BRANDING_FONT_FAMILY_LENGTH = 256;\n/** Asset URL cap in UTF-8 bytes, like the server's `MaxBrandingURLBytes`. */\nexport const MAX_BRANDING_URL_BYTES = 2048;\n\nconst HEX_COLOR = /^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;\n\n/** `url` is absent by construction: it is not a colour function. */\nconst COLOR_FUNCTIONS = new Set([\n \"rgb\",\n \"rgba\",\n \"hsl\",\n \"hsla\",\n \"hwb\",\n \"lab\",\n \"lch\",\n \"oklab\",\n \"oklch\",\n \"color\",\n \"color-mix\",\n]);\n\nconst COLOR_ARGS = /^[0-9a-zA-Z%.,+\\-/ ()#]*$/;\n/**\n * A bare colour name. Which names CSS knows is the browser's business: an\n * unknown one paints nothing, and every name of this shape is inert inside a\n * declaration whatever it spells.\n */\nconst COLOR_NAME = /^[a-zA-Z]{3,24}$/;\nconst FONT_IDENT = /^[A-Za-z0-9_-]+( [A-Za-z0-9_-]+)*$/;\n\nfunction isColorFunction(value: string): boolean {\n const open = value.indexOf(\"(\");\n if (open <= 0 || !value.endsWith(\")\")) return false;\n if (!COLOR_FUNCTIONS.has(value.slice(0, open))) return false;\n\n const args = value.slice(open + 1, -1);\n if (!COLOR_ARGS.test(args)) return false;\n\n // Nesting is legal (`color-mix(in srgb, rgb(1 2 3), red)`), so the\n // parentheses only have to balance, at a bounded depth.\n let depth = 0;\n for (const char of args) {\n if (char === \"(\") {\n depth += 1;\n if (depth > 4) return false;\n } else if (char === \")\") {\n depth -= 1;\n if (depth < 0) return false;\n }\n }\n return depth === 0;\n}\n\n/** Whether a value is hex, a CSS colour name, or a colour function. */\nexport function isBrandingColor(value: string): boolean {\n if (value.length > MAX_BRANDING_COLOR_LENGTH) return false;\n if (value.trim() === \"\") return false;\n // Not trimmed: the value is stored and painted verbatim.\n if (HEX_COLOR.test(value)) return true;\n return COLOR_NAME.test(value) || isColorFunction(value.toLowerCase());\n}\n\n/** Whether a value is a CSS font stack of identifiers and quoted names. */\nexport function isBrandingFontFamily(value: string): boolean {\n if (value.length > MAX_BRANDING_FONT_FAMILY_LENGTH) return false;\n if (value.trim() === \"\") return false;\n return value.split(\",\").every((family) => isFontName(trimSpaces(family)));\n}\n\n/** Spaces around a comma are ordinary; other whitespace is not a separator. */\nfunction trimSpaces(value: string): string {\n return value.replace(/^ +/, \"\").replace(/ +$/, \"\");\n}\n\nfunction isFontName(family: string): boolean {\n if (family === \"\") return false;\n const quote = family[0];\n if (quote === '\"' || quote === \"'\") {\n // A quoted name ends at its matching quote and holds no other, so it\n // cannot leave the string it opened.\n if (family.length < 2 || family.at(-1) !== quote) return false;\n const inner = family.slice(1, -1);\n return !inner.includes(quote) && !/[\\\\;{}]/.test(inner);\n }\n return FONT_IDENT.test(family);\n}\n","import {\n CreateBrandingBody,\n CreateFlowDefinitionBody,\n CreateIdpBody,\n CreateSchemaBody,\n} from \"@zitadel/api/generated/endpoints/zitadelNextGen.zod\";\nimport { z } from \"zod\";\n\nimport { isBrandingColor, isBrandingFontFamily, MAX_BRANDING_URL_BYTES } from \"./branding-css.js\";\nimport { isCanonicalLoopbackHttpUrl } from \"./branding-url.js\";\n\nexport const schemaConfigSchema = CreateSchemaBody;\nexport const flowConfigSchema = CreateFlowDefinitionBody.shape.flow_definition;\nexport const createFlowDefinitionRequestSchema = CreateFlowDefinitionBody;\n\n/**\n * One `.zitadel/idps/<slug>.json` body: the connection document `POST /idps`\n * carries under `idp`. The generated Zod enforces the contract the meta-schema\n * states, including that `client_secret` is a `${{ NAME }}` reference and\n * never a literal.\n */\nexport const idpConnectionConfigSchema = CreateIdpBody.shape.idp;\n\n/** The wire shape of a branding revision (`POST /branding` request body). */\nexport const brandingWireSchema = CreateBrandingBody;\n\n/**\n * `{ \"$file\": \"<path>\" }`, which a `.zitadel/` file may hold in place of a\n * string field the OpenAPI YAML marks `x-local: file`. The path is relative to\n * the file holding it; the CLI inlines the content before publishing.\n */\nexport const localFileReferenceSchema = z.strictObject({ $file: z.string().min(1) });\n\n/**\n * The local `.zitadel/branding/*.json` dialect: the wire shape, where\n * `liquid_template` may also be a `$file` reference to the sibling `.liquid`\n * template (the meta-schema `branding.json` mirrors this).\n */\nexport const brandingConfigSchema = z\n .strictObject({\n // Strict, unlike the generated wire schema: a typo like `hero_urll`\n // must fail plan, not silently pass, get ignored by the server, and\n // vanish on canonical write-back. The editor meta-schema already\n // rejects unknown keys; the CLI gate has to agree.\n ...CreateBrandingBody.shape,\n // Raw strings instead of the generated uri fields: those trim and\n // normalize before refinement runs, hiding exactly the forms the wire\n // body still carries verbatim and Go's url.Parse rejects.\n logo_url: z.string().optional(),\n hero_url: z.string().optional(),\n $schema: z.string().optional(),\n liquid_template: z\n .union([CreateBrandingBody.shape.liquid_template.unwrap(), localFileReferenceSchema])\n .optional(),\n })\n .superRefine((value, ctx) => {\n // A stylesheet alone names no face to render in, so the server rejects the\n // pair as a pair (validateBrandingFontURL in\n // internal/domain/branding_validator.go). plan has to agree, or apply\n // fails after schemas and flows have already been written.\n validateBrandingAssetUrl(value.typography?.font_url, \"typography.font_url\", ctx, {\n loopback: false,\n });\n if (value.typography?.font_url !== undefined && value.typography.font_family === undefined) {\n ctx.addIssue({\n code: \"custom\",\n message:\n \"typography.font_url needs a typography.font_family to load; a stylesheet alone names no face to render in.\",\n });\n }\n // Mirror the server's asset URL gate (validateBrandingAssetURL in\n // internal/domain/branding_validator.go) so plan rejects what apply would.\n // Apply mutates schemas and flows before branding, so a late 400 here would\n // leave a half-applied run.\n validateBrandingAssetUrl(value.logo_url, \"logo_url\", ctx);\n validateBrandingAssetUrl(value.hero_url, \"hero_url\", ctx);\n validateBrandingAssetUrl(value.theme?.light?.logo_url, \"theme.light.logo_url\", ctx);\n validateBrandingAssetUrl(value.theme?.dark?.logo_url, \"theme.dark.logo_url\", ctx);\n // The appearance values land in a CSS declaration, so the server stores\n // only forms it recognises (ValidateBrandingColor / ValidateBrandingFontFamily\n // in internal/domain/branding_css.go).\n validateBrandingPalette(value.theme?.light?.palette, \"theme.light\", ctx);\n validateBrandingPalette(value.theme?.dark?.palette, \"theme.dark\", ctx);\n if (\n value.typography?.font_family !== undefined &&\n !isBrandingFontFamily(value.typography.font_family)\n ) {\n ctx.addIssue({\n code: \"custom\",\n message:\n 'typography.font_family must be comma-separated font names, each an identifier (Inter, ui-sans-serif) or a quoted name (\"APK Futural\").',\n });\n }\n });\n\nfunction validateBrandingPalette(\n palette: Record<string, unknown> | undefined,\n side: string,\n ctx: z.RefinementCtx,\n): void {\n if (!palette) {\n return;\n }\n for (const [key, colour] of Object.entries(palette)) {\n // A non-string never reaches here: the generated object schema types every\n // palette value as a string, and Zod skips refinements once the base parse\n // has failed. The check is what narrows `unknown` for the call below.\n if (typeof colour !== \"string\") {\n continue;\n }\n if (isBrandingColor(colour)) {\n continue;\n }\n ctx.addIssue({\n code: \"custom\",\n message: `${side}.palette.${key} must be hex (#4F46E5), a CSS colour name, or a colour function such as rgb(), hsl() or oklch().`,\n });\n }\n}\n\nfunction validateBrandingAssetUrl(\n value: string | undefined,\n field: string,\n ctx: z.RefinementCtx,\n options: { loopback?: boolean } = {},\n): void {\n if (value === undefined || value === \"\") {\n return;\n }\n // The server counts bytes (validateBrandingAssetURL), so a URL with\n // non-ASCII characters can be short in characters and still too long.\n if (new TextEncoder().encode(value).length > MAX_BRANDING_URL_BYTES) {\n ctx.addIssue({\n code: \"custom\",\n message: `${field} must be at most ${MAX_BRANDING_URL_BYTES} bytes.`,\n });\n return;\n }\n // Stricter-or-equal than the Go gate (validateBrandingAssetURL): the WHATWG\n // parser forgives what Go's url.Parse rejects — `https:example.com`,\n // backslashes, and whitespace all get silently normalized. plan must never\n // accept what apply would reject (the reverse is harmless), so reject the\n // raw forms before parsing.\n if (/[\\s\\\\]/.test(value)) {\n ctx.addIssue({ code: \"custom\", message: `${field} is not a valid URL.` });\n return;\n }\n if (!/^https?:\\/\\//i.test(value)) {\n ctx.addIssue({ code: \"custom\", message: `${field} must be an absolute https URL.` });\n return;\n }\n let parsed: URL;\n try {\n parsed = new URL(value);\n } catch {\n ctx.addIssue({ code: \"custom\", message: `${field} is not a valid URL.` });\n return;\n }\n // Fetched by every visitor's browser, so userinfo in it is a credential in\n // every access log — the server refuses it and so must plan.\n if (parsed.username !== \"\" || parsed.password !== \"\") {\n ctx.addIssue({\n code: \"custom\",\n message: `${field} must not carry credentials; the URL is fetched by every visitor's browser.`,\n });\n return;\n }\n // Loopback HTTP is the dev-posture carve-out (assets served from the app's\n // own dev server), and it covers images only: a stylesheet is styling rather\n // than an image, so it stays https everywhere. Check the raw URL so WHATWG\n // normalisation cannot make plan accept a host spelling that the Go save\n // gate rejects.\n if (\n options.loopback !== false &&\n parsed.protocol === \"http:\" &&\n isCanonicalLoopbackHttpUrl(value)\n ) {\n return;\n }\n if (parsed.protocol !== \"https:\" || parsed.host === \"\") {\n ctx.addIssue({\n code: \"custom\",\n message: `${field} must be an absolute https URL (http is allowed for canonical loopback development hosts only).`,\n });\n }\n}\n"],"mappings":"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"}
|
package/dist/schemas.d.mts
CHANGED
|
@@ -1,17 +1,300 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
//#region src/schemas.d.ts
|
|
4
|
-
declare const schemaConfigSchema:
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare const schemaConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
4
|
+
objectType: z.ZodOptional<z.ZodString>;
|
|
5
|
+
kind: z.ZodLiteral<"user-schema">;
|
|
6
|
+
metaSchema: z.ZodURL;
|
|
7
|
+
"x-auth-methods": z.ZodObject<{
|
|
8
|
+
password: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
enabled: z.ZodBoolean;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
passkey: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
enabled: z.ZodBoolean;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
magic_link: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
enabled: z.ZodBoolean;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
sso: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
enabled: z.ZodBoolean;
|
|
19
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
otp: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
enabled: z.ZodBoolean;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
"x-identifier": z.ZodOptional<z.ZodString>;
|
|
26
|
+
"x-display": z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
28
|
+
"x-unique": z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
29
|
+
unspecified: "unspecified";
|
|
30
|
+
project: "project";
|
|
31
|
+
team: "team";
|
|
32
|
+
}>, z.ZodNull]>>;
|
|
33
|
+
"x-claim": z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
34
|
+
"x-audit": z.ZodDefault<z.ZodBoolean>;
|
|
35
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
kind: z.ZodLiteral<"schema-url">;
|
|
39
|
+
url: z.ZodURL;
|
|
40
|
+
}, z.core.$strip>]>;
|
|
41
|
+
export declare const flowConfigSchema: z.ZodObject<{
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
status: z.ZodEnum<{
|
|
44
|
+
active: "active";
|
|
45
|
+
draft: "draft";
|
|
46
|
+
}>;
|
|
47
|
+
user_schema: z.ZodString;
|
|
48
|
+
purposes: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
49
|
+
audience: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
team_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
|
+
app_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
fields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
56
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
kind: z.ZodEnum<{
|
|
59
|
+
passkey: "passkey";
|
|
60
|
+
submit: "submit";
|
|
61
|
+
passkey_register: "passkey_register";
|
|
62
|
+
navigate: "navigate";
|
|
63
|
+
}>;
|
|
64
|
+
primary: z.ZodDefault<z.ZodBoolean>;
|
|
65
|
+
text_key: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>>>;
|
|
67
|
+
gates: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
68
|
+
kind: z.ZodEnum<{
|
|
69
|
+
captcha: "captcha";
|
|
70
|
+
}>;
|
|
71
|
+
provider: z.ZodString;
|
|
72
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
73
|
+
}, z.core.$strip>>>;
|
|
74
|
+
sso_providers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
75
|
+
on_success: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
create_user: "create_user";
|
|
77
|
+
create_user_with_sso: "create_user_with_sso";
|
|
78
|
+
}>>;
|
|
79
|
+
complete: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
redirect: "redirect";
|
|
81
|
+
show: "show";
|
|
82
|
+
}>>;
|
|
83
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
84
|
+
target: z.ZodString;
|
|
85
|
+
action: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
86
|
+
switch: "switch";
|
|
87
|
+
pivot: "pivot";
|
|
88
|
+
}>, z.ZodNull]>>;
|
|
89
|
+
purpose: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
90
|
+
login: "login";
|
|
91
|
+
register: "register";
|
|
92
|
+
recovery: "recovery";
|
|
93
|
+
profiling: "profiling";
|
|
94
|
+
reauth: "reauth";
|
|
95
|
+
link_account: "link_account";
|
|
96
|
+
}>, z.ZodNull]>>;
|
|
97
|
+
}, z.core.$strip>>>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export declare const createFlowDefinitionRequestSchema: z.ZodObject<{
|
|
101
|
+
project_id: z.ZodString;
|
|
102
|
+
schema_uri: z.ZodOptional<z.ZodURL>;
|
|
103
|
+
flow_definition: z.ZodObject<{
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
status: z.ZodEnum<{
|
|
106
|
+
active: "active";
|
|
107
|
+
draft: "draft";
|
|
108
|
+
}>;
|
|
109
|
+
user_schema: z.ZodString;
|
|
110
|
+
purposes: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
111
|
+
audience: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
team_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
113
|
+
app_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
fields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
118
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
119
|
+
name: z.ZodString;
|
|
120
|
+
kind: z.ZodEnum<{
|
|
121
|
+
passkey: "passkey";
|
|
122
|
+
submit: "submit";
|
|
123
|
+
passkey_register: "passkey_register";
|
|
124
|
+
navigate: "navigate";
|
|
125
|
+
}>;
|
|
126
|
+
primary: z.ZodDefault<z.ZodBoolean>;
|
|
127
|
+
text_key: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
129
|
+
gates: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
130
|
+
kind: z.ZodEnum<{
|
|
131
|
+
captcha: "captcha";
|
|
132
|
+
}>;
|
|
133
|
+
provider: z.ZodString;
|
|
134
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
135
|
+
}, z.core.$strip>>>;
|
|
136
|
+
sso_providers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
137
|
+
on_success: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
create_user: "create_user";
|
|
139
|
+
create_user_with_sso: "create_user_with_sso";
|
|
140
|
+
}>>;
|
|
141
|
+
complete: z.ZodOptional<z.ZodEnum<{
|
|
142
|
+
redirect: "redirect";
|
|
143
|
+
show: "show";
|
|
144
|
+
}>>;
|
|
145
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
146
|
+
target: z.ZodString;
|
|
147
|
+
action: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
148
|
+
switch: "switch";
|
|
149
|
+
pivot: "pivot";
|
|
150
|
+
}>, z.ZodNull]>>;
|
|
151
|
+
purpose: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
152
|
+
login: "login";
|
|
153
|
+
register: "register";
|
|
154
|
+
recovery: "recovery";
|
|
155
|
+
profiling: "profiling";
|
|
156
|
+
reauth: "reauth";
|
|
157
|
+
link_account: "link_account";
|
|
158
|
+
}>, z.ZodNull]>>;
|
|
159
|
+
}, z.core.$strip>>>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
/**
|
|
164
|
+
* One `.zitadel/idps/<slug>.json` body: the connection document `POST /idps`
|
|
165
|
+
* carries under `idp`. The generated Zod enforces the contract the meta-schema
|
|
166
|
+
* states, including that `client_secret` is a `${{ NAME }}` reference and
|
|
167
|
+
* never a literal.
|
|
168
|
+
*/
|
|
169
|
+
export declare const idpConnectionConfigSchema: z.ZodObject<{
|
|
170
|
+
slug: z.ZodString;
|
|
171
|
+
protocol: z.ZodEnum<{
|
|
172
|
+
oidc: "oidc";
|
|
173
|
+
oauth2: "oauth2";
|
|
174
|
+
}>;
|
|
175
|
+
template: z.ZodOptional<z.ZodString>;
|
|
176
|
+
display_name: z.ZodString;
|
|
177
|
+
subject_claim: z.ZodOptional<z.ZodString>;
|
|
178
|
+
claim_mapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
179
|
+
verified_claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
180
|
+
provisioning: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
creation: z.ZodDefault<z.ZodEnum<{
|
|
182
|
+
disabled: "disabled";
|
|
183
|
+
auto: "auto";
|
|
184
|
+
}>>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
oidc: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
issuer: z.ZodString;
|
|
188
|
+
jwks_uri: z.ZodOptional<z.ZodString>;
|
|
189
|
+
id_token_mapping: z.ZodDefault<z.ZodBoolean>;
|
|
190
|
+
authorization_endpoint: z.ZodOptional<z.ZodString>;
|
|
191
|
+
token_endpoint: z.ZodOptional<z.ZodString>;
|
|
192
|
+
userinfo_endpoint: z.ZodOptional<z.ZodString>;
|
|
193
|
+
client_id: z.ZodString;
|
|
194
|
+
client_secret: z.ZodString;
|
|
195
|
+
token_endpoint_auth_method: z.ZodDefault<z.ZodEnum<{
|
|
196
|
+
client_secret_basic: "client_secret_basic";
|
|
197
|
+
client_secret_post: "client_secret_post";
|
|
198
|
+
}>>;
|
|
199
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
200
|
+
pkce_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
201
|
+
static_authorize_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
oauth2: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
authorization_endpoint: z.ZodString;
|
|
205
|
+
token_endpoint: z.ZodString;
|
|
206
|
+
userinfo_endpoint: z.ZodString;
|
|
207
|
+
client_id: z.ZodString;
|
|
208
|
+
client_secret: z.ZodString;
|
|
209
|
+
token_endpoint_auth_method: z.ZodDefault<z.ZodEnum<{
|
|
210
|
+
client_secret_basic: "client_secret_basic";
|
|
211
|
+
client_secret_post: "client_secret_post";
|
|
212
|
+
}>>;
|
|
213
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
214
|
+
pkce_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
215
|
+
static_authorize_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
216
|
+
supplementary_fetch: z.ZodOptional<z.ZodEnum<{
|
|
217
|
+
github_primary_email: "github_primary_email";
|
|
218
|
+
}>>;
|
|
219
|
+
}, z.core.$strip>>;
|
|
220
|
+
}, z.core.$strip>;
|
|
7
221
|
/** The wire shape of a branding revision (`POST /branding` request body). */
|
|
8
|
-
declare const brandingWireSchema:
|
|
222
|
+
export declare const brandingWireSchema: z.ZodObject<{
|
|
223
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
224
|
+
centered: "centered";
|
|
225
|
+
split: "split";
|
|
226
|
+
}>>;
|
|
227
|
+
liquid_template: z.ZodOptional<z.ZodString>;
|
|
228
|
+
logo_url: z.ZodOptional<z.ZodURL>;
|
|
229
|
+
hero_url: z.ZodOptional<z.ZodURL>;
|
|
230
|
+
theme: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
232
|
+
auto: "auto";
|
|
233
|
+
light: "light";
|
|
234
|
+
dark: "dark";
|
|
235
|
+
}>>;
|
|
236
|
+
light: z.ZodOptional<z.ZodObject<{
|
|
237
|
+
logo_url: z.ZodOptional<z.ZodURL>;
|
|
238
|
+
palette: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
primary: z.ZodOptional<z.ZodString>;
|
|
240
|
+
on_primary: z.ZodOptional<z.ZodString>;
|
|
241
|
+
background: z.ZodOptional<z.ZodString>;
|
|
242
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
243
|
+
muted: z.ZodOptional<z.ZodString>;
|
|
244
|
+
border: z.ZodOptional<z.ZodString>;
|
|
245
|
+
text: z.ZodOptional<z.ZodString>;
|
|
246
|
+
text_muted: z.ZodOptional<z.ZodString>;
|
|
247
|
+
link: z.ZodOptional<z.ZodString>;
|
|
248
|
+
success: z.ZodOptional<z.ZodString>;
|
|
249
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
250
|
+
error: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, z.core.$strip>>;
|
|
252
|
+
}, z.core.$strip>>;
|
|
253
|
+
dark: z.ZodOptional<z.ZodObject<{
|
|
254
|
+
logo_url: z.ZodOptional<z.ZodURL>;
|
|
255
|
+
palette: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
primary: z.ZodOptional<z.ZodString>;
|
|
257
|
+
on_primary: z.ZodOptional<z.ZodString>;
|
|
258
|
+
background: z.ZodOptional<z.ZodString>;
|
|
259
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
260
|
+
muted: z.ZodOptional<z.ZodString>;
|
|
261
|
+
border: z.ZodOptional<z.ZodString>;
|
|
262
|
+
text: z.ZodOptional<z.ZodString>;
|
|
263
|
+
text_muted: z.ZodOptional<z.ZodString>;
|
|
264
|
+
link: z.ZodOptional<z.ZodString>;
|
|
265
|
+
success: z.ZodOptional<z.ZodString>;
|
|
266
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
267
|
+
error: z.ZodOptional<z.ZodString>;
|
|
268
|
+
}, z.core.$strip>>;
|
|
269
|
+
}, z.core.$strip>>;
|
|
270
|
+
}, z.core.$strip>>;
|
|
271
|
+
typography: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
font_family: z.ZodOptional<z.ZodString>;
|
|
273
|
+
font_url: z.ZodOptional<z.ZodURL>;
|
|
274
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
275
|
+
}, z.core.$strip>>;
|
|
276
|
+
shape: z.ZodOptional<z.ZodObject<{
|
|
277
|
+
radius: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
278
|
+
none: "none";
|
|
279
|
+
sm: "sm";
|
|
280
|
+
md: "md";
|
|
281
|
+
lg: "lg";
|
|
282
|
+
full: "full";
|
|
283
|
+
}>, z.ZodInt]>>;
|
|
284
|
+
density: z.ZodOptional<z.ZodEnum<{
|
|
285
|
+
compact: "compact";
|
|
286
|
+
regular: "regular";
|
|
287
|
+
comfortable: "comfortable";
|
|
288
|
+
}>>;
|
|
289
|
+
logo_scale: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
}, z.core.$strip>>;
|
|
291
|
+
}, z.core.$strip>;
|
|
9
292
|
/**
|
|
10
293
|
* `{ "$file": "<path>" }`, which a `.zitadel/` file may hold in place of a
|
|
11
294
|
* string field the OpenAPI YAML marks `x-local: file`. The path is relative to
|
|
12
295
|
* the file holding it; the CLI inlines the content before publishing.
|
|
13
296
|
*/
|
|
14
|
-
declare const localFileReferenceSchema: z.ZodObject<{
|
|
297
|
+
export declare const localFileReferenceSchema: z.ZodObject<{
|
|
15
298
|
$file: z.ZodString;
|
|
16
299
|
}, z.core.$strict>;
|
|
17
300
|
/**
|
|
@@ -19,9 +302,78 @@ declare const localFileReferenceSchema: z.ZodObject<{
|
|
|
19
302
|
* `liquid_template` may also be a `$file` reference to the sibling `.liquid`
|
|
20
303
|
* template (the meta-schema `branding.json` mirrors this).
|
|
21
304
|
*/
|
|
22
|
-
declare const brandingConfigSchema: z.ZodObject<{
|
|
23
|
-
|
|
305
|
+
export declare const brandingConfigSchema: z.ZodObject<{
|
|
306
|
+
logo_url: z.ZodOptional<z.ZodString>;
|
|
307
|
+
hero_url: z.ZodOptional<z.ZodString>;
|
|
308
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
309
|
+
liquid_template: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
310
|
+
$file: z.ZodString;
|
|
311
|
+
}, z.core.$strict>]>>;
|
|
312
|
+
layout: z.ZodDefault<z.ZodEnum<{
|
|
313
|
+
centered: "centered";
|
|
314
|
+
split: "split";
|
|
315
|
+
}>>;
|
|
316
|
+
theme: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
318
|
+
auto: "auto";
|
|
319
|
+
light: "light";
|
|
320
|
+
dark: "dark";
|
|
321
|
+
}>>;
|
|
322
|
+
light: z.ZodOptional<z.ZodObject<{
|
|
323
|
+
logo_url: z.ZodOptional<z.ZodURL>;
|
|
324
|
+
palette: z.ZodOptional<z.ZodObject<{
|
|
325
|
+
primary: z.ZodOptional<z.ZodString>;
|
|
326
|
+
on_primary: z.ZodOptional<z.ZodString>;
|
|
327
|
+
background: z.ZodOptional<z.ZodString>;
|
|
328
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
329
|
+
muted: z.ZodOptional<z.ZodString>;
|
|
330
|
+
border: z.ZodOptional<z.ZodString>;
|
|
331
|
+
text: z.ZodOptional<z.ZodString>;
|
|
332
|
+
text_muted: z.ZodOptional<z.ZodString>;
|
|
333
|
+
link: z.ZodOptional<z.ZodString>;
|
|
334
|
+
success: z.ZodOptional<z.ZodString>;
|
|
335
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
336
|
+
error: z.ZodOptional<z.ZodString>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
338
|
+
}, z.core.$strip>>;
|
|
339
|
+
dark: z.ZodOptional<z.ZodObject<{
|
|
340
|
+
logo_url: z.ZodOptional<z.ZodURL>;
|
|
341
|
+
palette: z.ZodOptional<z.ZodObject<{
|
|
342
|
+
primary: z.ZodOptional<z.ZodString>;
|
|
343
|
+
on_primary: z.ZodOptional<z.ZodString>;
|
|
344
|
+
background: z.ZodOptional<z.ZodString>;
|
|
345
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
346
|
+
muted: z.ZodOptional<z.ZodString>;
|
|
347
|
+
border: z.ZodOptional<z.ZodString>;
|
|
348
|
+
text: z.ZodOptional<z.ZodString>;
|
|
349
|
+
text_muted: z.ZodOptional<z.ZodString>;
|
|
350
|
+
link: z.ZodOptional<z.ZodString>;
|
|
351
|
+
success: z.ZodOptional<z.ZodString>;
|
|
352
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
353
|
+
error: z.ZodOptional<z.ZodString>;
|
|
354
|
+
}, z.core.$strip>>;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
}, z.core.$strip>>;
|
|
357
|
+
typography: z.ZodOptional<z.ZodObject<{
|
|
358
|
+
font_family: z.ZodOptional<z.ZodString>;
|
|
359
|
+
font_url: z.ZodOptional<z.ZodURL>;
|
|
360
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
361
|
+
}, z.core.$strip>>;
|
|
362
|
+
shape: z.ZodOptional<z.ZodObject<{
|
|
363
|
+
radius: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
364
|
+
none: "none";
|
|
365
|
+
sm: "sm";
|
|
366
|
+
md: "md";
|
|
367
|
+
lg: "lg";
|
|
368
|
+
full: "full";
|
|
369
|
+
}>, z.ZodInt]>>;
|
|
370
|
+
density: z.ZodOptional<z.ZodEnum<{
|
|
371
|
+
compact: "compact";
|
|
372
|
+
regular: "regular";
|
|
373
|
+
comfortable: "comfortable";
|
|
374
|
+
}>>;
|
|
375
|
+
logo_scale: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
}, z.core.$strip>>;
|
|
24
377
|
}, z.core.$strict>;
|
|
25
378
|
//#endregion
|
|
26
|
-
export { brandingConfigSchema, brandingWireSchema, createFlowDefinitionRequestSchema, flowConfigSchema, localFileReferenceSchema, schemaConfigSchema };
|
|
27
379
|
//# sourceMappingURL=schemas.d.mts.map
|
package/dist/schemas.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.mts","names":[],"sources":["../src/schemas.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schemas.d.mts","names":[],"sources":["../src/schemas.ts"],"mappings":";;qBAWa,oBAAkB,EAAA,mBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmB,EAAA,KAAA;qBACrC,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiD,EAAA,KAAA;qBACjE,mCAAiC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA2B,EAAA,KAAA;;;;;;;qBAQ5D,2BAAyB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0B,EAAA,KAAA;;qBAGnD,oBAAkB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAqB,EAAA,KAAA;;;;;;qBAOvC,0BAAwB,EAAA;;GAA+C,EAAA,KAAA;;;;;;qBAOvE,sBAAoB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuD7B,EAAA,KAAA"}
|
package/dist/schemas.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "./branding-url.mjs";
|
|
2
|
-
import { a as
|
|
3
|
-
export { brandingConfigSchema, brandingWireSchema, createFlowDefinitionRequestSchema, flowConfigSchema, localFileReferenceSchema, schemaConfigSchema };
|
|
2
|
+
import { a as idpConnectionConfigSchema, i as flowConfigSchema, n as brandingWireSchema, o as localFileReferenceSchema, r as createFlowDefinitionRequestSchema, s as schemaConfigSchema, t as brandingConfigSchema } from "./schemas-CUU4Rf8J.mjs";
|
|
3
|
+
export { brandingConfigSchema, brandingWireSchema, createFlowDefinitionRequestSchema, flowConfigSchema, idpConnectionConfigSchema, localFileReferenceSchema, schemaConfigSchema };
|
package/dist/template.d.mts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
//#region src/template.d.ts
|
|
2
2
|
/** The `{% mandatory_gates %}` runtime safety-net tag every template must emit. */
|
|
3
|
-
declare const MANDATORY_GATES_TAG = "mandatory_gates";
|
|
3
|
+
export declare const MANDATORY_GATES_TAG = "mandatory_gates";
|
|
4
4
|
/**
|
|
5
5
|
* Custom Liquid tags the login orchestrator registers beyond the standard
|
|
6
6
|
* set. Validators must register them (as no-ops) or parsing valid templates
|
|
7
7
|
* fails; `@zitadel/components` registers the real implementations.
|
|
8
8
|
*/
|
|
9
|
-
declare const TEMPLATE_TAGS: readonly ["mandatory_gates"];
|
|
9
|
+
export declare const TEMPLATE_TAGS: readonly ["mandatory_gates"];
|
|
10
10
|
/**
|
|
11
11
|
* Byte cap for stored templates. Mirrors `maxLength` on
|
|
12
12
|
* `branding.liquid_template` in the OpenAPI contract and
|
|
13
13
|
* `MaxBrandingTemplateBytes` in the Go gate.
|
|
14
14
|
*/
|
|
15
|
-
declare const MAX_TEMPLATE_BYTES = 131072;
|
|
16
|
-
type TemplateValidationSeverity = "error" | "warning";
|
|
15
|
+
export declare const MAX_TEMPLATE_BYTES = 131072;
|
|
16
|
+
export type TemplateValidationSeverity = "error" | "warning";
|
|
17
17
|
/**
|
|
18
18
|
* Rule catalog with pointers into the Go lexical gate
|
|
19
19
|
* (`internal/domain/branding_validator.go`) where a server-side mirror
|
|
@@ -21,7 +21,7 @@ type TemplateValidationSeverity = "error" | "warning";
|
|
|
21
21
|
* cannot check them (wrong dialect) and render-time behavior degrades
|
|
22
22
|
* safely without them.
|
|
23
23
|
*/
|
|
24
|
-
declare const TEMPLATE_VALIDATION_RULES: {
|
|
24
|
+
export declare const TEMPLATE_VALIDATION_RULES: {
|
|
25
25
|
readonly parse: {
|
|
26
26
|
readonly goRef: null;
|
|
27
27
|
};
|
|
@@ -47,8 +47,8 @@ declare const TEMPLATE_VALIDATION_RULES: {
|
|
|
47
47
|
readonly goRef: null;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
type TemplateValidationRuleId = keyof typeof TEMPLATE_VALIDATION_RULES;
|
|
51
|
-
type TemplateValidationIssue = {
|
|
50
|
+
export type TemplateValidationRuleId = keyof typeof TEMPLATE_VALIDATION_RULES;
|
|
51
|
+
export type TemplateValidationIssue = {
|
|
52
52
|
severity: TemplateValidationSeverity;
|
|
53
53
|
rule: TemplateValidationRuleId;
|
|
54
54
|
message: string;
|
|
@@ -64,13 +64,12 @@ type BannedPattern = {
|
|
|
64
64
|
* doesn't false-positive; its separator class includes `/` because HTML
|
|
65
65
|
* treats a slash between attributes as whitespace (`<img/onerror=…>`).
|
|
66
66
|
*/
|
|
67
|
-
declare const BANNED_TEMPLATE_PATTERNS: readonly BannedPattern[];
|
|
67
|
+
export declare const BANNED_TEMPLATE_PATTERNS: readonly BannedPattern[];
|
|
68
68
|
/**
|
|
69
69
|
* Validates a login template. Pure and non-throwing, like
|
|
70
70
|
* `validateFlowDefinition`: returns an issue list, empty when the template
|
|
71
71
|
* is valid.
|
|
72
72
|
*/
|
|
73
|
-
declare function validateLoginTemplate(template: string): TemplateValidationIssue[];
|
|
73
|
+
export declare function validateLoginTemplate(template: string): TemplateValidationIssue[];
|
|
74
74
|
//#endregion
|
|
75
|
-
export { BANNED_TEMPLATE_PATTERNS, MANDATORY_GATES_TAG, MAX_TEMPLATE_BYTES, TEMPLATE_TAGS, TEMPLATE_VALIDATION_RULES, TemplateValidationIssue, TemplateValidationRuleId, TemplateValidationSeverity, validateLoginTemplate };
|
|
76
75
|
//# sourceMappingURL=template.d.mts.map
|
package/dist/template.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.mts","names":[],"sources":["../src/template.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"template.d.mts","names":[],"sources":["../src/template.ts"],"mappings":";;qBAkBa;;;;;;qBAOA;;;;;;qBAOA;YAED;;;;;;;;qBASC;;;;;;;;;;;;;;;;;;;;;;;;;;YAWD,wCAAwC;YAExC;EACV,UAAU;EACV,MAAM;EACN;;KAGG;EACH,MAAM;EACN,SAAS;EACT;;;;;;;;qBASW,mCAAmC;;;;;;wBAqEhC,sBAAsB,mBAAmB"}
|
package/dist/template.mjs
CHANGED
|
@@ -126,7 +126,7 @@ function validateLoginTemplate(template) {
|
|
|
126
126
|
if (!MANDATORY_GATES_PATTERN.test(template)) issues.push({
|
|
127
127
|
severity: "error",
|
|
128
128
|
rule: "mandatory-gates",
|
|
129
|
-
message: "Template must contain a trailing {% mandatory_gates %} tag — the runtime safety net that appends required
|
|
129
|
+
message: "Template must contain a trailing {% mandatory_gates %} tag — the runtime safety net that appends any required field and the primary action a template left out."
|
|
130
130
|
});
|
|
131
131
|
try {
|
|
132
132
|
getParseEngine().parse(template);
|
package/dist/template.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.mjs","names":[],"sources":["../src/template.ts"],"sourcesContent":["/**\n * The authoritative login-template validator (ADR 040).\n *\n * Runs where authoring happens — `zitadel plan`/`apply`, and later editors —\n * against the same LiquidJS dialect `@zitadel/components` renders. The Go\n * server cannot parse this dialect faithfully, so it only mirrors the\n * lexical subset below (`internal/domain/branding_validator.go`, see the\n * `goRef` entries in {@link TEMPLATE_VALIDATION_RULES}); keep the two\n * pattern lists in sync.\n *\n * Render-time safety does not depend on this validator: the component\n * escapes all output, neuters `| raw`, sanitises via DOMPurify, and patches\n * missing required UI with `{% mandatory_gates %}`\n * (`docs/design/flowengine/template-security.md`).\n */\nimport { Liquid } from \"liquidjs\";\n\n/** The `{% mandatory_gates %}` runtime safety-net tag every template must emit. */\nexport const MANDATORY_GATES_TAG = \"mandatory_gates\";\n\n/**\n * Custom Liquid tags the login orchestrator registers beyond the standard\n * set. Validators must register them (as no-ops) or parsing valid templates\n * fails; `@zitadel/components` registers the real implementations.\n */\nexport const TEMPLATE_TAGS = [MANDATORY_GATES_TAG] as const;\n\n/**\n * Byte cap for stored templates. Mirrors `maxLength` on\n * `branding.liquid_template` in the OpenAPI contract and\n * `MaxBrandingTemplateBytes` in the Go gate.\n */\nexport const MAX_TEMPLATE_BYTES = 131072;\n\nexport type TemplateValidationSeverity = \"error\" | \"warning\";\n\n/**\n * Rule catalog with pointers into the Go lexical gate\n * (`internal/domain/branding_validator.go`) where a server-side mirror\n * exists. `parse` and `mandatory-gates` are authoring-only: the server\n * cannot check them (wrong dialect) and render-time behavior degrades\n * safely without them.\n */\nexport const TEMPLATE_VALIDATION_RULES = {\n parse: { goRef: null },\n size: { goRef: \"MaxBrandingTemplateBytes\" },\n \"no-script-tag\": { goRef: \"brandingScriptTag\" },\n \"no-style-tag\": { goRef: \"brandingStyleTag\" },\n \"no-inline-handlers\": { goRef: \"brandingInlineHandler\" },\n \"no-javascript-urls\": { goRef: \"brandingJavascriptURL\" },\n \"no-raw-filter\": { goRef: \"brandingRawFilter\" },\n \"mandatory-gates\": { goRef: null },\n} as const;\n\nexport type TemplateValidationRuleId = keyof typeof TEMPLATE_VALIDATION_RULES;\n\nexport type TemplateValidationIssue = {\n severity: TemplateValidationSeverity;\n rule: TemplateValidationRuleId;\n message: string;\n};\n\ntype BannedPattern = {\n rule: TemplateValidationRuleId;\n pattern: RegExp;\n message: string;\n};\n\n/**\n * Lexical bans, identical to the Go gate. The inline-handler pattern only\n * matches inside an open tag so Liquid like `{% assign online = true %}`\n * doesn't false-positive; its separator class includes `/` because HTML\n * treats a slash between attributes as whitespace (`<img/onerror=…>`).\n */\nexport const BANNED_TEMPLATE_PATTERNS: readonly BannedPattern[] = [\n {\n rule: \"no-script-tag\",\n pattern: /<\\s*script\\b/i,\n message: \"Templates must not contain <script> tags.\",\n },\n {\n rule: \"no-style-tag\",\n pattern: /<\\s*style\\b/i,\n message: \"Templates must not contain <style> tags — theming is orchestrator-owned via tokens.\",\n },\n {\n rule: \"no-inline-handlers\",\n pattern: /<[a-z][^>]*[\\s/]on[a-z]+\\s*=/i,\n message: \"Templates must not contain inline event handlers (on*= attributes).\",\n },\n {\n rule: \"no-javascript-urls\",\n pattern: /javascript\\s*:/i,\n message: \"Templates must not contain javascript: URLs.\",\n },\n {\n rule: \"no-raw-filter\",\n pattern: /\\|\\s*raw\\b/,\n message:\n \"Templates must not use the | raw filter. The renderer neuters it anyway; remove it from the template.\",\n },\n] as const;\n\n// Derived from the exported tag name so a rename cannot silently diverge\n// the validator from the renderer contract.\nconst MANDATORY_GATES_PATTERN = new RegExp(`\\\\{%-?\\\\s*${MANDATORY_GATES_TAG}\\\\s*-?%\\\\}`);\n\nlet parseEngine: Liquid | undefined;\n\n/**\n * A parse-only engine mirroring the orchestrator's dialect options\n * (`packages/components/src/orchestrator/liquid.ts`); custom tags are\n * registered as no-ops because only parseability matters here.\n */\nfunction getParseEngine(): Liquid {\n if (!parseEngine) {\n const engine = new Liquid({\n cache: false,\n jsTruthy: true,\n relativeReference: false,\n strictFilters: false,\n strictVariables: false,\n });\n for (const tag of TEMPLATE_TAGS) {\n engine.registerTag(tag, {\n parse() {\n // no-op: the tag takes no arguments and no body\n },\n render() {\n return \"\";\n },\n });\n }\n parseEngine = engine;\n }\n return parseEngine;\n}\n\n/**\n * Validates a login template. Pure and non-throwing, like\n * `validateFlowDefinition`: returns an issue list, empty when the template\n * is valid.\n */\nexport function validateLoginTemplate(template: string): TemplateValidationIssue[] {\n const issues: TemplateValidationIssue[] = [];\n\n const bytes = new TextEncoder().encode(template).length;\n if (bytes > MAX_TEMPLATE_BYTES) {\n issues.push({\n severity: \"error\",\n rule: \"size\",\n message: `Template is ${bytes} bytes; the platform caps liquid_template at ${MAX_TEMPLATE_BYTES} bytes.`,\n });\n }\n\n for (const banned of BANNED_TEMPLATE_PATTERNS) {\n if (banned.pattern.test(template)) {\n issues.push({ severity: \"error\", rule: banned.rule, message: banned.message });\n }\n }\n\n if (!MANDATORY_GATES_PATTERN.test(template)) {\n issues.push({\n severity: \"error\",\n rule: \"mandatory-gates\",\n message:\n \"Template must contain a trailing {% mandatory_gates %} tag — the runtime safety net that appends required
|
|
1
|
+
{"version":3,"file":"template.mjs","names":[],"sources":["../src/template.ts"],"sourcesContent":["/**\n * The authoritative login-template validator (ADR 040).\n *\n * Runs where authoring happens — `zitadel plan`/`apply`, and later editors —\n * against the same LiquidJS dialect `@zitadel/components` renders. The Go\n * server cannot parse this dialect faithfully, so it only mirrors the\n * lexical subset below (`internal/domain/branding_validator.go`, see the\n * `goRef` entries in {@link TEMPLATE_VALIDATION_RULES}); keep the two\n * pattern lists in sync.\n *\n * Render-time safety does not depend on this validator: the component\n * escapes all output, neuters `| raw`, sanitises via DOMPurify, and patches\n * missing required UI with `{% mandatory_gates %}`\n * (`docs/design/flowengine/template-security.md`).\n */\nimport { Liquid } from \"liquidjs\";\n\n/** The `{% mandatory_gates %}` runtime safety-net tag every template must emit. */\nexport const MANDATORY_GATES_TAG = \"mandatory_gates\";\n\n/**\n * Custom Liquid tags the login orchestrator registers beyond the standard\n * set. Validators must register them (as no-ops) or parsing valid templates\n * fails; `@zitadel/components` registers the real implementations.\n */\nexport const TEMPLATE_TAGS = [MANDATORY_GATES_TAG] as const;\n\n/**\n * Byte cap for stored templates. Mirrors `maxLength` on\n * `branding.liquid_template` in the OpenAPI contract and\n * `MaxBrandingTemplateBytes` in the Go gate.\n */\nexport const MAX_TEMPLATE_BYTES = 131072;\n\nexport type TemplateValidationSeverity = \"error\" | \"warning\";\n\n/**\n * Rule catalog with pointers into the Go lexical gate\n * (`internal/domain/branding_validator.go`) where a server-side mirror\n * exists. `parse` and `mandatory-gates` are authoring-only: the server\n * cannot check them (wrong dialect) and render-time behavior degrades\n * safely without them.\n */\nexport const TEMPLATE_VALIDATION_RULES = {\n parse: { goRef: null },\n size: { goRef: \"MaxBrandingTemplateBytes\" },\n \"no-script-tag\": { goRef: \"brandingScriptTag\" },\n \"no-style-tag\": { goRef: \"brandingStyleTag\" },\n \"no-inline-handlers\": { goRef: \"brandingInlineHandler\" },\n \"no-javascript-urls\": { goRef: \"brandingJavascriptURL\" },\n \"no-raw-filter\": { goRef: \"brandingRawFilter\" },\n \"mandatory-gates\": { goRef: null },\n} as const;\n\nexport type TemplateValidationRuleId = keyof typeof TEMPLATE_VALIDATION_RULES;\n\nexport type TemplateValidationIssue = {\n severity: TemplateValidationSeverity;\n rule: TemplateValidationRuleId;\n message: string;\n};\n\ntype BannedPattern = {\n rule: TemplateValidationRuleId;\n pattern: RegExp;\n message: string;\n};\n\n/**\n * Lexical bans, identical to the Go gate. The inline-handler pattern only\n * matches inside an open tag so Liquid like `{% assign online = true %}`\n * doesn't false-positive; its separator class includes `/` because HTML\n * treats a slash between attributes as whitespace (`<img/onerror=…>`).\n */\nexport const BANNED_TEMPLATE_PATTERNS: readonly BannedPattern[] = [\n {\n rule: \"no-script-tag\",\n pattern: /<\\s*script\\b/i,\n message: \"Templates must not contain <script> tags.\",\n },\n {\n rule: \"no-style-tag\",\n pattern: /<\\s*style\\b/i,\n message: \"Templates must not contain <style> tags — theming is orchestrator-owned via tokens.\",\n },\n {\n rule: \"no-inline-handlers\",\n pattern: /<[a-z][^>]*[\\s/]on[a-z]+\\s*=/i,\n message: \"Templates must not contain inline event handlers (on*= attributes).\",\n },\n {\n rule: \"no-javascript-urls\",\n pattern: /javascript\\s*:/i,\n message: \"Templates must not contain javascript: URLs.\",\n },\n {\n rule: \"no-raw-filter\",\n pattern: /\\|\\s*raw\\b/,\n message:\n \"Templates must not use the | raw filter. The renderer neuters it anyway; remove it from the template.\",\n },\n] as const;\n\n// Derived from the exported tag name so a rename cannot silently diverge\n// the validator from the renderer contract.\nconst MANDATORY_GATES_PATTERN = new RegExp(`\\\\{%-?\\\\s*${MANDATORY_GATES_TAG}\\\\s*-?%\\\\}`);\n\nlet parseEngine: Liquid | undefined;\n\n/**\n * A parse-only engine mirroring the orchestrator's dialect options\n * (`packages/components/src/orchestrator/liquid.ts`); custom tags are\n * registered as no-ops because only parseability matters here.\n */\nfunction getParseEngine(): Liquid {\n if (!parseEngine) {\n const engine = new Liquid({\n cache: false,\n jsTruthy: true,\n relativeReference: false,\n strictFilters: false,\n strictVariables: false,\n });\n for (const tag of TEMPLATE_TAGS) {\n engine.registerTag(tag, {\n parse() {\n // no-op: the tag takes no arguments and no body\n },\n render() {\n return \"\";\n },\n });\n }\n parseEngine = engine;\n }\n return parseEngine;\n}\n\n/**\n * Validates a login template. Pure and non-throwing, like\n * `validateFlowDefinition`: returns an issue list, empty when the template\n * is valid.\n */\nexport function validateLoginTemplate(template: string): TemplateValidationIssue[] {\n const issues: TemplateValidationIssue[] = [];\n\n const bytes = new TextEncoder().encode(template).length;\n if (bytes > MAX_TEMPLATE_BYTES) {\n issues.push({\n severity: \"error\",\n rule: \"size\",\n message: `Template is ${bytes} bytes; the platform caps liquid_template at ${MAX_TEMPLATE_BYTES} bytes.`,\n });\n }\n\n for (const banned of BANNED_TEMPLATE_PATTERNS) {\n if (banned.pattern.test(template)) {\n issues.push({ severity: \"error\", rule: banned.rule, message: banned.message });\n }\n }\n\n if (!MANDATORY_GATES_PATTERN.test(template)) {\n issues.push({\n severity: \"error\",\n rule: \"mandatory-gates\",\n message:\n \"Template must contain a trailing {% mandatory_gates %} tag — the runtime safety net that appends any required field and the primary action a template left out.\",\n });\n }\n\n try {\n getParseEngine().parse(template);\n } catch (error) {\n issues.push({\n severity: \"error\",\n rule: \"parse\",\n message: `Template is not valid LiquidJS: ${error instanceof Error ? error.message : String(error)}`,\n });\n }\n\n return issues;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAa,sBAAsB;;;;;;AAOnC,MAAa,gBAAgB,CAAC,mBAAmB;;;;;;AAOjD,MAAa,qBAAqB;;;;;;;;AAWlC,MAAa,4BAA4B;CACvC,OAAO,EAAE,OAAO,KAAK;CACrB,MAAM,EAAE,OAAO,2BAA2B;CAC1C,iBAAiB,EAAE,OAAO,oBAAoB;CAC9C,gBAAgB,EAAE,OAAO,mBAAmB;CAC5C,sBAAsB,EAAE,OAAO,wBAAwB;CACvD,sBAAsB,EAAE,OAAO,wBAAwB;CACvD,iBAAiB,EAAE,OAAO,oBAAoB;CAC9C,mBAAmB,EAAE,OAAO,KAAK;AACnC;;;;;;;AAsBA,MAAa,2BAAqD;CAChE;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SAAS;CACX;CACA;EACE,MAAM;EACN,SAAS;EACT,SACE;CACJ;AACF;AAIA,MAAM,0BAA0B,IAAI,OAAO,aAAa,oBAAoB,WAAW;AAEvF,IAAI;;;;;;AAOJ,SAAS,iBAAyB;CAChC,IAAI,CAAC,aAAa;EAChB,MAAM,SAAS,IAAI,OAAO;GACxB,OAAO;GACP,UAAU;GACV,mBAAmB;GACnB,eAAe;GACf,iBAAiB;EACnB,CAAC;EACD,KAAK,MAAM,OAAO,eAChB,OAAO,YAAY,KAAK;GACtB,QAAQ,CAER;GACA,SAAS;IACP,OAAO;GACT;EACF,CAAC;EAEH,cAAc;CAChB;CACA,OAAO;AACT;;;;;;AAOA,SAAgB,sBAAsB,UAA6C;CACjF,MAAM,SAAoC,CAAC;CAE3C,MAAM,QAAQ,IAAI,YAAY,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC;CACjD,IAAI,QAAA,QACF,OAAO,KAAK;EACV,UAAU;EACV,MAAM;EACN,SAAS,eAAe,MAAM,+CAA+C,mBAAmB;CAClG,CAAC;CAGH,KAAK,MAAM,UAAU,0BACnB,IAAI,OAAO,QAAQ,KAAK,QAAQ,GAC9B,OAAO,KAAK;EAAE,UAAU;EAAS,MAAM,OAAO;EAAM,SAAS,OAAO;CAAQ,CAAC;CAIjF,IAAI,CAAC,wBAAwB,KAAK,QAAQ,GACxC,OAAO,KAAK;EACV,UAAU;EACV,MAAM;EACN,SACE;CACJ,CAAC;CAGH,IAAI;EACF,eAAe,CAAC,CAAC,MAAM,QAAQ;CACjC,SAAS,OAAO;EACd,OAAO,KAAK;GACV,UAAU;GACV,MAAM;GACN,SAAS,mCAAmC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACnG,CAAC;CACH;CAEA,OAAO;AACT"}
|
package/dist/validate.d.mts
CHANGED
|
@@ -28,18 +28,21 @@
|
|
|
28
28
|
* validator all go away. New rules land in Go first and are ported here
|
|
29
29
|
* only until then.
|
|
30
30
|
*/
|
|
31
|
-
type FlowValidationSeverity = "error" | "warning";
|
|
32
|
-
type FlowValidationIssue = {
|
|
33
|
-
severity: FlowValidationSeverity;
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
export type FlowValidationSeverity = "error" | "warning";
|
|
32
|
+
export type FlowValidationIssue = {
|
|
33
|
+
severity: FlowValidationSeverity;
|
|
34
|
+
/** Stable rule id from {@link FLOW_VALIDATION_RULES}. */
|
|
35
|
+
rule: FlowValidationRuleId;
|
|
36
|
+
/** Mirrors the Go `ErrFlowDefinitionInvalid` detail string where a Go rule exists. */
|
|
37
|
+
message: string;
|
|
38
|
+
/** Step the issue is anchored to, when applicable. */
|
|
36
39
|
step?: string;
|
|
37
40
|
};
|
|
38
41
|
/**
|
|
39
42
|
* Rule registry: rule id → the Go function it ports. `goRef: null` marks
|
|
40
43
|
* CLI-only guidance with no server counterpart.
|
|
41
44
|
*/
|
|
42
|
-
declare const FLOW_VALIDATION_RULES: {
|
|
45
|
+
export declare const FLOW_VALIDATION_RULES: {
|
|
43
46
|
readonly "step-names": {
|
|
44
47
|
readonly goRef: "stepNamesMap";
|
|
45
48
|
};
|
|
@@ -74,19 +77,19 @@ declare const FLOW_VALIDATION_RULES: {
|
|
|
74
77
|
readonly goRef: null;
|
|
75
78
|
};
|
|
76
79
|
};
|
|
77
|
-
type FlowValidationRuleId = keyof typeof FLOW_VALIDATION_RULES;
|
|
80
|
+
export type FlowValidationRuleId = keyof typeof FLOW_VALIDATION_RULES;
|
|
78
81
|
/** Mirrors `reservedOutcomes` in flow_definition_validator.go. */
|
|
79
|
-
declare const RESERVED_OUTCOMES: readonly ["user_not_found", "user_already_exists", "
|
|
82
|
+
export declare const RESERVED_OUTCOMES: readonly ["user_not_found", "user_already_exists", "sso_user_not_found", "sso_authenticated"];
|
|
80
83
|
/** Mirrors the `FlowDefinitionPurpose` enum (snake transform) in flow_definition.go. */
|
|
81
|
-
declare const FLOW_PURPOSES: readonly ["login", "register", "recovery", "profiling", "reauth", "link_account"];
|
|
84
|
+
export declare const FLOW_PURPOSES: readonly ["login", "register", "recovery", "profiling", "reauth", "link_account"];
|
|
82
85
|
/**
|
|
83
86
|
* Mirrors `purposeFlipTargets` in flow_definition_validator.go: the
|
|
84
|
-
* identifier outcomes only. `
|
|
87
|
+
* identifier outcomes only. `sso_user_not_found` comes only from SSO
|
|
85
88
|
* resolution and is left out here; requiring it on every combined entry
|
|
86
89
|
* step would reject the shipped default flow. A rule on steps carrying
|
|
87
90
|
* sso_providers is future work (#1044).
|
|
88
91
|
*/
|
|
89
|
-
declare const PURPOSE_FLIP_TARGETS: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
92
|
+
export declare const PURPOSE_FLIP_TARGETS: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
90
93
|
/**
|
|
91
94
|
* Validate a flow-definition config body (the `.zitadel/flows/*.json`
|
|
92
95
|
* content) against the rules the server enforces on apply. `schema` is
|
|
@@ -94,7 +97,6 @@ declare const PURPOSE_FLIP_TARGETS: Readonly<Record<string, Readonly<Record<stri
|
|
|
94
97
|
* omitted, schema-dependent rules are skipped. Pure — collects all
|
|
95
98
|
* issues, never throws.
|
|
96
99
|
*/
|
|
97
|
-
declare function validateFlowDefinition(flow: object, schema?: object): FlowValidationIssue[];
|
|
100
|
+
export declare function validateFlowDefinition(flow: object, schema?: object): FlowValidationIssue[];
|
|
98
101
|
//#endregion
|
|
99
|
-
export { FLOW_PURPOSES, FLOW_VALIDATION_RULES, FlowValidationIssue, FlowValidationRuleId, FlowValidationSeverity, PURPOSE_FLIP_TARGETS, RESERVED_OUTCOMES, validateFlowDefinition };
|
|
100
102
|
//# sourceMappingURL=validate.d.mts.map
|
package/dist/validate.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.mts","names":[],"sources":["../src/validate.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.mts","names":[],"sources":["../src/validate.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8BY;YAEA;EACV,UAAU;;EAEV,MAAM;;EAEN;;EAEA;;;;;;qBAOW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAcD,oCAAoC;;qBAGnC;;qBAQA;;;;;;;;qBAgBA,sBAAsB,SAAS,eAAe,SAAS;;;;;;;;wBA2CpD,uBAAuB,cAAc,kBAAkB"}
|