@authhero/proxy 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +252 -0
- package/dist/proxy.cjs +1 -0
- package/dist/proxy.d.ts +236 -0
- package/dist/proxy.mjs +3080 -0
- package/dist/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/adapter.d.ts +20 -0
- package/dist/types/app.d.ts +12 -0
- package/dist/types/data-plane/cache-api-cache.d.ts +20 -0
- package/dist/types/data-plane/cache.d.ts +13 -0
- package/dist/types/data-plane/compile.d.ts +9 -0
- package/dist/types/data-plane/handlers/basic-auth.d.ts +5 -0
- package/dist/types/data-plane/handlers/cache.d.ts +3 -0
- package/dist/types/data-plane/handlers/cors.d.ts +8 -0
- package/dist/types/data-plane/handlers/forwarded-headers.d.ts +5 -0
- package/dist/types/data-plane/handlers/headers.d.ts +6 -0
- package/dist/types/data-plane/handlers/http.d.ts +17 -0
- package/dist/types/data-plane/handlers/index.d.ts +13 -0
- package/dist/types/data-plane/handlers/redirect.d.ts +6 -0
- package/dist/types/data-plane/handlers/rewrite-cookies.d.ts +3 -0
- package/dist/types/data-plane/handlers/rewrite-location.d.ts +3 -0
- package/dist/types/data-plane/handlers/service-binding.d.ts +5 -0
- package/dist/types/data-plane/handlers/static.d.ts +6 -0
- package/dist/types/data-plane/handlers/util.d.ts +4 -0
- package/dist/types/data-plane/matcher.d.ts +15 -0
- package/dist/types/data-plane/registry.d.ts +19 -0
- package/dist/types/data-plane/router.d.ts +15 -0
- package/dist/types/http-adapter/index.d.ts +22 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/static/index.d.ts +30 -0
- package/dist/types/types.d.ts +2 -0
- package/package.json +3 -6
package/dist/proxy.mjs
ADDED
|
@@ -0,0 +1,3080 @@
|
|
|
1
|
+
import { z as e } from "@hono/zod-openapi";
|
|
2
|
+
import { Hono as t } from "hono";
|
|
3
|
+
//#region ../adapter-interfaces/dist/adapter-interfaces.mjs
|
|
4
|
+
var n = e.object({
|
|
5
|
+
created_at: e.string(),
|
|
6
|
+
updated_at: e.string()
|
|
7
|
+
}), r = e.object({
|
|
8
|
+
id: e.string(),
|
|
9
|
+
version: e.string().optional()
|
|
10
|
+
}), i = e.object({
|
|
11
|
+
name: e.string(),
|
|
12
|
+
version: e.string()
|
|
13
|
+
}), a = e.object({
|
|
14
|
+
name: e.string(),
|
|
15
|
+
value: e.string().optional()
|
|
16
|
+
}), o = e.object({
|
|
17
|
+
name: e.string().max(255),
|
|
18
|
+
code: e.string().max(1e5),
|
|
19
|
+
supported_triggers: e.array(r).optional(),
|
|
20
|
+
runtime: e.string().max(50).optional(),
|
|
21
|
+
dependencies: e.array(i).optional(),
|
|
22
|
+
secrets: e.array(a).optional(),
|
|
23
|
+
is_system: e.boolean().optional(),
|
|
24
|
+
inherit: e.boolean().optional()
|
|
25
|
+
});
|
|
26
|
+
o.partial().extend({
|
|
27
|
+
status: e.enum(["draft", "built"]).optional(),
|
|
28
|
+
deployed_at: e.string().optional()
|
|
29
|
+
}), o.extend({
|
|
30
|
+
id: e.string(),
|
|
31
|
+
tenant_id: e.string(),
|
|
32
|
+
status: e.enum(["draft", "built"]).default("built"),
|
|
33
|
+
deployed_at: e.string().optional(),
|
|
34
|
+
secrets: e.array(e.object({
|
|
35
|
+
name: e.string(),
|
|
36
|
+
value: e.string().optional()
|
|
37
|
+
})).optional()
|
|
38
|
+
}).extend(n.shape);
|
|
39
|
+
var s = e.string(), c = e.enum([
|
|
40
|
+
"unspecified",
|
|
41
|
+
"pending",
|
|
42
|
+
"final",
|
|
43
|
+
"partial",
|
|
44
|
+
"canceled",
|
|
45
|
+
"suspended"
|
|
46
|
+
]), l = e.object({
|
|
47
|
+
id: e.string(),
|
|
48
|
+
msg: e.string(),
|
|
49
|
+
url: e.string().optional()
|
|
50
|
+
}), u = e.object({
|
|
51
|
+
action_name: e.string(),
|
|
52
|
+
error: l.nullable(),
|
|
53
|
+
started_at: e.string(),
|
|
54
|
+
ended_at: e.string()
|
|
55
|
+
}), d = e.object({
|
|
56
|
+
level: e.enum([
|
|
57
|
+
"log",
|
|
58
|
+
"info",
|
|
59
|
+
"warn",
|
|
60
|
+
"error",
|
|
61
|
+
"debug"
|
|
62
|
+
]),
|
|
63
|
+
message: e.string()
|
|
64
|
+
}), f = e.array(e.object({
|
|
65
|
+
action_name: e.string(),
|
|
66
|
+
lines: e.array(d)
|
|
67
|
+
}));
|
|
68
|
+
e.object({
|
|
69
|
+
id: e.string(),
|
|
70
|
+
tenant_id: e.string(),
|
|
71
|
+
trigger_id: s,
|
|
72
|
+
status: c,
|
|
73
|
+
results: e.array(u),
|
|
74
|
+
logs: f.optional(),
|
|
75
|
+
created_at: e.string(),
|
|
76
|
+
updated_at: e.string()
|
|
77
|
+
}).omit({
|
|
78
|
+
tenant_id: !0,
|
|
79
|
+
created_at: !0,
|
|
80
|
+
updated_at: !0
|
|
81
|
+
}), e.object({
|
|
82
|
+
action_id: e.string(),
|
|
83
|
+
code: e.string().max(1e5),
|
|
84
|
+
runtime: e.string().max(50).optional(),
|
|
85
|
+
dependencies: e.array(i).optional(),
|
|
86
|
+
secrets: e.array(a).optional(),
|
|
87
|
+
supported_triggers: e.array(r).optional(),
|
|
88
|
+
deployed: e.boolean().default(!0)
|
|
89
|
+
}).extend({
|
|
90
|
+
id: e.string(),
|
|
91
|
+
tenant_id: e.string(),
|
|
92
|
+
number: e.number().int()
|
|
93
|
+
}).extend(n.shape);
|
|
94
|
+
var ee = e.enum([
|
|
95
|
+
"user_action",
|
|
96
|
+
"admin_action",
|
|
97
|
+
"system",
|
|
98
|
+
"api"
|
|
99
|
+
]), te = e.object({
|
|
100
|
+
type: e.enum([
|
|
101
|
+
"user",
|
|
102
|
+
"admin",
|
|
103
|
+
"system",
|
|
104
|
+
"api_key",
|
|
105
|
+
"client_credentials"
|
|
106
|
+
]),
|
|
107
|
+
id: e.string().optional(),
|
|
108
|
+
email: e.string().optional(),
|
|
109
|
+
org_id: e.string().optional(),
|
|
110
|
+
org_name: e.string().optional(),
|
|
111
|
+
scopes: e.array(e.string()).optional(),
|
|
112
|
+
client_id: e.string().optional()
|
|
113
|
+
}), ne = e.object({
|
|
114
|
+
type: e.string(),
|
|
115
|
+
id: e.string(),
|
|
116
|
+
before: e.record(e.string(), e.unknown()).optional(),
|
|
117
|
+
after: e.record(e.string(), e.unknown()).optional(),
|
|
118
|
+
diff: e.record(e.string(), e.object({
|
|
119
|
+
old: e.unknown(),
|
|
120
|
+
new: e.unknown()
|
|
121
|
+
})).optional()
|
|
122
|
+
}), re = e.object({
|
|
123
|
+
method: e.string(),
|
|
124
|
+
path: e.string(),
|
|
125
|
+
query: e.record(e.string(), e.string()).optional(),
|
|
126
|
+
body: e.unknown().optional(),
|
|
127
|
+
ip: e.string(),
|
|
128
|
+
user_agent: e.string().optional(),
|
|
129
|
+
correlation_id: e.string().optional()
|
|
130
|
+
}), ie = e.object({
|
|
131
|
+
status_code: e.number(),
|
|
132
|
+
body: e.unknown().optional()
|
|
133
|
+
}), ae = e.object({
|
|
134
|
+
country_code: e.string(),
|
|
135
|
+
city_name: e.string(),
|
|
136
|
+
latitude: e.string(),
|
|
137
|
+
longitude: e.string(),
|
|
138
|
+
time_zone: e.string(),
|
|
139
|
+
continent_code: e.string()
|
|
140
|
+
}), oe = e.object({
|
|
141
|
+
name: e.string(),
|
|
142
|
+
version: e.string(),
|
|
143
|
+
env: e.record(e.string(), e.string()).optional()
|
|
144
|
+
});
|
|
145
|
+
e.object({
|
|
146
|
+
tenant_id: e.string(),
|
|
147
|
+
event_type: e.string(),
|
|
148
|
+
log_type: e.string(),
|
|
149
|
+
description: e.string().optional(),
|
|
150
|
+
category: ee,
|
|
151
|
+
actor: te,
|
|
152
|
+
target: ne,
|
|
153
|
+
request: re,
|
|
154
|
+
response: ie.optional(),
|
|
155
|
+
connection: e.string().optional(),
|
|
156
|
+
strategy: e.string().optional(),
|
|
157
|
+
strategy_type: e.string().optional(),
|
|
158
|
+
audience: e.string().optional(),
|
|
159
|
+
scope: e.string().optional(),
|
|
160
|
+
location: ae.optional(),
|
|
161
|
+
auth0_client: oe.optional(),
|
|
162
|
+
hostname: e.string(),
|
|
163
|
+
is_mobile: e.boolean().optional(),
|
|
164
|
+
timestamp: e.string()
|
|
165
|
+
}).extend({ id: e.string() }), e.enum([
|
|
166
|
+
"AUTH0",
|
|
167
|
+
"EMAIL",
|
|
168
|
+
"REDIRECT"
|
|
169
|
+
]), e.enum([
|
|
170
|
+
"CREATE_USER",
|
|
171
|
+
"GET_USER",
|
|
172
|
+
"UPDATE_USER",
|
|
173
|
+
"SEND_REQUEST",
|
|
174
|
+
"SEND_EMAIL"
|
|
175
|
+
]), e.enum(["VERIFY_EMAIL"]);
|
|
176
|
+
var se = e.object({
|
|
177
|
+
require_mx_record: e.boolean().optional(),
|
|
178
|
+
block_aliases: e.boolean().optional(),
|
|
179
|
+
block_free_emails: e.boolean().optional(),
|
|
180
|
+
block_disposable_emails: e.boolean().optional(),
|
|
181
|
+
blocklist: e.array(e.string()).optional(),
|
|
182
|
+
allowlist: e.array(e.string()).optional()
|
|
183
|
+
}), ce = e.object({
|
|
184
|
+
id: e.string(),
|
|
185
|
+
alias: e.string().max(100).optional(),
|
|
186
|
+
type: e.literal("AUTH0"),
|
|
187
|
+
action: e.literal("UPDATE_USER"),
|
|
188
|
+
allow_failure: e.boolean().optional(),
|
|
189
|
+
mask_output: e.boolean().optional(),
|
|
190
|
+
params: e.object({
|
|
191
|
+
connection_id: e.string().optional(),
|
|
192
|
+
user_id: e.string(),
|
|
193
|
+
changes: e.record(e.string(), e.any())
|
|
194
|
+
})
|
|
195
|
+
}), le = e.object({
|
|
196
|
+
id: e.string(),
|
|
197
|
+
alias: e.string().max(100).optional(),
|
|
198
|
+
type: e.literal("EMAIL"),
|
|
199
|
+
action: e.literal("VERIFY_EMAIL"),
|
|
200
|
+
allow_failure: e.boolean().optional(),
|
|
201
|
+
mask_output: e.boolean().optional(),
|
|
202
|
+
params: e.object({
|
|
203
|
+
email: e.string(),
|
|
204
|
+
rules: se.optional()
|
|
205
|
+
})
|
|
206
|
+
}), ue = e.enum([
|
|
207
|
+
"change-email",
|
|
208
|
+
"account",
|
|
209
|
+
"custom"
|
|
210
|
+
]), de = e.object({
|
|
211
|
+
id: e.string(),
|
|
212
|
+
alias: e.string().max(100).optional(),
|
|
213
|
+
type: e.literal("REDIRECT"),
|
|
214
|
+
action: e.literal("REDIRECT_USER"),
|
|
215
|
+
allow_failure: e.boolean().optional(),
|
|
216
|
+
mask_output: e.boolean().optional(),
|
|
217
|
+
params: e.object({
|
|
218
|
+
target: ue.openapi({ description: "The predefined target to redirect to, or 'custom' for a custom URL" }),
|
|
219
|
+
custom_url: e.string().optional().openapi({ description: "Custom URL to redirect to when target is 'custom'" })
|
|
220
|
+
})
|
|
221
|
+
}), fe = e.union([
|
|
222
|
+
ce,
|
|
223
|
+
le,
|
|
224
|
+
de
|
|
225
|
+
]);
|
|
226
|
+
e.object({
|
|
227
|
+
name: e.string().min(1).max(150).openapi({ description: "The name of the flow" }),
|
|
228
|
+
actions: e.array(fe).optional().default([]).openapi({ description: "The list of actions to execute in sequence" })
|
|
229
|
+
}).extend(n.shape).extend({ id: e.string().openapi({
|
|
230
|
+
description: "Unique identifier for the flow",
|
|
231
|
+
example: "af_12tMpdJ3iek7svMyZkSh5M"
|
|
232
|
+
}) }), e.object({
|
|
233
|
+
page: e.string().min(0).optional().default("0").transform((e) => parseInt(e, 10)).openapi({ description: "The page number where 0 is the first page" }),
|
|
234
|
+
per_page: e.string().min(1).optional().default("10").transform((e) => parseInt(e, 10)).openapi({ description: "The number of items per page" }),
|
|
235
|
+
include_totals: e.string().optional().default("false").transform((e) => e === "true").openapi({ description: "If the total number of items should be included in the response" }),
|
|
236
|
+
sort: e.string().regex(/^.+:(-1|1)$/).optional().openapi({ description: "A property that should have the format 'string:-1' or 'string:1'" }),
|
|
237
|
+
q: e.string().optional().openapi({ description: "A lucene query string used to filter the results" })
|
|
238
|
+
}), e.object({
|
|
239
|
+
start: e.number(),
|
|
240
|
+
limit: e.number(),
|
|
241
|
+
length: e.number(),
|
|
242
|
+
total: e.number().optional()
|
|
243
|
+
});
|
|
244
|
+
var pe = e.object({
|
|
245
|
+
email: e.string().optional(),
|
|
246
|
+
email_verified: e.boolean().optional(),
|
|
247
|
+
name: e.string().optional(),
|
|
248
|
+
username: e.string().optional(),
|
|
249
|
+
given_name: e.string().optional(),
|
|
250
|
+
phone_number: e.string().optional(),
|
|
251
|
+
phone_verified: e.boolean().optional(),
|
|
252
|
+
family_name: e.string().optional()
|
|
253
|
+
}).catchall(e.any()), me = e.object({
|
|
254
|
+
connection: e.string(),
|
|
255
|
+
user_id: e.string(),
|
|
256
|
+
provider: e.string(),
|
|
257
|
+
isSocial: e.boolean(),
|
|
258
|
+
email: e.string().optional(),
|
|
259
|
+
email_verified: e.boolean().optional(),
|
|
260
|
+
phone_number: e.string().optional(),
|
|
261
|
+
phone_verified: e.boolean().optional(),
|
|
262
|
+
username: e.string().optional(),
|
|
263
|
+
access_token: e.string().optional(),
|
|
264
|
+
access_token_secret: e.string().optional(),
|
|
265
|
+
refresh_token: e.string().optional(),
|
|
266
|
+
profileData: pe.optional()
|
|
267
|
+
}), he = e.object({
|
|
268
|
+
formatted: e.string().optional(),
|
|
269
|
+
street_address: e.string().optional(),
|
|
270
|
+
locality: e.string().optional(),
|
|
271
|
+
region: e.string().optional(),
|
|
272
|
+
postal_code: e.string().optional(),
|
|
273
|
+
country: e.string().optional()
|
|
274
|
+
}).optional(), ge = e.object({
|
|
275
|
+
email: e.string().transform((e) => e.toLowerCase()).optional(),
|
|
276
|
+
username: e.string().refine((e) => !e.includes("@"), { message: "Usernames must not contain \"@\". Use the email field for email addresses." }).optional(),
|
|
277
|
+
phone_number: e.string().optional(),
|
|
278
|
+
phone_verified: e.boolean().optional(),
|
|
279
|
+
given_name: e.string().optional(),
|
|
280
|
+
family_name: e.string().optional(),
|
|
281
|
+
nickname: e.string().optional(),
|
|
282
|
+
name: e.string().optional(),
|
|
283
|
+
picture: e.string().optional(),
|
|
284
|
+
locale: e.string().optional(),
|
|
285
|
+
linked_to: e.string().optional(),
|
|
286
|
+
profileData: e.string().optional(),
|
|
287
|
+
user_id: e.string().optional(),
|
|
288
|
+
app_metadata: e.any().default({}).optional(),
|
|
289
|
+
user_metadata: e.any().default({}).optional(),
|
|
290
|
+
middle_name: e.string().optional(),
|
|
291
|
+
preferred_username: e.string().optional(),
|
|
292
|
+
profile: e.string().optional(),
|
|
293
|
+
website: e.string().optional(),
|
|
294
|
+
gender: e.string().optional(),
|
|
295
|
+
birthdate: e.string().optional(),
|
|
296
|
+
zoneinfo: e.string().optional(),
|
|
297
|
+
address: he
|
|
298
|
+
});
|
|
299
|
+
ge.extend({
|
|
300
|
+
email_verified: e.boolean().default(!1),
|
|
301
|
+
verify_email: e.boolean().optional(),
|
|
302
|
+
last_ip: e.string().optional(),
|
|
303
|
+
last_login: e.string().optional(),
|
|
304
|
+
user_id: e.string().optional(),
|
|
305
|
+
provider: e.string().optional(),
|
|
306
|
+
connection: e.string(),
|
|
307
|
+
is_social: e.boolean().optional(),
|
|
308
|
+
registration_completed_at: e.string().optional(),
|
|
309
|
+
password: e.object({
|
|
310
|
+
hash: e.string(),
|
|
311
|
+
algorithm: e.string()
|
|
312
|
+
}).optional()
|
|
313
|
+
}).omit({ password: !0 }).extend(n.shape).extend({
|
|
314
|
+
user_id: e.string(),
|
|
315
|
+
provider: e.string(),
|
|
316
|
+
is_social: e.boolean(),
|
|
317
|
+
email: e.string().optional(),
|
|
318
|
+
login_count: e.number().default(0),
|
|
319
|
+
identities: e.array(me).optional()
|
|
320
|
+
}).omit({ registration_completed_at: !0 }), ge.extend({
|
|
321
|
+
login_count: e.number(),
|
|
322
|
+
multifactor: e.array(e.string()).optional(),
|
|
323
|
+
last_ip: e.string().optional(),
|
|
324
|
+
last_login: e.string().optional(),
|
|
325
|
+
user_id: e.string()
|
|
326
|
+
}).catchall(e.any());
|
|
327
|
+
var _e = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", ve = (e = 21) => {
|
|
328
|
+
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
329
|
+
for (; e--;) t += _e[n[e] & 63];
|
|
330
|
+
return t;
|
|
331
|
+
}, ye = e.object({
|
|
332
|
+
client_id: e.string().optional().openapi({ description: "ID of this client. Generated server-side if omitted (Auth0 behavior)." }),
|
|
333
|
+
name: e.string().min(1).openapi({ description: "Name of this client (min length: 1 character, does not allow < or >)." }),
|
|
334
|
+
description: e.string().max(140).optional().openapi({ description: "Free text description of this client (max length: 140 characters)." }),
|
|
335
|
+
global: e.boolean().default(!1).openapi({ description: "Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false)." }),
|
|
336
|
+
client_secret: e.string().default(() => ve()).optional().openapi({ description: "Client secret (which you must not make public)." }),
|
|
337
|
+
app_type: e.enum([
|
|
338
|
+
"native",
|
|
339
|
+
"spa",
|
|
340
|
+
"regular_web",
|
|
341
|
+
"non_interactive",
|
|
342
|
+
"resource_server",
|
|
343
|
+
"express_configuration",
|
|
344
|
+
"rms",
|
|
345
|
+
"box",
|
|
346
|
+
"cloudbees",
|
|
347
|
+
"concur",
|
|
348
|
+
"dropbox",
|
|
349
|
+
"mscrm",
|
|
350
|
+
"echosign",
|
|
351
|
+
"egnyte",
|
|
352
|
+
"newrelic",
|
|
353
|
+
"office365",
|
|
354
|
+
"salesforce",
|
|
355
|
+
"sentry",
|
|
356
|
+
"sharepoint",
|
|
357
|
+
"slack",
|
|
358
|
+
"springcm",
|
|
359
|
+
"zendesk",
|
|
360
|
+
"zoom",
|
|
361
|
+
"sso_integration",
|
|
362
|
+
"oag"
|
|
363
|
+
]).default("regular_web").optional().openapi({ description: "The type of application this client represents" }),
|
|
364
|
+
logo_uri: e.string().url().optional().openapi({ description: "URL of the logo to display for this client. Recommended size is 150x150 pixels." }),
|
|
365
|
+
is_first_party: e.boolean().default(!1).openapi({ description: "Whether this client a first party client (true) or not (false)." }),
|
|
366
|
+
oidc_conformant: e.boolean().default(!0).openapi({ description: "Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false)." }),
|
|
367
|
+
auth0_conformant: e.boolean().default(!0).openapi({ description: "Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance)." }),
|
|
368
|
+
callbacks: e.array(e.string()).default([]).optional().openapi({ description: "Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication." }),
|
|
369
|
+
allowed_origins: e.array(e.string()).default([]).optional().openapi({ description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs." }),
|
|
370
|
+
web_origins: e.array(e.string()).default([]).optional().openapi({ description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode." }),
|
|
371
|
+
client_aliases: e.array(e.string()).default([]).optional().openapi({ description: "List of audiences/realms for SAML protocol. Used by the wsfed addon." }),
|
|
372
|
+
allowed_clients: e.array(e.string()).default([]).optional().openapi({ description: "List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed." }),
|
|
373
|
+
connections: e.array(e.string()).default([]).optional().openapi({ description: "List of connection IDs enabled for this client. The order determines the display order on the login page." }),
|
|
374
|
+
allowed_logout_urls: e.array(e.string()).default([]).optional().openapi({ description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains." }),
|
|
375
|
+
session_transfer: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Native to Web SSO Configuration" }),
|
|
376
|
+
oidc_logout: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Configuration for OIDC backchannel logout" }),
|
|
377
|
+
grant_types: e.array(e.string()).default([]).optional().openapi({ description: "List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code." }),
|
|
378
|
+
jwt_configuration: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Configuration related to JWTs for the client." }),
|
|
379
|
+
signing_keys: e.array(e.record(e.string(), e.any())).default([]).optional().openapi({ description: "Signing certificates associated with this client." }),
|
|
380
|
+
encryption_key: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Encryption used for WsFed responses with this client." }),
|
|
381
|
+
sso: e.boolean().default(!1).openapi({ description: "Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false)." }),
|
|
382
|
+
sso_disabled: e.boolean().default(!1).openapi({ description: "Whether Single Sign On is disabled for this client. When true, existing SSO sessions will not be reused and users must authenticate every time." }),
|
|
383
|
+
cross_origin_authentication: e.boolean().default(!1).openapi({ description: "Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false)." }),
|
|
384
|
+
cross_origin_loc: e.string().url().optional().openapi({ description: "URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page." }),
|
|
385
|
+
custom_login_page_on: e.boolean().default(!1).openapi({ description: "Whether a custom login page is to be used (true) or the default provided login page (false)." }),
|
|
386
|
+
custom_login_page: e.string().optional().openapi({ description: "The content (HTML, CSS, JS) of the custom login page." }),
|
|
387
|
+
custom_login_page_preview: e.string().optional().openapi({ description: "The content (HTML, CSS, JS) of the custom login page. (Used on Previews)" }),
|
|
388
|
+
form_template: e.string().optional().openapi({ description: "HTML form template to be used for WS-Federation." }),
|
|
389
|
+
addons: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Addons enabled for this client and their associated configurations." }),
|
|
390
|
+
token_endpoint_auth_method: e.enum([
|
|
391
|
+
"none",
|
|
392
|
+
"client_secret_post",
|
|
393
|
+
"client_secret_basic",
|
|
394
|
+
"client_secret_jwt",
|
|
395
|
+
"private_key_jwt"
|
|
396
|
+
]).default("client_secret_basic").optional().openapi({ description: "Defines the requested authentication method for the token endpoint. `none` (public client), `client_secret_post` / `client_secret_basic` (HTTP POST / Basic), `client_secret_jwt` (RFC 7523 HMAC assertion using client_secret), or `private_key_jwt` (RFC 7523 asymmetric assertion verified against the client's `jwks` / `jwks_uri`)." }),
|
|
397
|
+
client_metadata: e.record(e.string(), e.string().max(255)).default({}).optional().openapi({ description: "Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?\"/()<>@ [Tab][Space]" }),
|
|
398
|
+
hide_sign_up_disabled_error: e.boolean().default(!1).optional().openapi({ description: "Enumeration-safe variant of the connection-level `disable_signup` flag. When a signup is blocked by the password connection and this is true, the identifier screen does not reveal that an email is unknown — it advances to the OTP/password challenge as if the account existed and fails at credential check. Mitigates email enumeration at the cost of UX: users without an account see a generic credential failure instead of an explicit signup-disabled message." }),
|
|
399
|
+
mobile: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Additional configuration for native mobile apps." }),
|
|
400
|
+
initiate_login_uri: e.string().url().optional().openapi({ description: "Initiate login uri, must be https" }),
|
|
401
|
+
native_social_login: e.record(e.string(), e.any()).default({}).optional(),
|
|
402
|
+
refresh_token: e.object({
|
|
403
|
+
rotation_type: e.enum(["rotating", "non-rotating"]).optional().openapi({ description: "Whether refresh tokens for this client are rotated on every exchange (Auth0 'rotating' behavior) or kept stable (legacy non-rotating). Defaults to 'non-rotating' when unset." }),
|
|
404
|
+
leeway: e.number().int().min(0).max(600).optional().openapi({ description: "Seconds after a parent token's first rotation during which presenting it again still mints a fresh sibling child instead of triggering reuse-detection. Defaults to 30s when unset." }),
|
|
405
|
+
expiration_type: e.enum(["expiring", "non-expiring"]).optional().openapi({ description: "Auth0-compatible: whether refresh tokens expire." }),
|
|
406
|
+
token_lifetime: e.number().int().min(0).optional().openapi({ description: "Auth0-compatible: refresh-token absolute lifetime in seconds." }),
|
|
407
|
+
infinite_token_lifetime: e.boolean().optional().openapi({ description: "Auth0-compatible: when true, refresh tokens have no absolute expiry." }),
|
|
408
|
+
idle_token_lifetime: e.number().int().min(0).optional().openapi({ description: "Auth0-compatible: refresh-token idle (sliding) lifetime in seconds." }),
|
|
409
|
+
infinite_idle_token_lifetime: e.boolean().optional().openapi({ description: "Auth0-compatible: when true, refresh tokens have no idle expiry." })
|
|
410
|
+
}).default({}).optional().openapi({ description: "Refresh token configuration" }),
|
|
411
|
+
default_organization: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Defines the default Organization ID and flows" }),
|
|
412
|
+
organization_usage: e.enum([
|
|
413
|
+
"deny",
|
|
414
|
+
"allow",
|
|
415
|
+
"require"
|
|
416
|
+
]).default("deny").optional().openapi({ description: "Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require." }),
|
|
417
|
+
organization_require_behavior: e.enum([
|
|
418
|
+
"no_prompt",
|
|
419
|
+
"pre_login_prompt",
|
|
420
|
+
"post_login_prompt"
|
|
421
|
+
]).default("no_prompt").optional().openapi({ description: "Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true." }),
|
|
422
|
+
client_authentication_methods: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Defines client authentication methods." }),
|
|
423
|
+
require_pushed_authorization_requests: e.boolean().default(!1).openapi({ description: "Makes the use of Pushed Authorization Requests mandatory for this client" }),
|
|
424
|
+
require_proof_of_possession: e.boolean().default(!1).openapi({ description: "Makes the use of Proof-of-Possession mandatory for this client" }),
|
|
425
|
+
signed_request_object: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "JWT-secured Authorization Requests (JAR) settings." }),
|
|
426
|
+
compliance_level: e.enum([
|
|
427
|
+
"none",
|
|
428
|
+
"fapi1_adv_pkj_par",
|
|
429
|
+
"fapi1_adv_mtls_par",
|
|
430
|
+
"fapi2_sp_pkj_mtls",
|
|
431
|
+
"fapi2_sp_mtls_mtls"
|
|
432
|
+
]).optional().openapi({ description: "Defines the compliance level for this client, which may restrict it's capabilities" }),
|
|
433
|
+
par_request_expiry: e.number().optional().openapi({ description: "Specifies how long, in seconds, a Pushed Authorization Request URI remains valid" }),
|
|
434
|
+
token_quota: e.record(e.string(), e.any()).default({}).optional(),
|
|
435
|
+
owner_user_id: e.string().optional().openapi({ description: "User ID of the consenting user when this client was created via IAT-gated Dynamic Client Registration. NULL for clients created via the Management API or open DCR." }),
|
|
436
|
+
registration_type: e.enum([
|
|
437
|
+
"manual",
|
|
438
|
+
"open_dcr",
|
|
439
|
+
"iat_dcr"
|
|
440
|
+
]).optional().openapi({ description: "Provenance of this client. `manual` = Management API; `open_dcr` = RFC 7591 without IAT; `iat_dcr` = RFC 7591 with an Initial Access Token." }),
|
|
441
|
+
registration_metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Arbitrary metadata captured at Dynamic Client Registration time that isn't a first-class client field (e.g. integration_type, domain). Also stores `iat_constraints` for clients created via IAT so RFC 7592 PUT can enforce field immutability." }),
|
|
442
|
+
user_linking_mode: e.enum(["builtin", "off"]).optional().openapi({ description: "Per-client override for the built-in email-based user-linking path. `builtin` runs the legacy in-process linking at user creation/email update. `off` disables the legacy path; linking only happens if the tenant has enabled the `account-linking` template hook. When unset, the service-level `userLinkingMode` default applies." })
|
|
443
|
+
});
|
|
444
|
+
e.object({
|
|
445
|
+
created_at: e.string(),
|
|
446
|
+
updated_at: e.string()
|
|
447
|
+
}).extend(ye.shape).extend({ client_id: e.string() });
|
|
448
|
+
var be = e.object({
|
|
449
|
+
client_id: e.string().min(1).openapi({ description: "ID of the client." }),
|
|
450
|
+
audience: e.string().min(1).openapi({ description: "The audience (API identifier) of this client grant." }),
|
|
451
|
+
scope: e.array(e.string()).optional().openapi({ description: "Scopes allowed for this client grant." }),
|
|
452
|
+
organization_usage: e.enum([
|
|
453
|
+
"deny",
|
|
454
|
+
"allow",
|
|
455
|
+
"require"
|
|
456
|
+
]).optional().openapi({ description: "Defines whether organizations can be used with client credentials exchanges for this grant." }),
|
|
457
|
+
allow_any_organization: e.boolean().optional().openapi({ description: "If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations." }),
|
|
458
|
+
is_system: e.boolean().optional().openapi({ description: "If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly." }),
|
|
459
|
+
subject_type: e.enum(["client", "user"]).optional().openapi({ description: "The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement." }),
|
|
460
|
+
authorization_details_types: e.array(e.string()).optional().openapi({ description: "Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement." })
|
|
461
|
+
}), xe = e.object({ id: e.string().openapi({ description: "ID of the client grant." }) }).extend(be.shape).extend({
|
|
462
|
+
created_at: e.string().optional(),
|
|
463
|
+
updated_at: e.string().optional()
|
|
464
|
+
});
|
|
465
|
+
e.array(xe);
|
|
466
|
+
var Se = e.enum(["iat", "rat"]), Ce = e.object({
|
|
467
|
+
id: e.string(),
|
|
468
|
+
token_hash: e.string(),
|
|
469
|
+
type: Se,
|
|
470
|
+
client_id: e.string().optional(),
|
|
471
|
+
sub: e.string().optional(),
|
|
472
|
+
constraints: e.record(e.string(), e.unknown()).optional(),
|
|
473
|
+
single_use: e.boolean().default(!1),
|
|
474
|
+
expires_at: e.string().optional()
|
|
475
|
+
});
|
|
476
|
+
e.object({
|
|
477
|
+
created_at: e.string(),
|
|
478
|
+
used_at: e.string().optional(),
|
|
479
|
+
revoked_at: e.string().optional()
|
|
480
|
+
}).extend(Ce.shape);
|
|
481
|
+
var p = e.object({
|
|
482
|
+
x: e.number(),
|
|
483
|
+
y: e.number()
|
|
484
|
+
}), we = /* @__PURE__ */ function(e) {
|
|
485
|
+
return e.RICH_TEXT = "RICH_TEXT", e.NEXT_BUTTON = "NEXT_BUTTON", e.BACK_BUTTON = "BACK_BUTTON", e.SUBMIT_BUTTON = "SUBMIT_BUTTON", e.DIVIDER = "DIVIDER", e.TEXT = "TEXT", e.EMAIL = "EMAIL", e.PASSWORD = "PASSWORD", e.NUMBER = "NUMBER", e.PHONE = "PHONE", e.DATE = "DATE", e.CHECKBOX = "CHECKBOX", e.RADIO = "RADIO", e.SELECT = "SELECT", e.HIDDEN = "HIDDEN", e.LEGAL = "LEGAL", e;
|
|
486
|
+
}({}), Te = /* @__PURE__ */ function(e) {
|
|
487
|
+
return e.BLOCK = "BLOCK", e.FIELD = "FIELD", e;
|
|
488
|
+
}({}), m = e.object({
|
|
489
|
+
id: e.string(),
|
|
490
|
+
category: e.nativeEnum(Te),
|
|
491
|
+
type: e.nativeEnum(we)
|
|
492
|
+
}), Ee = m.extend({
|
|
493
|
+
category: e.literal("BLOCK"),
|
|
494
|
+
type: e.literal("RICH_TEXT"),
|
|
495
|
+
config: e.object({ content: e.string() }).passthrough()
|
|
496
|
+
}), De = m.extend({
|
|
497
|
+
category: e.literal("BLOCK"),
|
|
498
|
+
type: e.union([
|
|
499
|
+
e.literal("NEXT_BUTTON"),
|
|
500
|
+
e.literal("BACK_BUTTON"),
|
|
501
|
+
e.literal("SUBMIT_BUTTON")
|
|
502
|
+
]),
|
|
503
|
+
config: e.object({ text: e.string() }).passthrough()
|
|
504
|
+
}), Oe = m.extend({
|
|
505
|
+
category: e.literal("FIELD"),
|
|
506
|
+
type: e.literal("LEGAL"),
|
|
507
|
+
required: e.boolean().optional(),
|
|
508
|
+
sensitive: e.boolean().optional(),
|
|
509
|
+
config: e.object({ text: e.string() }).passthrough()
|
|
510
|
+
}), ke = m.extend({
|
|
511
|
+
category: e.literal("FIELD"),
|
|
512
|
+
type: e.union([
|
|
513
|
+
e.literal("TEXT"),
|
|
514
|
+
e.literal("EMAIL"),
|
|
515
|
+
e.literal("PASSWORD"),
|
|
516
|
+
e.literal("NUMBER"),
|
|
517
|
+
e.literal("PHONE"),
|
|
518
|
+
e.literal("DATE"),
|
|
519
|
+
e.literal("CHECKBOX"),
|
|
520
|
+
e.literal("RADIO"),
|
|
521
|
+
e.literal("SELECT"),
|
|
522
|
+
e.literal("HIDDEN")
|
|
523
|
+
]),
|
|
524
|
+
required: e.boolean().optional(),
|
|
525
|
+
sensitive: e.boolean().optional(),
|
|
526
|
+
config: e.object({
|
|
527
|
+
label: e.string().optional(),
|
|
528
|
+
placeholder: e.string().optional()
|
|
529
|
+
}).passthrough()
|
|
530
|
+
}), Ae = e.object({
|
|
531
|
+
id: e.string(),
|
|
532
|
+
category: e.string(),
|
|
533
|
+
type: e.string()
|
|
534
|
+
}).passthrough(), je = e.union([
|
|
535
|
+
Ee,
|
|
536
|
+
De,
|
|
537
|
+
Oe,
|
|
538
|
+
ke,
|
|
539
|
+
Ae
|
|
540
|
+
]), Me = e.object({
|
|
541
|
+
id: e.string(),
|
|
542
|
+
type: e.literal("STEP"),
|
|
543
|
+
coordinates: p,
|
|
544
|
+
alias: e.string().optional(),
|
|
545
|
+
config: e.object({
|
|
546
|
+
components: e.array(je),
|
|
547
|
+
next_node: e.string()
|
|
548
|
+
}).passthrough()
|
|
549
|
+
}), Ne = e.object({
|
|
550
|
+
id: e.string(),
|
|
551
|
+
type: e.literal("FLOW"),
|
|
552
|
+
coordinates: p,
|
|
553
|
+
alias: e.string().optional(),
|
|
554
|
+
config: e.object({
|
|
555
|
+
flow_id: e.string(),
|
|
556
|
+
next_node: e.string()
|
|
557
|
+
})
|
|
558
|
+
}), Pe = e.object({
|
|
559
|
+
id: e.string(),
|
|
560
|
+
type: e.literal("ACTION"),
|
|
561
|
+
coordinates: p,
|
|
562
|
+
alias: e.string().optional(),
|
|
563
|
+
config: e.object({
|
|
564
|
+
action_type: e.enum(["REDIRECT"]).openapi({ description: "The type of action to perform" }),
|
|
565
|
+
target: e.enum([
|
|
566
|
+
"change-email",
|
|
567
|
+
"account",
|
|
568
|
+
"custom"
|
|
569
|
+
]).openapi({ description: "The predefined target to redirect to" }),
|
|
570
|
+
custom_url: e.string().optional().openapi({ description: "Custom URL when target is 'custom'" }),
|
|
571
|
+
next_node: e.string().openapi({ description: "The next node to navigate to after action (for non-redirect actions)" })
|
|
572
|
+
}).passthrough()
|
|
573
|
+
}), Fe = e.object({
|
|
574
|
+
id: e.string(),
|
|
575
|
+
type: e.string(),
|
|
576
|
+
coordinates: p
|
|
577
|
+
}).passthrough(), Ie = e.union([
|
|
578
|
+
Me,
|
|
579
|
+
Ne,
|
|
580
|
+
Pe,
|
|
581
|
+
Fe
|
|
582
|
+
]), Le = e.object({
|
|
583
|
+
next_node: e.string(),
|
|
584
|
+
coordinates: p
|
|
585
|
+
}).passthrough(), Re = e.object({
|
|
586
|
+
resume_flow: e.boolean().optional(),
|
|
587
|
+
coordinates: p
|
|
588
|
+
}).passthrough();
|
|
589
|
+
e.object({
|
|
590
|
+
id: e.string(),
|
|
591
|
+
name: e.string(),
|
|
592
|
+
languages: e.object({ primary: e.string() }).passthrough(),
|
|
593
|
+
nodes: e.array(Ie),
|
|
594
|
+
start: Le,
|
|
595
|
+
ending: Re,
|
|
596
|
+
created_at: e.string(),
|
|
597
|
+
updated_at: e.string(),
|
|
598
|
+
links: e.object({
|
|
599
|
+
sdkSrc: e.string().optional(),
|
|
600
|
+
sdk_src: e.string().optional()
|
|
601
|
+
}).passthrough()
|
|
602
|
+
}).passthrough().omit({
|
|
603
|
+
id: !0,
|
|
604
|
+
created_at: !0,
|
|
605
|
+
updated_at: !0
|
|
606
|
+
});
|
|
607
|
+
var ze = /* @__PURE__ */ function(e) {
|
|
608
|
+
return e.TOKEN = "token", e.ID_TOKEN = "id_token", e.TOKEN_ID_TOKEN = "id_token token", e.CODE = "code", e.CODE_ID_TOKEN = "code id_token", e.CODE_TOKEN = "code token", e.CODE_ID_TOKEN_TOKEN = "code id_token token", e;
|
|
609
|
+
}({}), Be = /* @__PURE__ */ function(e) {
|
|
610
|
+
return e.QUERY = "query", e.FRAGMENT = "fragment", e.FORM_POST = "form_post", e.WEB_MESSAGE = "web_message", e.SAML_POST = "saml_post", e;
|
|
611
|
+
}({}), Ve = /* @__PURE__ */ function(e) {
|
|
612
|
+
return e.S256 = "S256", e.Plain = "plain", e;
|
|
613
|
+
}({}), h = e.union([e.null(), e.object({
|
|
614
|
+
essential: e.boolean().optional(),
|
|
615
|
+
value: e.unknown().optional(),
|
|
616
|
+
values: e.array(e.unknown()).optional()
|
|
617
|
+
})]).nullable(), He = e.object({
|
|
618
|
+
userinfo: e.record(e.string(), h).optional(),
|
|
619
|
+
id_token: e.record(e.string(), h).optional()
|
|
620
|
+
}), Ue = e.object({
|
|
621
|
+
client_id: e.string(),
|
|
622
|
+
act_as: e.string().optional(),
|
|
623
|
+
response_type: e.nativeEnum(ze).optional(),
|
|
624
|
+
response_mode: e.nativeEnum(Be).optional(),
|
|
625
|
+
redirect_uri: e.string().optional(),
|
|
626
|
+
audience: e.string().optional(),
|
|
627
|
+
organization: e.string().optional(),
|
|
628
|
+
state: e.string().optional(),
|
|
629
|
+
nonce: e.string().optional(),
|
|
630
|
+
scope: e.string().optional(),
|
|
631
|
+
prompt: e.string().optional(),
|
|
632
|
+
code_challenge_method: e.nativeEnum(Ve).optional(),
|
|
633
|
+
code_challenge: e.string().optional(),
|
|
634
|
+
username: e.string().optional(),
|
|
635
|
+
ui_locales: e.string().optional(),
|
|
636
|
+
max_age: e.number().optional(),
|
|
637
|
+
acr_values: e.string().optional(),
|
|
638
|
+
claims: He.optional(),
|
|
639
|
+
vendor_id: e.string().optional()
|
|
640
|
+
});
|
|
641
|
+
e.object({
|
|
642
|
+
colors: e.object({
|
|
643
|
+
primary: e.string(),
|
|
644
|
+
page_background: e.union([e.string(), e.object({
|
|
645
|
+
type: e.string().optional(),
|
|
646
|
+
start: e.string().optional(),
|
|
647
|
+
end: e.string().optional(),
|
|
648
|
+
angle_deg: e.number().optional()
|
|
649
|
+
})]).optional()
|
|
650
|
+
}).optional(),
|
|
651
|
+
logo_url: e.string().optional(),
|
|
652
|
+
favicon_url: e.string().optional(),
|
|
653
|
+
powered_by_logo_url: e.string().optional(),
|
|
654
|
+
font: e.object({ url: e.string() }).optional(),
|
|
655
|
+
dark_mode: e.enum([
|
|
656
|
+
"dark",
|
|
657
|
+
"light",
|
|
658
|
+
"auto"
|
|
659
|
+
]).optional()
|
|
660
|
+
});
|
|
661
|
+
var We = e.enum([
|
|
662
|
+
"password_reset",
|
|
663
|
+
"email_verification",
|
|
664
|
+
"otp",
|
|
665
|
+
"mfa_otp",
|
|
666
|
+
"authorization_code",
|
|
667
|
+
"oauth2_state",
|
|
668
|
+
"ticket"
|
|
669
|
+
]);
|
|
670
|
+
e.object({
|
|
671
|
+
code_id: e.string().openapi({ description: "The code that will be used in for instance an email verification flow" }),
|
|
672
|
+
login_id: e.string().openapi({ description: "The id of the login session that the code is connected to" }),
|
|
673
|
+
connection_id: e.string().optional().openapi({ description: "The connection that the code is connected to" }),
|
|
674
|
+
code_type: We,
|
|
675
|
+
code_verifier: e.string().optional().openapi({ description: "The code verifier used in PKCE in outbound flows" }),
|
|
676
|
+
code_challenge: e.string().optional().openapi({ description: "The code challenge used in PKCE in outbound flows" }),
|
|
677
|
+
code_challenge_method: e.enum(["plain", "S256"]).optional().openapi({ description: "The code challenge method used in PKCE in outbound flows" }),
|
|
678
|
+
redirect_uri: e.string().optional().openapi({ description: "The redirect URI associated with the code" }),
|
|
679
|
+
otp: e.string().optional().openapi({ description: "The one-time password value for OTP-based flows" }),
|
|
680
|
+
nonce: e.string().optional().openapi({ description: "The nonce value used for security in OIDC flows" }),
|
|
681
|
+
state: e.string().optional().openapi({ description: "The state parameter used for CSRF protection in OAuth flows" }),
|
|
682
|
+
expires_at: e.string(),
|
|
683
|
+
used_at: e.string().optional(),
|
|
684
|
+
user_id: e.string().optional()
|
|
685
|
+
}).extend({ created_at: e.string() });
|
|
686
|
+
var Ge = e.object({
|
|
687
|
+
kid: e.string().optional(),
|
|
688
|
+
team_id: e.string().optional(),
|
|
689
|
+
realms: e.string().optional(),
|
|
690
|
+
authentication_method: e.string().optional(),
|
|
691
|
+
client_id: e.string().optional(),
|
|
692
|
+
client_secret: e.string().optional(),
|
|
693
|
+
app_secret: e.string().optional(),
|
|
694
|
+
scope: e.string().optional(),
|
|
695
|
+
authorization_endpoint: e.string().optional(),
|
|
696
|
+
token_endpoint: e.string().optional(),
|
|
697
|
+
userinfo_endpoint: e.string().optional(),
|
|
698
|
+
jwks_uri: e.string().optional(),
|
|
699
|
+
discovery_url: e.string().optional(),
|
|
700
|
+
issuer: e.string().optional(),
|
|
701
|
+
token_endpoint_auth_method: e.enum(["client_secret_basic", "client_secret_post"]).optional(),
|
|
702
|
+
provider: e.string().optional(),
|
|
703
|
+
from: e.string().optional(),
|
|
704
|
+
twilio_sid: e.string().optional(),
|
|
705
|
+
twilio_token: e.string().optional(),
|
|
706
|
+
icon_url: e.string().optional(),
|
|
707
|
+
domain_aliases: e.array(e.string()).optional(),
|
|
708
|
+
callback_url: e.string().url().optional(),
|
|
709
|
+
passwordPolicy: e.enum([
|
|
710
|
+
"none",
|
|
711
|
+
"low",
|
|
712
|
+
"fair",
|
|
713
|
+
"good",
|
|
714
|
+
"excellent"
|
|
715
|
+
]).optional(),
|
|
716
|
+
password_complexity_options: e.object({ min_length: e.number().optional() }).optional(),
|
|
717
|
+
password_history: e.object({
|
|
718
|
+
enable: e.boolean().optional(),
|
|
719
|
+
size: e.number().optional()
|
|
720
|
+
}).optional(),
|
|
721
|
+
password_no_personal_info: e.object({ enable: e.boolean().optional() }).optional(),
|
|
722
|
+
password_dictionary: e.object({
|
|
723
|
+
enable: e.boolean().optional(),
|
|
724
|
+
dictionary: e.array(e.string()).optional()
|
|
725
|
+
}).optional(),
|
|
726
|
+
disable_signup: e.boolean().optional(),
|
|
727
|
+
brute_force_protection: e.boolean().optional(),
|
|
728
|
+
import_mode: e.boolean().optional(),
|
|
729
|
+
configuration: e.object({
|
|
730
|
+
token_endpoint: e.string().optional(),
|
|
731
|
+
userinfo_endpoint: e.string().optional(),
|
|
732
|
+
client_id: e.string().optional(),
|
|
733
|
+
client_secret: e.string().optional(),
|
|
734
|
+
realm: e.string().optional()
|
|
735
|
+
}).optional(),
|
|
736
|
+
attributes: e.object({
|
|
737
|
+
email: e.object({
|
|
738
|
+
identifier: e.object({ active: e.boolean().optional() }).optional(),
|
|
739
|
+
signup: e.object({
|
|
740
|
+
status: e.enum([
|
|
741
|
+
"required",
|
|
742
|
+
"optional",
|
|
743
|
+
"disabled"
|
|
744
|
+
]).optional(),
|
|
745
|
+
verification: e.object({ active: e.boolean().optional() }).optional()
|
|
746
|
+
}).optional(),
|
|
747
|
+
validation: e.object({ allowed: e.boolean().optional() }).optional(),
|
|
748
|
+
unique: e.boolean().optional(),
|
|
749
|
+
profile_required: e.boolean().optional(),
|
|
750
|
+
verification_method: e.enum(["link", "code"]).optional()
|
|
751
|
+
}).optional(),
|
|
752
|
+
username: e.object({
|
|
753
|
+
identifier: e.object({ active: e.boolean().optional() }).optional(),
|
|
754
|
+
signup: e.object({ status: e.enum([
|
|
755
|
+
"required",
|
|
756
|
+
"optional",
|
|
757
|
+
"disabled"
|
|
758
|
+
]).optional() }).optional(),
|
|
759
|
+
validation: e.object({
|
|
760
|
+
max_length: e.number().optional(),
|
|
761
|
+
min_length: e.number().optional(),
|
|
762
|
+
allowed_types: e.object({
|
|
763
|
+
email: e.boolean().optional(),
|
|
764
|
+
phone_number: e.boolean().optional()
|
|
765
|
+
}).optional()
|
|
766
|
+
}).optional(),
|
|
767
|
+
profile_required: e.boolean().optional()
|
|
768
|
+
}).optional(),
|
|
769
|
+
phone_number: e.object({
|
|
770
|
+
identifier: e.object({ active: e.boolean().optional() }).optional(),
|
|
771
|
+
signup: e.object({ status: e.enum([
|
|
772
|
+
"required",
|
|
773
|
+
"optional",
|
|
774
|
+
"disabled"
|
|
775
|
+
]).optional() }).optional()
|
|
776
|
+
}).optional()
|
|
777
|
+
}).optional(),
|
|
778
|
+
authentication_methods: e.object({
|
|
779
|
+
password: e.object({ enabled: e.boolean().optional() }).optional(),
|
|
780
|
+
passkey: e.object({ enabled: e.boolean().optional() }).optional()
|
|
781
|
+
}).optional(),
|
|
782
|
+
passkey_options: e.object({
|
|
783
|
+
challenge_ui: e.enum([
|
|
784
|
+
"both",
|
|
785
|
+
"autofill",
|
|
786
|
+
"button"
|
|
787
|
+
]).optional(),
|
|
788
|
+
local_enrollment_enabled: e.boolean().optional(),
|
|
789
|
+
progressive_enrollment_enabled: e.boolean().optional()
|
|
790
|
+
}).optional(),
|
|
791
|
+
requires_username: e.boolean().optional(),
|
|
792
|
+
validation: e.object({ username: e.object({
|
|
793
|
+
min: e.number().optional(),
|
|
794
|
+
max: e.number().optional()
|
|
795
|
+
}).optional() }).optional(),
|
|
796
|
+
set_user_root_attributes: e.enum([
|
|
797
|
+
"on_each_login",
|
|
798
|
+
"on_first_login",
|
|
799
|
+
"never_on_login"
|
|
800
|
+
]).optional()
|
|
801
|
+
});
|
|
802
|
+
function g(e) {
|
|
803
|
+
if (e !== null) {
|
|
804
|
+
if (Array.isArray(e)) return e.filter((e) => e !== null).map(g);
|
|
805
|
+
if (e && typeof e == "object") {
|
|
806
|
+
let t = {};
|
|
807
|
+
for (let [n, r] of Object.entries(e)) r !== null && (t[n] = g(r));
|
|
808
|
+
return t;
|
|
809
|
+
}
|
|
810
|
+
return e;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
var Ke = e.object({
|
|
814
|
+
id: e.string().optional(),
|
|
815
|
+
name: e.string(),
|
|
816
|
+
display_name: e.string().optional(),
|
|
817
|
+
strategy: e.string(),
|
|
818
|
+
options: e.preprocess((e) => e === null ? {} : g(e), Ge).default({}),
|
|
819
|
+
enabled_clients: e.array(e.string()).default([]).optional(),
|
|
820
|
+
response_type: e.custom().optional(),
|
|
821
|
+
response_mode: e.custom().optional(),
|
|
822
|
+
is_domain_connection: e.boolean().optional(),
|
|
823
|
+
show_as_button: e.boolean().optional(),
|
|
824
|
+
metadata: e.record(e.string(), e.any()).optional(),
|
|
825
|
+
is_system: e.boolean().optional()
|
|
826
|
+
});
|
|
827
|
+
e.object({
|
|
828
|
+
id: e.string(),
|
|
829
|
+
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
830
|
+
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
831
|
+
}).extend(Ke.shape);
|
|
832
|
+
var qe = e.object({
|
|
833
|
+
domain: e.string(),
|
|
834
|
+
custom_domain_id: e.string().optional(),
|
|
835
|
+
type: e.enum(["auth0_managed_certs", "self_managed_certs"]),
|
|
836
|
+
verification_method: e.enum(["txt"]).optional(),
|
|
837
|
+
tls_policy: e.enum(["recommended"]).optional(),
|
|
838
|
+
custom_client_ip_header: e.enum([
|
|
839
|
+
"true-client-ip",
|
|
840
|
+
"cf-connecting-ip",
|
|
841
|
+
"x-forwarded-for",
|
|
842
|
+
"x-azure-clientip",
|
|
843
|
+
"null"
|
|
844
|
+
]).optional(),
|
|
845
|
+
domain_metadata: e.record(e.string(), e.string().max(255)).optional()
|
|
846
|
+
}), Je = e.discriminatedUnion("name", [e.object({
|
|
847
|
+
name: e.literal("txt"),
|
|
848
|
+
record: e.string(),
|
|
849
|
+
domain: e.string()
|
|
850
|
+
}), e.object({
|
|
851
|
+
name: e.literal("http"),
|
|
852
|
+
http_body: e.string(),
|
|
853
|
+
http_url: e.string()
|
|
854
|
+
})]);
|
|
855
|
+
qe.extend({
|
|
856
|
+
custom_domain_id: e.string(),
|
|
857
|
+
primary: e.boolean(),
|
|
858
|
+
status: e.enum([
|
|
859
|
+
"disabled",
|
|
860
|
+
"pending",
|
|
861
|
+
"pending_verification",
|
|
862
|
+
"ready"
|
|
863
|
+
]),
|
|
864
|
+
origin_domain_name: e.string().optional(),
|
|
865
|
+
verification: e.object({ methods: e.array(Je) }).optional(),
|
|
866
|
+
tls_policy: e.string().optional()
|
|
867
|
+
}).extend({ tenant_id: e.string() });
|
|
868
|
+
var _ = e.object({
|
|
869
|
+
id: e.string(),
|
|
870
|
+
order: e.number().optional(),
|
|
871
|
+
visible: e.boolean().optional().default(!0)
|
|
872
|
+
}), v = _.extend({ category: e.literal("BLOCK").optional() }), Ye = v.extend({
|
|
873
|
+
type: e.literal("DIVIDER"),
|
|
874
|
+
config: e.object({ text: e.string().optional() }).optional()
|
|
875
|
+
}), Xe = v.extend({
|
|
876
|
+
type: e.literal("HTML"),
|
|
877
|
+
config: e.object({ content: e.string().optional() }).optional()
|
|
878
|
+
}), Ze = v.extend({
|
|
879
|
+
type: e.literal("IMAGE"),
|
|
880
|
+
config: e.object({
|
|
881
|
+
src: e.string().optional(),
|
|
882
|
+
alt: e.string().optional(),
|
|
883
|
+
width: e.number().optional(),
|
|
884
|
+
height: e.number().optional()
|
|
885
|
+
}).optional()
|
|
886
|
+
}), Qe = v.extend({
|
|
887
|
+
type: e.literal("JUMP_BUTTON"),
|
|
888
|
+
config: e.object({
|
|
889
|
+
text: e.string().optional(),
|
|
890
|
+
target_step: e.string().optional()
|
|
891
|
+
})
|
|
892
|
+
}), $e = v.extend({
|
|
893
|
+
type: e.literal("RESEND_BUTTON"),
|
|
894
|
+
config: e.object({
|
|
895
|
+
text: e.string().optional(),
|
|
896
|
+
resend_action: e.string().optional()
|
|
897
|
+
})
|
|
898
|
+
}), et = v.extend({
|
|
899
|
+
type: e.literal("NEXT_BUTTON"),
|
|
900
|
+
config: e.object({ text: e.string().optional() })
|
|
901
|
+
}), tt = v.extend({
|
|
902
|
+
type: e.literal("PREVIOUS_BUTTON"),
|
|
903
|
+
config: e.object({ text: e.string().optional() })
|
|
904
|
+
}), nt = v.extend({
|
|
905
|
+
type: e.literal("RICH_TEXT"),
|
|
906
|
+
config: e.object({ content: e.string().optional() }).optional()
|
|
907
|
+
}), y = _.extend({
|
|
908
|
+
category: e.literal("WIDGET").optional(),
|
|
909
|
+
label: e.string().min(1).optional(),
|
|
910
|
+
hint: e.string().min(1).max(500).optional(),
|
|
911
|
+
required: e.boolean().optional(),
|
|
912
|
+
sensitive: e.boolean().optional()
|
|
913
|
+
}), rt = y.extend({
|
|
914
|
+
type: e.literal("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
915
|
+
config: e.object({ credential_type: e.string().optional() })
|
|
916
|
+
}), it = y.extend({
|
|
917
|
+
type: e.literal("GMAPS_ADDRESS"),
|
|
918
|
+
config: e.object({ api_key: e.string().optional() })
|
|
919
|
+
}), at = y.extend({
|
|
920
|
+
type: e.literal("RECAPTCHA"),
|
|
921
|
+
config: e.object({ site_key: e.string().optional() })
|
|
922
|
+
}), b = _.extend({
|
|
923
|
+
category: e.literal("FIELD").optional(),
|
|
924
|
+
label: e.string().min(1).optional(),
|
|
925
|
+
hint: e.string().min(1).max(500).optional(),
|
|
926
|
+
messages: e.array(e.object({
|
|
927
|
+
id: e.number().optional(),
|
|
928
|
+
text: e.string(),
|
|
929
|
+
type: e.enum([
|
|
930
|
+
"info",
|
|
931
|
+
"error",
|
|
932
|
+
"success",
|
|
933
|
+
"warning"
|
|
934
|
+
])
|
|
935
|
+
})).optional(),
|
|
936
|
+
required: e.boolean().optional(),
|
|
937
|
+
sensitive: e.boolean().optional()
|
|
938
|
+
}), ot = b.extend({
|
|
939
|
+
type: e.literal("BOOLEAN"),
|
|
940
|
+
config: e.object({ default_value: e.boolean().optional() }).optional()
|
|
941
|
+
}), st = b.extend({
|
|
942
|
+
type: e.literal("CARDS"),
|
|
943
|
+
config: e.object({
|
|
944
|
+
options: e.array(e.object({
|
|
945
|
+
value: e.string(),
|
|
946
|
+
label: e.string(),
|
|
947
|
+
description: e.string().optional(),
|
|
948
|
+
image: e.string().optional()
|
|
949
|
+
})).optional(),
|
|
950
|
+
multi_select: e.boolean().optional()
|
|
951
|
+
}).optional()
|
|
952
|
+
}), ct = b.extend({
|
|
953
|
+
type: e.literal("CHOICE"),
|
|
954
|
+
config: e.object({
|
|
955
|
+
options: e.array(e.object({
|
|
956
|
+
value: e.string(),
|
|
957
|
+
label: e.string()
|
|
958
|
+
})).optional(),
|
|
959
|
+
display: e.enum(["radio", "checkbox"]).optional(),
|
|
960
|
+
multiple: e.boolean().optional(),
|
|
961
|
+
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
962
|
+
}).optional()
|
|
963
|
+
}), lt = b.extend({
|
|
964
|
+
type: e.literal("CUSTOM"),
|
|
965
|
+
config: e.object({
|
|
966
|
+
component: e.string().optional(),
|
|
967
|
+
props: e.record(e.string(), e.any()).optional(),
|
|
968
|
+
schema: e.record(e.string(), e.any()).optional(),
|
|
969
|
+
code: e.string().optional()
|
|
970
|
+
})
|
|
971
|
+
}), ut = b.extend({
|
|
972
|
+
type: e.literal("DATE"),
|
|
973
|
+
config: e.object({
|
|
974
|
+
format: e.string().optional(),
|
|
975
|
+
min: e.string().optional(),
|
|
976
|
+
max: e.string().optional(),
|
|
977
|
+
default_value: e.string().optional()
|
|
978
|
+
}).optional()
|
|
979
|
+
}), dt = b.extend({
|
|
980
|
+
type: e.literal("DROPDOWN"),
|
|
981
|
+
config: e.object({
|
|
982
|
+
options: e.array(e.object({
|
|
983
|
+
value: e.string(),
|
|
984
|
+
label: e.string()
|
|
985
|
+
})).optional(),
|
|
986
|
+
placeholder: e.string().optional(),
|
|
987
|
+
searchable: e.boolean().optional(),
|
|
988
|
+
multiple: e.boolean().optional(),
|
|
989
|
+
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
990
|
+
}).optional()
|
|
991
|
+
}), ft = b.extend({
|
|
992
|
+
type: e.literal("EMAIL"),
|
|
993
|
+
config: e.object({
|
|
994
|
+
placeholder: e.string().optional(),
|
|
995
|
+
default_value: e.string().optional()
|
|
996
|
+
}).optional()
|
|
997
|
+
}), pt = b.extend({
|
|
998
|
+
type: e.literal("FILE"),
|
|
999
|
+
config: e.object({
|
|
1000
|
+
accept: e.string().optional(),
|
|
1001
|
+
max_size: e.number().optional(),
|
|
1002
|
+
multiple: e.boolean().optional()
|
|
1003
|
+
}).optional()
|
|
1004
|
+
}), mt = b.extend({
|
|
1005
|
+
type: e.literal("LEGAL"),
|
|
1006
|
+
config: e.object({
|
|
1007
|
+
text: e.string(),
|
|
1008
|
+
html: e.boolean().optional()
|
|
1009
|
+
}).optional()
|
|
1010
|
+
}), ht = b.extend({
|
|
1011
|
+
type: e.literal("NUMBER"),
|
|
1012
|
+
config: e.object({
|
|
1013
|
+
placeholder: e.string().optional(),
|
|
1014
|
+
min: e.number().optional(),
|
|
1015
|
+
max: e.number().optional(),
|
|
1016
|
+
step: e.number().optional(),
|
|
1017
|
+
default_value: e.string().optional()
|
|
1018
|
+
}).optional()
|
|
1019
|
+
}), gt = b.extend({
|
|
1020
|
+
type: e.literal("PASSWORD"),
|
|
1021
|
+
config: e.object({
|
|
1022
|
+
placeholder: e.string().optional(),
|
|
1023
|
+
min_length: e.number().optional(),
|
|
1024
|
+
show_toggle: e.boolean().optional(),
|
|
1025
|
+
forgot_password_link: e.string().optional(),
|
|
1026
|
+
default_value: e.string().optional()
|
|
1027
|
+
}).optional()
|
|
1028
|
+
}), _t = b.extend({
|
|
1029
|
+
type: e.literal("PAYMENT"),
|
|
1030
|
+
config: e.object({
|
|
1031
|
+
provider: e.string().optional(),
|
|
1032
|
+
currency: e.string().optional()
|
|
1033
|
+
}).optional()
|
|
1034
|
+
}), vt = b.extend({
|
|
1035
|
+
type: e.literal("SOCIAL"),
|
|
1036
|
+
config: e.object({
|
|
1037
|
+
providers: e.array(e.string()).optional(),
|
|
1038
|
+
provider_details: e.array(e.object({
|
|
1039
|
+
name: e.string(),
|
|
1040
|
+
strategy: e.string().optional(),
|
|
1041
|
+
display_name: e.string().optional(),
|
|
1042
|
+
icon_url: e.string().optional(),
|
|
1043
|
+
href: e.string().optional()
|
|
1044
|
+
})).optional()
|
|
1045
|
+
}).optional()
|
|
1046
|
+
}), yt = b.extend({
|
|
1047
|
+
type: e.literal("TEL"),
|
|
1048
|
+
config: e.object({
|
|
1049
|
+
placeholder: e.string().optional(),
|
|
1050
|
+
default_country: e.string().optional(),
|
|
1051
|
+
default_value: e.string().optional(),
|
|
1052
|
+
allow_email: e.boolean().optional()
|
|
1053
|
+
}).optional()
|
|
1054
|
+
}), bt = b.extend({
|
|
1055
|
+
type: e.literal("TEXT"),
|
|
1056
|
+
config: e.object({
|
|
1057
|
+
placeholder: e.string().optional(),
|
|
1058
|
+
multiline: e.boolean().optional(),
|
|
1059
|
+
max_length: e.number().optional(),
|
|
1060
|
+
default_value: e.string().optional()
|
|
1061
|
+
}).optional()
|
|
1062
|
+
}), xt = b.extend({
|
|
1063
|
+
type: e.literal("COUNTRY"),
|
|
1064
|
+
config: e.object({
|
|
1065
|
+
placeholder: e.string().optional(),
|
|
1066
|
+
default_value: e.string().optional()
|
|
1067
|
+
}).optional()
|
|
1068
|
+
}), St = b.extend({
|
|
1069
|
+
type: e.literal("URL"),
|
|
1070
|
+
config: e.object({
|
|
1071
|
+
placeholder: e.string().optional(),
|
|
1072
|
+
default_value: e.string().optional()
|
|
1073
|
+
}).optional()
|
|
1074
|
+
}), Ct = e.discriminatedUnion("type", [
|
|
1075
|
+
Ye,
|
|
1076
|
+
Xe,
|
|
1077
|
+
Ze,
|
|
1078
|
+
Qe,
|
|
1079
|
+
$e,
|
|
1080
|
+
et,
|
|
1081
|
+
tt,
|
|
1082
|
+
nt
|
|
1083
|
+
]), wt = e.discriminatedUnion("type", [
|
|
1084
|
+
rt,
|
|
1085
|
+
it,
|
|
1086
|
+
at
|
|
1087
|
+
]), Tt = e.discriminatedUnion("type", [
|
|
1088
|
+
ot,
|
|
1089
|
+
st,
|
|
1090
|
+
ct,
|
|
1091
|
+
xt,
|
|
1092
|
+
lt,
|
|
1093
|
+
ut,
|
|
1094
|
+
dt,
|
|
1095
|
+
ft,
|
|
1096
|
+
pt,
|
|
1097
|
+
mt,
|
|
1098
|
+
ht,
|
|
1099
|
+
gt,
|
|
1100
|
+
_t,
|
|
1101
|
+
vt,
|
|
1102
|
+
yt,
|
|
1103
|
+
bt,
|
|
1104
|
+
St
|
|
1105
|
+
]), Et = e.union([
|
|
1106
|
+
Ct,
|
|
1107
|
+
wt,
|
|
1108
|
+
Tt
|
|
1109
|
+
]);
|
|
1110
|
+
new Set([
|
|
1111
|
+
"BOOLEAN",
|
|
1112
|
+
"CARDS",
|
|
1113
|
+
"CHOICE",
|
|
1114
|
+
"COUNTRY",
|
|
1115
|
+
"DATE",
|
|
1116
|
+
"DROPDOWN",
|
|
1117
|
+
"EMAIL",
|
|
1118
|
+
"LEGAL",
|
|
1119
|
+
"NUMBER",
|
|
1120
|
+
"PASSWORD",
|
|
1121
|
+
"TEL",
|
|
1122
|
+
"TEXT",
|
|
1123
|
+
"URL"
|
|
1124
|
+
]), e.object({
|
|
1125
|
+
id: e.string(),
|
|
1126
|
+
type: e.literal("submit"),
|
|
1127
|
+
label: e.string(),
|
|
1128
|
+
className: e.string().optional(),
|
|
1129
|
+
disabled: e.boolean().optional().default(!1),
|
|
1130
|
+
order: e.number().optional(),
|
|
1131
|
+
visible: e.boolean().optional().default(!0),
|
|
1132
|
+
customizations: e.record(e.string(), e.any()).optional()
|
|
1133
|
+
});
|
|
1134
|
+
var x = e.object({
|
|
1135
|
+
x: e.number(),
|
|
1136
|
+
y: e.number()
|
|
1137
|
+
}), Dt = e.object({
|
|
1138
|
+
id: e.string(),
|
|
1139
|
+
type: e.literal("FLOW"),
|
|
1140
|
+
coordinates: x,
|
|
1141
|
+
alias: e.string().min(1).max(150).optional(),
|
|
1142
|
+
config: e.object({
|
|
1143
|
+
flow_id: e.string().max(30),
|
|
1144
|
+
next_node: e.string().optional()
|
|
1145
|
+
})
|
|
1146
|
+
}), Ot = e.object({
|
|
1147
|
+
id: e.string(),
|
|
1148
|
+
type: e.literal("ROUTER"),
|
|
1149
|
+
coordinates: x,
|
|
1150
|
+
alias: e.string().min(1).max(150),
|
|
1151
|
+
config: e.object({
|
|
1152
|
+
rules: e.array(e.object({
|
|
1153
|
+
id: e.string(),
|
|
1154
|
+
alias: e.string().min(1).max(150).optional(),
|
|
1155
|
+
condition: e.any(),
|
|
1156
|
+
next_node: e.string()
|
|
1157
|
+
})),
|
|
1158
|
+
fallback: e.string()
|
|
1159
|
+
})
|
|
1160
|
+
}), kt = e.object({
|
|
1161
|
+
id: e.string(),
|
|
1162
|
+
type: e.literal("STEP"),
|
|
1163
|
+
coordinates: x,
|
|
1164
|
+
alias: e.string().min(1).max(150).optional(),
|
|
1165
|
+
config: e.object({
|
|
1166
|
+
components: e.array(Et),
|
|
1167
|
+
next_node: e.string().optional()
|
|
1168
|
+
})
|
|
1169
|
+
}), At = e.discriminatedUnion("type", [
|
|
1170
|
+
Dt,
|
|
1171
|
+
Ot,
|
|
1172
|
+
kt
|
|
1173
|
+
]), jt = e.object({
|
|
1174
|
+
name: e.string().openapi({ description: "The name of the form" }),
|
|
1175
|
+
messages: e.object({
|
|
1176
|
+
errors: e.record(e.string(), e.any()).optional(),
|
|
1177
|
+
custom: e.record(e.string(), e.any()).optional()
|
|
1178
|
+
}).optional(),
|
|
1179
|
+
languages: e.object({
|
|
1180
|
+
primary: e.string().optional(),
|
|
1181
|
+
default: e.string().optional()
|
|
1182
|
+
}).optional(),
|
|
1183
|
+
translations: e.record(e.string(), e.any()).optional(),
|
|
1184
|
+
nodes: e.array(At).optional(),
|
|
1185
|
+
start: e.object({
|
|
1186
|
+
hidden_fields: e.array(e.object({
|
|
1187
|
+
key: e.string(),
|
|
1188
|
+
value: e.string()
|
|
1189
|
+
})).optional(),
|
|
1190
|
+
next_node: e.string().optional(),
|
|
1191
|
+
coordinates: x.optional()
|
|
1192
|
+
}).optional(),
|
|
1193
|
+
ending: e.object({
|
|
1194
|
+
redirection: e.object({
|
|
1195
|
+
delay: e.number().optional(),
|
|
1196
|
+
target: e.string().optional()
|
|
1197
|
+
}).optional(),
|
|
1198
|
+
after_submit: e.object({ flow_id: e.string().optional() }).optional(),
|
|
1199
|
+
coordinates: x.optional(),
|
|
1200
|
+
resume_flow: e.boolean().optional()
|
|
1201
|
+
}).optional(),
|
|
1202
|
+
style: e.object({ css: e.string().optional() }).optional(),
|
|
1203
|
+
links: e.object({
|
|
1204
|
+
sdkSrc: e.string().optional(),
|
|
1205
|
+
sdk_src: e.string().optional()
|
|
1206
|
+
}).optional()
|
|
1207
|
+
}).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
|
|
1208
|
+
n.extend(jt.shape).extend({ id: e.string() });
|
|
1209
|
+
var Mt = e.object({
|
|
1210
|
+
id: e.number().optional(),
|
|
1211
|
+
text: e.string(),
|
|
1212
|
+
type: e.enum([
|
|
1213
|
+
"info",
|
|
1214
|
+
"error",
|
|
1215
|
+
"success",
|
|
1216
|
+
"warning"
|
|
1217
|
+
])
|
|
1218
|
+
}), Nt = e.object({
|
|
1219
|
+
id: e.string().optional(),
|
|
1220
|
+
text: e.string(),
|
|
1221
|
+
href: e.string(),
|
|
1222
|
+
linkText: e.string().optional()
|
|
1223
|
+
});
|
|
1224
|
+
e.object({
|
|
1225
|
+
name: e.string().optional(),
|
|
1226
|
+
action: e.string(),
|
|
1227
|
+
method: e.enum(["POST", "GET"]),
|
|
1228
|
+
title: e.string().optional(),
|
|
1229
|
+
description: e.string().optional(),
|
|
1230
|
+
components: e.array(Et),
|
|
1231
|
+
messages: e.array(Mt).optional(),
|
|
1232
|
+
links: e.array(Nt).optional(),
|
|
1233
|
+
footer: e.string().optional()
|
|
1234
|
+
});
|
|
1235
|
+
var S = e.enum([
|
|
1236
|
+
"pre-user-registration",
|
|
1237
|
+
"post-user-registration",
|
|
1238
|
+
"post-user-login",
|
|
1239
|
+
"post-user-update",
|
|
1240
|
+
"validate-registration-username",
|
|
1241
|
+
"pre-user-deletion",
|
|
1242
|
+
"post-user-deletion"
|
|
1243
|
+
]), C = e.enum([
|
|
1244
|
+
"pre-user-registration",
|
|
1245
|
+
"post-user-registration",
|
|
1246
|
+
"post-user-login",
|
|
1247
|
+
"validate-registration-username",
|
|
1248
|
+
"pre-user-deletion",
|
|
1249
|
+
"post-user-deletion"
|
|
1250
|
+
]), w = e.enum([
|
|
1251
|
+
"post-user-login",
|
|
1252
|
+
"post-user-registration",
|
|
1253
|
+
"post-user-update",
|
|
1254
|
+
"credentials-exchange"
|
|
1255
|
+
]), T = e.enum([
|
|
1256
|
+
"post-user-login",
|
|
1257
|
+
"credentials-exchange",
|
|
1258
|
+
"pre-user-registration",
|
|
1259
|
+
"post-user-registration"
|
|
1260
|
+
]), Pt = e.enum([
|
|
1261
|
+
"ensure-username",
|
|
1262
|
+
"set-preferred-username",
|
|
1263
|
+
"account-linking"
|
|
1264
|
+
]), E = {
|
|
1265
|
+
enabled: e.boolean().default(!1),
|
|
1266
|
+
synchronous: e.boolean().default(!1),
|
|
1267
|
+
priority: e.number().optional(),
|
|
1268
|
+
hook_id: e.string().optional(),
|
|
1269
|
+
metadata: e.record(e.string(), e.unknown()).optional()
|
|
1270
|
+
}, Ft = e.object({
|
|
1271
|
+
...E,
|
|
1272
|
+
trigger_id: S,
|
|
1273
|
+
url: e.string()
|
|
1274
|
+
}), It = e.object({
|
|
1275
|
+
...E,
|
|
1276
|
+
trigger_id: C,
|
|
1277
|
+
form_id: e.string()
|
|
1278
|
+
}), Lt = e.object({
|
|
1279
|
+
...E,
|
|
1280
|
+
trigger_id: w,
|
|
1281
|
+
template_id: Pt
|
|
1282
|
+
}), Rt = e.object({
|
|
1283
|
+
...E,
|
|
1284
|
+
trigger_id: T,
|
|
1285
|
+
code_id: e.string()
|
|
1286
|
+
});
|
|
1287
|
+
e.union([
|
|
1288
|
+
Ft,
|
|
1289
|
+
It,
|
|
1290
|
+
Lt,
|
|
1291
|
+
Rt
|
|
1292
|
+
]);
|
|
1293
|
+
var zt = e.object({
|
|
1294
|
+
...E,
|
|
1295
|
+
trigger_id: S
|
|
1296
|
+
}).extend(n.shape).extend({
|
|
1297
|
+
hook_id: e.string(),
|
|
1298
|
+
url: e.string()
|
|
1299
|
+
}), Bt = e.object({
|
|
1300
|
+
...E,
|
|
1301
|
+
trigger_id: C
|
|
1302
|
+
}).extend(n.shape).extend({
|
|
1303
|
+
hook_id: e.string(),
|
|
1304
|
+
form_id: e.string()
|
|
1305
|
+
}), Vt = e.object({
|
|
1306
|
+
...E,
|
|
1307
|
+
trigger_id: w
|
|
1308
|
+
}).extend(n.shape).extend({
|
|
1309
|
+
hook_id: e.string(),
|
|
1310
|
+
template_id: Pt
|
|
1311
|
+
}), Ht = e.object({
|
|
1312
|
+
...E,
|
|
1313
|
+
trigger_id: T
|
|
1314
|
+
}).extend(n.shape).extend({
|
|
1315
|
+
hook_id: e.string(),
|
|
1316
|
+
code_id: e.string()
|
|
1317
|
+
});
|
|
1318
|
+
e.union([
|
|
1319
|
+
zt,
|
|
1320
|
+
Bt,
|
|
1321
|
+
Vt,
|
|
1322
|
+
Ht
|
|
1323
|
+
]), e.object({
|
|
1324
|
+
code: e.string().max(1e5),
|
|
1325
|
+
secrets: e.record(e.string(), e.string()).optional()
|
|
1326
|
+
}).extend({
|
|
1327
|
+
id: e.string(),
|
|
1328
|
+
tenant_id: e.string()
|
|
1329
|
+
}).extend(n.shape);
|
|
1330
|
+
var Ut = e.object({ name: e.string().optional() }), Wt = e.object({ email: e.string().optional() }), Gt = e.object({
|
|
1331
|
+
id: e.string().optional(),
|
|
1332
|
+
organization_id: e.string().max(50),
|
|
1333
|
+
inviter: Ut,
|
|
1334
|
+
invitee: Wt,
|
|
1335
|
+
invitation_url: e.string().url(),
|
|
1336
|
+
client_id: e.string(),
|
|
1337
|
+
connection_id: e.string().optional(),
|
|
1338
|
+
app_metadata: e.record(e.string(), e.any()).default({}).optional(),
|
|
1339
|
+
user_metadata: e.record(e.string(), e.any()).default({}).optional(),
|
|
1340
|
+
ttl_sec: e.number().int().max(2592e3).default(604800).optional(),
|
|
1341
|
+
roles: e.array(e.string()).default([]).optional(),
|
|
1342
|
+
send_invitation_email: e.boolean().default(!0).optional()
|
|
1343
|
+
});
|
|
1344
|
+
e.object({
|
|
1345
|
+
id: e.string(),
|
|
1346
|
+
organization_id: e.string().max(50),
|
|
1347
|
+
created_at: e.string().datetime(),
|
|
1348
|
+
expires_at: e.string().datetime(),
|
|
1349
|
+
ticket_id: e.string().optional()
|
|
1350
|
+
}).extend(Gt.omit({ id: !0 }).shape);
|
|
1351
|
+
var Kt = e.object({
|
|
1352
|
+
alg: e.enum([
|
|
1353
|
+
"RS256",
|
|
1354
|
+
"RS384",
|
|
1355
|
+
"RS512",
|
|
1356
|
+
"ES256",
|
|
1357
|
+
"ES384",
|
|
1358
|
+
"ES512",
|
|
1359
|
+
"HS256",
|
|
1360
|
+
"HS384",
|
|
1361
|
+
"HS512"
|
|
1362
|
+
]),
|
|
1363
|
+
kid: e.string(),
|
|
1364
|
+
kty: e.enum([
|
|
1365
|
+
"RSA",
|
|
1366
|
+
"EC",
|
|
1367
|
+
"oct"
|
|
1368
|
+
]),
|
|
1369
|
+
use: e.enum(["sig", "enc"]).optional(),
|
|
1370
|
+
n: e.string().optional(),
|
|
1371
|
+
e: e.string().optional(),
|
|
1372
|
+
crv: e.string().optional(),
|
|
1373
|
+
x: e.string().optional(),
|
|
1374
|
+
y: e.string().optional(),
|
|
1375
|
+
x5t: e.string().optional(),
|
|
1376
|
+
x5c: e.array(e.string()).optional()
|
|
1377
|
+
}).superRefine((t, n) => {
|
|
1378
|
+
if (t.kty === "RSA") for (let r of ["n", "e"]) t[r] || n.addIssue({
|
|
1379
|
+
code: e.ZodIssueCode.custom,
|
|
1380
|
+
path: [r],
|
|
1381
|
+
message: `RSA JWK is missing required member '${r}'`
|
|
1382
|
+
});
|
|
1383
|
+
else if (t.kty === "EC") for (let r of [
|
|
1384
|
+
"crv",
|
|
1385
|
+
"x",
|
|
1386
|
+
"y"
|
|
1387
|
+
]) t[r] || n.addIssue({
|
|
1388
|
+
code: e.ZodIssueCode.custom,
|
|
1389
|
+
path: [r],
|
|
1390
|
+
message: `EC JWK is missing required member '${r}'`
|
|
1391
|
+
});
|
|
1392
|
+
});
|
|
1393
|
+
e.object({ keys: e.array(Kt) }), e.object({
|
|
1394
|
+
issuer: e.string(),
|
|
1395
|
+
authorization_endpoint: e.string(),
|
|
1396
|
+
token_endpoint: e.string(),
|
|
1397
|
+
userinfo_endpoint: e.string(),
|
|
1398
|
+
jwks_uri: e.string(),
|
|
1399
|
+
registration_endpoint: e.string().optional(),
|
|
1400
|
+
revocation_endpoint: e.string(),
|
|
1401
|
+
end_session_endpoint: e.string().optional(),
|
|
1402
|
+
scopes_supported: e.array(e.string()),
|
|
1403
|
+
response_types_supported: e.array(e.string()),
|
|
1404
|
+
grant_types_supported: e.array(e.string()).optional(),
|
|
1405
|
+
code_challenge_methods_supported: e.array(e.string()),
|
|
1406
|
+
response_modes_supported: e.array(e.string()),
|
|
1407
|
+
subject_types_supported: e.array(e.string()),
|
|
1408
|
+
id_token_signing_alg_values_supported: e.array(e.string()),
|
|
1409
|
+
token_endpoint_auth_methods_supported: e.array(e.string()),
|
|
1410
|
+
claims_supported: e.array(e.string()),
|
|
1411
|
+
request_uri_parameter_supported: e.boolean(),
|
|
1412
|
+
request_parameter_supported: e.boolean(),
|
|
1413
|
+
claims_parameter_supported: e.boolean().optional(),
|
|
1414
|
+
request_object_signing_alg_values_supported: e.array(e.string()).optional(),
|
|
1415
|
+
token_endpoint_auth_signing_alg_values_supported: e.array(e.string())
|
|
1416
|
+
});
|
|
1417
|
+
var qt = /* @__PURE__ */ function(e) {
|
|
1418
|
+
return e.PENDING = "pending", e.AUTHENTICATED = "authenticated", e.AWAITING_EMAIL_VERIFICATION = "awaiting_email_verification", e.AWAITING_MFA = "awaiting_mfa", e.AWAITING_HOOK = "awaiting_hook", e.AWAITING_CONTINUATION = "awaiting_continuation", e.COMPLETED = "completed", e.FAILED = "failed", e.EXPIRED = "expired", e;
|
|
1419
|
+
}({}), Jt = e.nativeEnum(qt), Yt = e.object({
|
|
1420
|
+
strategy: e.string(),
|
|
1421
|
+
strategy_type: e.string()
|
|
1422
|
+
});
|
|
1423
|
+
e.object({
|
|
1424
|
+
csrf_token: e.string(),
|
|
1425
|
+
auth0Client: e.string().optional(),
|
|
1426
|
+
authParams: Ue,
|
|
1427
|
+
expires_at: e.string(),
|
|
1428
|
+
deleted_at: e.string().optional(),
|
|
1429
|
+
ip: e.string().optional(),
|
|
1430
|
+
useragent: e.string().optional(),
|
|
1431
|
+
session_id: e.string().optional(),
|
|
1432
|
+
authorization_url: e.string().optional(),
|
|
1433
|
+
state: Jt.optional().default("pending"),
|
|
1434
|
+
state_data: e.string().optional(),
|
|
1435
|
+
failure_reason: e.string().optional(),
|
|
1436
|
+
user_id: e.string().optional(),
|
|
1437
|
+
auth_connection: e.string().optional(),
|
|
1438
|
+
auth_strategy: Yt.optional(),
|
|
1439
|
+
authenticated_at: e.string().optional()
|
|
1440
|
+
}).openapi({ description: "This represents a login sesion" }).extend({
|
|
1441
|
+
id: e.string().openapi({ description: "This is is used as the state in the universal login" }),
|
|
1442
|
+
created_at: e.string(),
|
|
1443
|
+
updated_at: e.string()
|
|
1444
|
+
});
|
|
1445
|
+
var D = {
|
|
1446
|
+
ACLS_SUMMARY: "acls_summary",
|
|
1447
|
+
ACTIONS_EXECUTION_FAILED: "actions_execution_failed",
|
|
1448
|
+
API_LIMIT: "api_limit",
|
|
1449
|
+
API_LIMIT_WARNING: "api_limit_warning",
|
|
1450
|
+
APPI: "appi",
|
|
1451
|
+
CIBA_EXCHANGE_FAILED: "ciba_exchange_failed",
|
|
1452
|
+
CIBA_EXCHANGE_SUCCEEDED: "ciba_exchange_succeeded",
|
|
1453
|
+
CIBA_START_FAILED: "ciba_start_failed",
|
|
1454
|
+
CIBA_START_SUCCEEDED: "ciba_start_succeeded",
|
|
1455
|
+
CODE_LINK_SENT: "cls",
|
|
1456
|
+
CODE_SENT: "cs",
|
|
1457
|
+
DEPRECATION_NOTICE: "depnote",
|
|
1458
|
+
FAILED_LOGIN: "f",
|
|
1459
|
+
FAILED_BY_CONNECTOR: "fc",
|
|
1460
|
+
FAILED_CHANGE_EMAIL: "fce",
|
|
1461
|
+
FAILED_BY_CORS: "fco",
|
|
1462
|
+
FAILED_CROSS_ORIGIN_AUTHENTICATION: "fcoa",
|
|
1463
|
+
FAILED_CHANGE_PASSWORD: "fcp",
|
|
1464
|
+
FAILED_POST_CHANGE_PASSWORD_HOOK: "fcph",
|
|
1465
|
+
FAILED_CHANGE_PHONE_NUMBER: "fcpn",
|
|
1466
|
+
FAILED_CHANGE_PASSWORD_REQUEST: "fcpr",
|
|
1467
|
+
FAILED_CONNECTOR_PROVISIONING: "fcpro",
|
|
1468
|
+
FAILED_CHANGE_USERNAME: "fcu",
|
|
1469
|
+
FAILED_DELEGATION: "fd",
|
|
1470
|
+
FAILED_DEVICE_ACTIVATION: "fdeac",
|
|
1471
|
+
FAILED_DEVICE_AUTHORIZATION_REQUEST: "fdeaz",
|
|
1472
|
+
USER_CANCELED_DEVICE_CONFIRMATION: "fdecc",
|
|
1473
|
+
FAILED_USER_DELETION: "fdu",
|
|
1474
|
+
FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN: "feacft",
|
|
1475
|
+
FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS: "feccft",
|
|
1476
|
+
FAILED_EXCHANGE_CUSTOM_TOKEN: "fecte",
|
|
1477
|
+
FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN: "fede",
|
|
1478
|
+
FAILED_FEDERATED_LOGOUT: "federated_logout_failed",
|
|
1479
|
+
FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN: "fens",
|
|
1480
|
+
FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN: "feoobft",
|
|
1481
|
+
FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN: "feotpft",
|
|
1482
|
+
FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN: "fepft",
|
|
1483
|
+
FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN: "fepotpft",
|
|
1484
|
+
FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN: "fercft",
|
|
1485
|
+
FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN: "ferrt",
|
|
1486
|
+
FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN: "fertft",
|
|
1487
|
+
FAILED_HOOK: "fh",
|
|
1488
|
+
FAILED_IMPERSONATION: "fimp",
|
|
1489
|
+
FAILED_INVITE_ACCEPT: "fi",
|
|
1490
|
+
FAILED_LOGOUT: "flo",
|
|
1491
|
+
FLOWS_EXECUTION_COMPLETED: "flows_execution_completed",
|
|
1492
|
+
FLOWS_EXECUTION_FAILED: "flows_execution_failed",
|
|
1493
|
+
FAILED_SENDING_NOTIFICATION: "fn",
|
|
1494
|
+
FORMS_SUBMISSION_FAILED: "forms_submission_failed",
|
|
1495
|
+
FORMS_SUBMISSION_SUCCEEDED: "forms_submission_succeeded",
|
|
1496
|
+
FAILED_LOGIN_INCORRECT_PASSWORD: "fp",
|
|
1497
|
+
FAILED_PUSHED_AUTHORIZATION_REQUEST: "fpar",
|
|
1498
|
+
FAILED_POST_USER_REGISTRATION_HOOK: "fpurh",
|
|
1499
|
+
FAILED_SIGNUP: "fs",
|
|
1500
|
+
FAILED_SILENT_AUTH: "fsa",
|
|
1501
|
+
FAILED_LOGIN_INVALID_EMAIL_USERNAME: "fu",
|
|
1502
|
+
FAILED_USERS_IMPORT: "fui",
|
|
1503
|
+
FAILED_VERIFICATION_EMAIL: "fv",
|
|
1504
|
+
FAILED_VERIFICATION_EMAIL_REQUEST: "fvr",
|
|
1505
|
+
EMAIL_VERIFICATION_CONFIRMED: "gd_auth_email_verification",
|
|
1506
|
+
EMAIL_VERIFICATION_FAILED: "gd_auth_fail_email_verification",
|
|
1507
|
+
MFA_AUTH_FAILED: "gd_auth_failed",
|
|
1508
|
+
MFA_AUTH_REJECTED: "gd_auth_rejected",
|
|
1509
|
+
MFA_AUTH_SUCCESS: "gd_auth_succeed",
|
|
1510
|
+
MFA_ENROLLMENT_COMPLETE: "gd_enrollment_complete",
|
|
1511
|
+
TOO_MANY_MFA_FAILURES: "gd_otp_rate_limit_exceed",
|
|
1512
|
+
MFA_RECOVERY_FAILED: "gd_recovery_failed",
|
|
1513
|
+
MFA_RECOVERY_RATE_LIMIT_EXCEED: "gd_recovery_rate_limit_exceed",
|
|
1514
|
+
MFA_RECOVERY_SUCCESS: "gd_recovery_succeed",
|
|
1515
|
+
MFA_EMAIL_SENT: "gd_send_email",
|
|
1516
|
+
EMAIL_VERIFICATION_SENT: "gd_send_email_verification",
|
|
1517
|
+
EMAIL_VERIFICATION_SEND_FAILURE: "gd_send_email_verification_failure",
|
|
1518
|
+
PUSH_NOTIFICATION_SENT: "gd_send_pn",
|
|
1519
|
+
ERROR_SENDING_MFA_PUSH_NOTIFICATION: "gd_send_pn_failure",
|
|
1520
|
+
MFA_SMS_SENT: "gd_send_sms",
|
|
1521
|
+
ERROR_SENDING_MFA_SMS: "gd_send_sms_failure",
|
|
1522
|
+
MFA_VOICE_CALL_SUCCESS: "gd_send_voice",
|
|
1523
|
+
MFA_VOICE_CALL_FAILED: "gd_send_voice_failure",
|
|
1524
|
+
SECOND_FACTOR_STARTED: "gd_start_auth",
|
|
1525
|
+
MFA_ENROLL_STARTED: "gd_start_enroll",
|
|
1526
|
+
MFA_ENROLLMENT_FAILED: "gd_start_enroll_failed",
|
|
1527
|
+
GUARDIAN_TENANT_UPDATE: "gd_tenant_update",
|
|
1528
|
+
UNENROLL_DEVICE_ACCOUNT: "gd_unenroll",
|
|
1529
|
+
UPDATE_DEVICE_ACCOUNT: "gd_update_device_account",
|
|
1530
|
+
WEBAUTHN_CHALLENGE_FAILED: "gd_webauthn_challenge_failed",
|
|
1531
|
+
WEBAUTHN_ENROLLMENT_FAILED: "gd_webauthn_enrollment_failed",
|
|
1532
|
+
FAILED_KMS_API_OPERATION: "kms_key_management_failure",
|
|
1533
|
+
SUCCESS_KMS_API_OPERATION: "kms_key_management_success",
|
|
1534
|
+
KMS_KEY_STATE_CHANGED: "kms_key_state_changed",
|
|
1535
|
+
TOO_MANY_CALLS_TO_DELEGATION: "limit_delegation",
|
|
1536
|
+
BLOCKED_IP_ADDRESS: "limit_mu",
|
|
1537
|
+
BLOCKED_ACCOUNT_IP: "limit_sul",
|
|
1538
|
+
BLOCKED_ACCOUNT_EMAIL: "limit_wc",
|
|
1539
|
+
INFORMATION: "i",
|
|
1540
|
+
MFA_REQUIRED: "mfar",
|
|
1541
|
+
MANAGEMENT_API_READ_OPERATION: "mgmt_api_read",
|
|
1542
|
+
FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT: "my_account_authentication_method_failed",
|
|
1543
|
+
SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT: "my_account_authentication_method_succeeded",
|
|
1544
|
+
FAILED_OIDC_BACKCHANNEL_LOGOUT: "oidc_backchannel_logout_failed",
|
|
1545
|
+
SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT: "oidc_backchannel_logout_succeeded",
|
|
1546
|
+
ORGANIZATION_MEMBER_ADDED: "organization_member_added",
|
|
1547
|
+
PASSKEY_CHALLENGE_FAILED: "passkey_challenge_failed",
|
|
1548
|
+
PASSKEY_CHALLENGE_STARTED: "passkey_challenge_started",
|
|
1549
|
+
PRE_LOGIN_ASSESSMENT: "pla",
|
|
1550
|
+
BREACHED_PASSWORD: "pwd_leak",
|
|
1551
|
+
BREACHED_PASSWORD_ON_RESET: "reset_pwd_leak",
|
|
1552
|
+
SUCCESS_RESOURCE_CLEANUP: "resource_cleanup",
|
|
1553
|
+
RICH_CONSENTS_ACCESS_ERROR: "rich_consents_access_error",
|
|
1554
|
+
SUCCESS_LOGIN: "s",
|
|
1555
|
+
SUCCESS_API_OPERATION: "sapi",
|
|
1556
|
+
FAILED_API_OPERATION: "fapi",
|
|
1557
|
+
SUCCESS_CHANGE_EMAIL: "sce",
|
|
1558
|
+
SUCCESS_CROSS_ORIGIN_AUTHENTICATION: "scoa",
|
|
1559
|
+
SUCCESS_CHANGE_PASSWORD: "scp",
|
|
1560
|
+
SUCCESS_CHANGE_PHONE_NUMBER: "scpn",
|
|
1561
|
+
SUCCESS_CHANGE_PASSWORD_REQUEST: "scpr",
|
|
1562
|
+
SUCCESS_CHANGE_USERNAME: "scu",
|
|
1563
|
+
SUCCESS_CREDENTIAL_VALIDATION: "scv",
|
|
1564
|
+
SUCCESS_DELEGATION: "sd",
|
|
1565
|
+
SUCCESS_USER_DELETION: "sdu",
|
|
1566
|
+
SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN: "seacft",
|
|
1567
|
+
SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS: "seccft",
|
|
1568
|
+
SUCCESS_EXCHANGE_CUSTOM_TOKEN: "secte",
|
|
1569
|
+
SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN: "sede",
|
|
1570
|
+
SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN: "sens",
|
|
1571
|
+
SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN: "seoobft",
|
|
1572
|
+
SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN: "seotpft",
|
|
1573
|
+
SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN: "sepotpft",
|
|
1574
|
+
SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN: "sepft",
|
|
1575
|
+
SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN: "sepkoobft",
|
|
1576
|
+
SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN: "sepkotpft",
|
|
1577
|
+
SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN: "sepkrcft",
|
|
1578
|
+
SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN: "sercft",
|
|
1579
|
+
SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN: "sertft",
|
|
1580
|
+
SUCCESS_IMPERSONATION: "simp",
|
|
1581
|
+
SUCCESSFULLY_ACCEPTED_USER_INVITE: "si",
|
|
1582
|
+
BREACHED_PASSWORD_ON_SIGNUP: "signup_pwd_leak",
|
|
1583
|
+
SUCCESS_LOGOUT: "slo",
|
|
1584
|
+
SUCCESS_HOOK: "sh",
|
|
1585
|
+
SUCCESS_PASSWORD_MIGRATION: "spm",
|
|
1586
|
+
SUCCESS_REVOCATION: "srrt",
|
|
1587
|
+
SUCCESS_SIGNUP: "ss",
|
|
1588
|
+
FAILED_SS_SSO_OPERATION: "ss_sso_failure",
|
|
1589
|
+
INFORMATION_FROM_SS_SSO_OPERATION: "ss_sso_info",
|
|
1590
|
+
SUCCESS_SS_SSO_OPERATION: "ss_sso_success",
|
|
1591
|
+
SUCCESS_SILENT_AUTH: "ssa",
|
|
1592
|
+
SUCCESSFUL_SCIM_OPERATION: "sscim",
|
|
1593
|
+
SUCCESSFULLY_IMPORTED_USERS: "sui",
|
|
1594
|
+
SUCCESS_VERIFICATION_EMAIL: "sv",
|
|
1595
|
+
SUCCESS_VERIFICATION_EMAIL_REQUEST: "svr",
|
|
1596
|
+
MAX_AMOUNT_OF_AUTHENTICATORS: "too_many_records",
|
|
1597
|
+
USER_LOGIN_BLOCK_RELEASED: "ublkdu",
|
|
1598
|
+
FAILED_UNIVERSAL_LOGOUT: "universal_logout_failed",
|
|
1599
|
+
SUCCESSFUL_UNIVERSAL_LOGOUT: "universal_logout_succeeded",
|
|
1600
|
+
WARNING_DURING_LOGIN: "w",
|
|
1601
|
+
WARNING_SENDING_NOTIFICATION: "wn",
|
|
1602
|
+
WARNING_USER_MANAGEMENT: "wum"
|
|
1603
|
+
}, Xt = e.string().refine((e) => Object.values(D).includes(e), { message: "Invalid log type" });
|
|
1604
|
+
D.ACLS_SUMMARY, D.ACTIONS_EXECUTION_FAILED, D.API_LIMIT, D.API_LIMIT_WARNING, D.APPI, D.CIBA_EXCHANGE_FAILED, D.CIBA_EXCHANGE_SUCCEEDED, D.CIBA_START_FAILED, D.CIBA_START_SUCCEEDED, D.CODE_LINK_SENT, D.CODE_SENT, D.DEPRECATION_NOTICE, D.FAILED_LOGIN, D.FAILED_BY_CONNECTOR, D.FAILED_CHANGE_EMAIL, D.FAILED_BY_CORS, D.FAILED_CROSS_ORIGIN_AUTHENTICATION, D.FAILED_CHANGE_PASSWORD, D.FAILED_POST_CHANGE_PASSWORD_HOOK, D.FAILED_CHANGE_PHONE_NUMBER, D.FAILED_CHANGE_PASSWORD_REQUEST, D.FAILED_CONNECTOR_PROVISIONING, D.FAILED_CHANGE_USERNAME, D.FAILED_DELEGATION, D.FAILED_DEVICE_ACTIVATION, D.FAILED_DEVICE_AUTHORIZATION_REQUEST, D.USER_CANCELED_DEVICE_CONFIRMATION, D.FAILED_USER_DELETION, D.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, D.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, D.FAILED_EXCHANGE_CUSTOM_TOKEN, D.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, D.FAILED_FEDERATED_LOGOUT, D.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN, D.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, D.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, D.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, D.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, D.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, D.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN, D.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, D.FAILED_HOOK, D.FAILED_IMPERSONATION, D.FAILED_INVITE_ACCEPT, D.FAILED_LOGOUT, D.FLOWS_EXECUTION_COMPLETED, D.FLOWS_EXECUTION_FAILED, D.FAILED_SENDING_NOTIFICATION, D.FORMS_SUBMISSION_FAILED, D.FORMS_SUBMISSION_SUCCEEDED, D.FAILED_LOGIN_INCORRECT_PASSWORD, D.FAILED_PUSHED_AUTHORIZATION_REQUEST, D.FAILED_POST_USER_REGISTRATION_HOOK, D.FAILED_SIGNUP, D.FAILED_SILENT_AUTH, D.FAILED_LOGIN_INVALID_EMAIL_USERNAME, D.FAILED_USERS_IMPORT, D.FAILED_VERIFICATION_EMAIL, D.FAILED_VERIFICATION_EMAIL_REQUEST, D.EMAIL_VERIFICATION_CONFIRMED, D.EMAIL_VERIFICATION_FAILED, D.MFA_AUTH_FAILED, D.MFA_AUTH_REJECTED, D.MFA_AUTH_SUCCESS, D.MFA_ENROLLMENT_COMPLETE, D.TOO_MANY_MFA_FAILURES, D.MFA_RECOVERY_FAILED, D.MFA_RECOVERY_RATE_LIMIT_EXCEED, D.MFA_RECOVERY_SUCCESS, D.MFA_EMAIL_SENT, D.EMAIL_VERIFICATION_SENT, D.EMAIL_VERIFICATION_SEND_FAILURE, D.PUSH_NOTIFICATION_SENT, D.ERROR_SENDING_MFA_PUSH_NOTIFICATION, D.MFA_SMS_SENT, D.ERROR_SENDING_MFA_SMS, D.MFA_VOICE_CALL_SUCCESS, D.MFA_VOICE_CALL_FAILED, D.SECOND_FACTOR_STARTED, D.MFA_ENROLL_STARTED, D.MFA_ENROLLMENT_FAILED, D.GUARDIAN_TENANT_UPDATE, D.UNENROLL_DEVICE_ACCOUNT, D.UPDATE_DEVICE_ACCOUNT, D.WEBAUTHN_CHALLENGE_FAILED, D.WEBAUTHN_ENROLLMENT_FAILED, D.FAILED_KMS_API_OPERATION, D.SUCCESS_KMS_API_OPERATION, D.KMS_KEY_STATE_CHANGED, D.TOO_MANY_CALLS_TO_DELEGATION, D.BLOCKED_IP_ADDRESS, D.BLOCKED_ACCOUNT_IP, D.BLOCKED_ACCOUNT_EMAIL, D.INFORMATION, D.MFA_REQUIRED, D.MANAGEMENT_API_READ_OPERATION, D.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, D.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, D.FAILED_OIDC_BACKCHANNEL_LOGOUT, D.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT, D.ORGANIZATION_MEMBER_ADDED, D.PASSKEY_CHALLENGE_FAILED, D.PASSKEY_CHALLENGE_STARTED, D.PRE_LOGIN_ASSESSMENT, D.BREACHED_PASSWORD, D.BREACHED_PASSWORD_ON_RESET, D.SUCCESS_RESOURCE_CLEANUP, D.RICH_CONSENTS_ACCESS_ERROR, D.SUCCESS_LOGIN, D.SUCCESS_API_OPERATION, D.FAILED_API_OPERATION, D.SUCCESS_CHANGE_EMAIL, D.SUCCESS_CROSS_ORIGIN_AUTHENTICATION, D.SUCCESS_CHANGE_PASSWORD, D.SUCCESS_CHANGE_PHONE_NUMBER, D.SUCCESS_CHANGE_PASSWORD_REQUEST, D.SUCCESS_CHANGE_USERNAME, D.SUCCESS_CREDENTIAL_VALIDATION, D.SUCCESS_DELEGATION, D.SUCCESS_USER_DELETION, D.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, D.SUCCESS_EXCHANGE_CUSTOM_TOKEN, D.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN, D.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, D.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, D.SUCCESS_IMPERSONATION, D.SUCCESSFULLY_ACCEPTED_USER_INVITE, D.BREACHED_PASSWORD_ON_SIGNUP, D.SUCCESS_LOGOUT, D.SUCCESS_HOOK, D.SUCCESS_PASSWORD_MIGRATION, D.SUCCESS_REVOCATION, D.SUCCESS_SIGNUP, D.FAILED_SS_SSO_OPERATION, D.INFORMATION_FROM_SS_SSO_OPERATION, D.SUCCESS_SS_SSO_OPERATION, D.SUCCESS_SILENT_AUTH, D.SUCCESSFUL_SCIM_OPERATION, D.SUCCESSFULLY_IMPORTED_USERS, D.SUCCESS_VERIFICATION_EMAIL, D.SUCCESS_VERIFICATION_EMAIL_REQUEST, D.MAX_AMOUNT_OF_AUTHENTICATORS, D.USER_LOGIN_BLOCK_RELEASED, D.FAILED_UNIVERSAL_LOGOUT, D.SUCCESSFUL_UNIVERSAL_LOGOUT, D.WARNING_DURING_LOGIN, D.WARNING_SENDING_NOTIFICATION, D.WARNING_USER_MANAGEMENT, (() => {
|
|
1605
|
+
let e = {};
|
|
1606
|
+
for (let [t, n] of Object.entries(D)) t.startsWith("SUCCESS_") || t.startsWith("SUCCESSFUL_") || t.startsWith("SUCCESSFULLY_") || t.endsWith("_SUCCEEDED") || t.endsWith("_COMPLETED") ? e[n] = "success" : t.startsWith("FAILED_") || t.startsWith("ERROR_") || t.startsWith("BREACHED_") || t.startsWith("BLOCKED_") || t === "MFA_AUTH_FAILED" || t === "MFA_AUTH_REJECTED" || t === "MFA_RECOVERY_FAILED" || t === "MFA_ENROLLMENT_FAILED" || t === "EMAIL_VERIFICATION_FAILED" || t === "WEBAUTHN_CHALLENGE_FAILED" || t === "WEBAUTHN_ENROLLMENT_FAILED" || t === "PASSKEY_CHALLENGE_FAILED" || t === "FLOWS_EXECUTION_FAILED" || t === "FORMS_SUBMISSION_FAILED" || t === "CIBA_EXCHANGE_FAILED" || t === "CIBA_START_FAILED" || t === "ACTIONS_EXECUTION_FAILED" || t === "RICH_CONSENTS_ACCESS_ERROR" || t === "USER_CANCELED_DEVICE_CONFIRMATION" || t === "TOO_MANY_MFA_FAILURES" || t === "MFA_RECOVERY_RATE_LIMIT_EXCEED" || t === "API_LIMIT" || t === "MAX_AMOUNT_OF_AUTHENTICATORS" ? e[n] = "failure" : t.startsWith("WARNING_") || t === "API_LIMIT_WARNING" || t === "DEPRECATION_NOTICE" || t === "PRE_LOGIN_ASSESSMENT" ? e[n] = "warning" : t === "CODE_SENT" || t === "CODE_LINK_SENT" || t === "MFA_EMAIL_SENT" || t === "MFA_SMS_SENT" || t === "EMAIL_VERIFICATION_SENT" || t === "PUSH_NOTIFICATION_SENT" ? e[n] = "code_sent" : t === "INFORMATION" || t === "INFORMATION_FROM_SS_SSO_OPERATION" || t === "MANAGEMENT_API_READ_OPERATION" || t === "APPI" || t === "ACLS_SUMMARY" || t === "ORGANIZATION_MEMBER_ADDED" ? e[n] = "info" : e[n] = "other";
|
|
1607
|
+
return e;
|
|
1608
|
+
})();
|
|
1609
|
+
var Zt = e.object({
|
|
1610
|
+
name: e.string(),
|
|
1611
|
+
version: e.string(),
|
|
1612
|
+
env: e.object({ node: e.string().optional() }).optional()
|
|
1613
|
+
}), Qt = e.object({
|
|
1614
|
+
country_code: e.string().length(2),
|
|
1615
|
+
city_name: e.string(),
|
|
1616
|
+
latitude: e.string(),
|
|
1617
|
+
longitude: e.string(),
|
|
1618
|
+
time_zone: e.string(),
|
|
1619
|
+
continent_code: e.string()
|
|
1620
|
+
});
|
|
1621
|
+
e.object({
|
|
1622
|
+
type: Xt,
|
|
1623
|
+
date: e.string(),
|
|
1624
|
+
description: e.string().optional(),
|
|
1625
|
+
ip: e.string().optional(),
|
|
1626
|
+
user_agent: e.string().optional(),
|
|
1627
|
+
details: e.any().optional(),
|
|
1628
|
+
isMobile: e.boolean(),
|
|
1629
|
+
user_id: e.string().optional(),
|
|
1630
|
+
user_name: e.string().optional(),
|
|
1631
|
+
connection: e.string().optional(),
|
|
1632
|
+
connection_id: e.string().optional(),
|
|
1633
|
+
client_id: e.string().optional(),
|
|
1634
|
+
client_name: e.string().optional(),
|
|
1635
|
+
audience: e.string().optional(),
|
|
1636
|
+
scope: e.string().optional(),
|
|
1637
|
+
strategy: e.string().optional(),
|
|
1638
|
+
strategy_type: e.string().optional(),
|
|
1639
|
+
hostname: e.string().optional(),
|
|
1640
|
+
auth0_client: Zt.optional(),
|
|
1641
|
+
log_id: e.string().optional(),
|
|
1642
|
+
location_info: Qt.optional()
|
|
1643
|
+
}).extend({ log_id: e.string() });
|
|
1644
|
+
var $t = e.enum([
|
|
1645
|
+
"http",
|
|
1646
|
+
"eventbridge",
|
|
1647
|
+
"eventgrid",
|
|
1648
|
+
"splunk",
|
|
1649
|
+
"datadog",
|
|
1650
|
+
"sumo"
|
|
1651
|
+
]), en = e.enum([
|
|
1652
|
+
"active",
|
|
1653
|
+
"paused",
|
|
1654
|
+
"suspended"
|
|
1655
|
+
]), tn = e.object({
|
|
1656
|
+
type: e.string(),
|
|
1657
|
+
name: e.string()
|
|
1658
|
+
});
|
|
1659
|
+
e.object({
|
|
1660
|
+
name: e.string(),
|
|
1661
|
+
type: $t,
|
|
1662
|
+
status: en.optional(),
|
|
1663
|
+
sink: e.record(e.string(), e.unknown()),
|
|
1664
|
+
filters: e.array(tn).optional(),
|
|
1665
|
+
isPriority: e.boolean().optional()
|
|
1666
|
+
}).extend({
|
|
1667
|
+
id: e.string(),
|
|
1668
|
+
status: en,
|
|
1669
|
+
created_at: e.string().optional(),
|
|
1670
|
+
updated_at: e.string().optional()
|
|
1671
|
+
});
|
|
1672
|
+
var nn = e.enum([
|
|
1673
|
+
"auth0",
|
|
1674
|
+
"cognito",
|
|
1675
|
+
"okta",
|
|
1676
|
+
"oidc"
|
|
1677
|
+
]), rn = e.object({
|
|
1678
|
+
domain: e.string(),
|
|
1679
|
+
client_id: e.string(),
|
|
1680
|
+
client_secret: e.string(),
|
|
1681
|
+
audience: e.string().optional(),
|
|
1682
|
+
scope: e.string().optional()
|
|
1683
|
+
}), an = e.object({
|
|
1684
|
+
id: e.string().optional(),
|
|
1685
|
+
name: e.string(),
|
|
1686
|
+
provider: nn,
|
|
1687
|
+
connection: e.string(),
|
|
1688
|
+
enabled: e.boolean().default(!0),
|
|
1689
|
+
credentials: rn
|
|
1690
|
+
});
|
|
1691
|
+
e.object({
|
|
1692
|
+
id: e.string(),
|
|
1693
|
+
created_at: e.string(),
|
|
1694
|
+
updated_at: e.string()
|
|
1695
|
+
}).extend(an.shape);
|
|
1696
|
+
var on = e.object({
|
|
1697
|
+
enabled: e.boolean().optional(),
|
|
1698
|
+
shields: e.array(e.string()).optional(),
|
|
1699
|
+
admin_notification_frequency: e.array(e.string()).optional(),
|
|
1700
|
+
method: e.string().optional(),
|
|
1701
|
+
stage: e.object({
|
|
1702
|
+
"pre-user-registration": e.object({ shields: e.array(e.string()).optional() }).optional(),
|
|
1703
|
+
"pre-change-password": e.object({ shields: e.array(e.string()).optional() }).optional()
|
|
1704
|
+
}).optional()
|
|
1705
|
+
}), sn = e.object({
|
|
1706
|
+
enabled: e.boolean().optional(),
|
|
1707
|
+
shields: e.array(e.string()).optional(),
|
|
1708
|
+
allowlist: e.array(e.string()).optional(),
|
|
1709
|
+
mode: e.string().optional(),
|
|
1710
|
+
max_attempts: e.number().optional()
|
|
1711
|
+
}), cn = e.object({
|
|
1712
|
+
enabled: e.boolean().optional(),
|
|
1713
|
+
shields: e.array(e.string()).optional(),
|
|
1714
|
+
allowlist: e.array(e.string()).optional(),
|
|
1715
|
+
stage: e.object({
|
|
1716
|
+
"pre-login": e.object({
|
|
1717
|
+
max_attempts: e.number().optional(),
|
|
1718
|
+
rate: e.number().optional()
|
|
1719
|
+
}).optional(),
|
|
1720
|
+
"pre-user-registration": e.object({
|
|
1721
|
+
max_attempts: e.number().optional(),
|
|
1722
|
+
rate: e.number().optional()
|
|
1723
|
+
}).optional()
|
|
1724
|
+
}).optional()
|
|
1725
|
+
}), ln = e.object({
|
|
1726
|
+
breached_password_detection: on.optional(),
|
|
1727
|
+
brute_force_protection: sn.optional(),
|
|
1728
|
+
suspicious_ip_throttling: cn.optional()
|
|
1729
|
+
});
|
|
1730
|
+
e.object({
|
|
1731
|
+
id: e.string().optional(),
|
|
1732
|
+
user_id: e.string(),
|
|
1733
|
+
password: e.string(),
|
|
1734
|
+
algorithm: e.enum(["bcrypt", "argon2id"]).default("argon2id"),
|
|
1735
|
+
is_current: e.boolean().default(!0)
|
|
1736
|
+
}).extend({
|
|
1737
|
+
id: e.string(),
|
|
1738
|
+
created_at: e.string(),
|
|
1739
|
+
updated_at: e.string()
|
|
1740
|
+
});
|
|
1741
|
+
var O = e.object({
|
|
1742
|
+
initial_user_agent: e.string().describe("First user agent of the device from which this user logged in"),
|
|
1743
|
+
initial_ip: e.string().describe("First IP address associated with this session"),
|
|
1744
|
+
initial_asn: e.string().describe("First autonomous system number associated with this session"),
|
|
1745
|
+
last_user_agent: e.string().describe("Last user agent of the device from which this user logged in"),
|
|
1746
|
+
last_ip: e.string().describe("Last IP address from which this user logged in"),
|
|
1747
|
+
last_asn: e.string().describe("Last autonomous system number from which this user logged in")
|
|
1748
|
+
}), un = e.object({
|
|
1749
|
+
id: e.string(),
|
|
1750
|
+
revoked_at: e.string().optional(),
|
|
1751
|
+
used_at: e.string().optional(),
|
|
1752
|
+
user_id: e.string().describe("The user ID associated with the session"),
|
|
1753
|
+
expires_at: e.string().optional(),
|
|
1754
|
+
login_session_id: e.string(),
|
|
1755
|
+
idle_expires_at: e.string().optional(),
|
|
1756
|
+
device: O.describe("Metadata related to the device used in the session"),
|
|
1757
|
+
clients: e.array(e.string()).describe("List of client details for the session")
|
|
1758
|
+
});
|
|
1759
|
+
e.object({
|
|
1760
|
+
created_at: e.string(),
|
|
1761
|
+
updated_at: e.string(),
|
|
1762
|
+
authenticated_at: e.string(),
|
|
1763
|
+
last_interaction_at: e.string()
|
|
1764
|
+
}).extend(un.shape), e.object({
|
|
1765
|
+
kid: e.string().openapi({ description: "The key id of the signing key" }),
|
|
1766
|
+
tenant_id: e.string().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
|
|
1767
|
+
cert: e.string().openapi({ description: "The public certificate of the signing key" }),
|
|
1768
|
+
fingerprint: e.string().openapi({ description: "The cert fingerprint" }),
|
|
1769
|
+
thumbprint: e.string().openapi({ description: "The cert thumbprint" }),
|
|
1770
|
+
pkcs7: e.string().optional().openapi({ description: "The private key in pkcs7 format" }),
|
|
1771
|
+
current: e.boolean().optional().openapi({ description: "True if the key is the current key" }),
|
|
1772
|
+
next: e.boolean().optional().openapi({ description: "True if the key is the next key" }),
|
|
1773
|
+
previous: e.boolean().optional().openapi({ description: "True if the key is the previous key" }),
|
|
1774
|
+
current_since: e.string().optional().openapi({ description: "The date and time when the key became the current key" }),
|
|
1775
|
+
current_until: e.string().optional().openapi({ description: "The date and time when the current key was rotated" }),
|
|
1776
|
+
revoked: e.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
1777
|
+
revoked_at: e.string().optional().openapi({ description: "The date and time when the key was revoked" }),
|
|
1778
|
+
connection: e.string().optional().openapi({ description: "The connection identifier associated with the key" }),
|
|
1779
|
+
type: e.enum(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
|
|
1780
|
+
});
|
|
1781
|
+
var dn = e.object({
|
|
1782
|
+
id: e.string().optional(),
|
|
1783
|
+
audience: e.string(),
|
|
1784
|
+
friendly_name: e.string(),
|
|
1785
|
+
picture_url: e.string().optional(),
|
|
1786
|
+
support_email: e.string().optional(),
|
|
1787
|
+
support_url: e.string().optional(),
|
|
1788
|
+
sender_email: e.string().email(),
|
|
1789
|
+
sender_name: e.string(),
|
|
1790
|
+
session_lifetime: e.number().optional(),
|
|
1791
|
+
idle_session_lifetime: e.number().optional(),
|
|
1792
|
+
ephemeral_session_lifetime: e.number().optional(),
|
|
1793
|
+
idle_ephemeral_session_lifetime: e.number().optional(),
|
|
1794
|
+
session_cookie: e.object({ mode: e.enum(["persistent", "non-persistent"]).optional() }).optional(),
|
|
1795
|
+
allowed_logout_urls: e.array(e.string()).optional(),
|
|
1796
|
+
default_redirection_uri: e.string().optional(),
|
|
1797
|
+
default_client_id: e.string().optional(),
|
|
1798
|
+
enabled_locales: e.array(e.string()).optional(),
|
|
1799
|
+
default_directory: e.string().optional(),
|
|
1800
|
+
error_page: e.object({
|
|
1801
|
+
html: e.string().optional(),
|
|
1802
|
+
show_log_link: e.boolean().optional(),
|
|
1803
|
+
url: e.string().optional()
|
|
1804
|
+
}).nullish(),
|
|
1805
|
+
flags: e.object({
|
|
1806
|
+
allow_changing_enable_sso: e.boolean().optional(),
|
|
1807
|
+
allow_legacy_delegation_grant_types: e.boolean().optional(),
|
|
1808
|
+
allow_legacy_ro_grant_types: e.boolean().optional(),
|
|
1809
|
+
allow_legacy_tokeninfo_endpoint: e.boolean().optional(),
|
|
1810
|
+
change_pwd_flow_v1: e.boolean().optional(),
|
|
1811
|
+
custom_domains_provisioning: e.boolean().optional(),
|
|
1812
|
+
dashboard_insights_view: e.boolean().optional(),
|
|
1813
|
+
dashboard_log_streams_next: e.boolean().optional(),
|
|
1814
|
+
disable_clickjack_protection_headers: e.boolean().optional(),
|
|
1815
|
+
disable_fields_map_fix: e.boolean().optional(),
|
|
1816
|
+
disable_impersonation: e.boolean().optional(),
|
|
1817
|
+
disable_management_api_sms_obfuscation: e.boolean().optional(),
|
|
1818
|
+
enable_adfs_waad_email_verification: e.boolean().optional(),
|
|
1819
|
+
enable_apis_section: e.boolean().optional(),
|
|
1820
|
+
enable_client_connections: e.boolean().optional(),
|
|
1821
|
+
enable_custom_domain_in_emails: e.boolean().optional(),
|
|
1822
|
+
enable_dynamic_client_registration: e.boolean().optional(),
|
|
1823
|
+
dcr_require_initial_access_token: e.boolean().optional(),
|
|
1824
|
+
dcr_allowed_grant_types: e.array(e.string()).optional(),
|
|
1825
|
+
allow_http_return_to: e.array(e.string().refine((e) => {
|
|
1826
|
+
try {
|
|
1827
|
+
let t = new URL(e);
|
|
1828
|
+
return t.protocol === "http:" && (t.pathname === "" || t.pathname === "/") && !t.search && !t.hash && e === t.origin;
|
|
1829
|
+
} catch {
|
|
1830
|
+
return !1;
|
|
1831
|
+
}
|
|
1832
|
+
}, { message: "must be a fully-qualified http origin (scheme + host + port, no path)" })).optional(),
|
|
1833
|
+
enable_idtoken_api2: e.boolean().optional(),
|
|
1834
|
+
enable_legacy_logs_search_v2: e.boolean().optional(),
|
|
1835
|
+
enable_legacy_profile: e.boolean().optional(),
|
|
1836
|
+
enable_pipeline2: e.boolean().optional(),
|
|
1837
|
+
enable_public_signup_user_exists_error: e.boolean().optional(),
|
|
1838
|
+
enable_sso: e.boolean().optional(),
|
|
1839
|
+
enforce_client_authentication_on_passwordless_start: e.boolean().optional(),
|
|
1840
|
+
genai_trial: e.boolean().optional(),
|
|
1841
|
+
improved_signup_bot_detection_in_classic: e.boolean().optional(),
|
|
1842
|
+
mfa_show_factor_list_on_enrollment: e.boolean().optional(),
|
|
1843
|
+
no_disclose_enterprise_connections: e.boolean().optional(),
|
|
1844
|
+
remove_alg_from_jwks: e.boolean().optional(),
|
|
1845
|
+
revoke_refresh_token_grant: e.boolean().optional(),
|
|
1846
|
+
trust_azure_adfs_email_verified_connection_property: e.boolean().optional(),
|
|
1847
|
+
use_scope_descriptions_for_consent: e.boolean().optional(),
|
|
1848
|
+
inherit_global_permissions_in_organizations: e.boolean().optional()
|
|
1849
|
+
}).optional(),
|
|
1850
|
+
sandbox_version: e.string().optional(),
|
|
1851
|
+
legacy_sandbox_version: e.string().optional(),
|
|
1852
|
+
sandbox_versions_available: e.array(e.string()).optional(),
|
|
1853
|
+
change_password: e.object({
|
|
1854
|
+
enabled: e.boolean().optional(),
|
|
1855
|
+
html: e.string().optional()
|
|
1856
|
+
}).optional(),
|
|
1857
|
+
guardian_mfa_page: e.object({
|
|
1858
|
+
enabled: e.boolean().optional(),
|
|
1859
|
+
html: e.string().optional()
|
|
1860
|
+
}).optional(),
|
|
1861
|
+
device_flow: e.object({
|
|
1862
|
+
charset: e.enum(["base20", "digits"]).optional(),
|
|
1863
|
+
mask: e.string().max(20).optional()
|
|
1864
|
+
}).optional(),
|
|
1865
|
+
default_token_quota: e.object({
|
|
1866
|
+
clients: e.object({ client_credentials: e.record(e.string(), e.any()).optional() }).optional(),
|
|
1867
|
+
organizations: e.object({ client_credentials: e.record(e.string(), e.any()).optional() }).optional()
|
|
1868
|
+
}).nullish(),
|
|
1869
|
+
default_audience: e.string().optional(),
|
|
1870
|
+
default_organization: e.string().optional(),
|
|
1871
|
+
sessions: e.object({ oidc_logout_prompt_enabled: e.boolean().optional() }).optional(),
|
|
1872
|
+
oidc_logout: e.object({ rp_logout_end_session_endpoint_discovery: e.boolean().optional() }).optional(),
|
|
1873
|
+
allow_organization_name_in_authentication_api: e.boolean().optional(),
|
|
1874
|
+
customize_mfa_in_postlogin_action: e.boolean().optional(),
|
|
1875
|
+
acr_values_supported: e.array(e.string()).optional(),
|
|
1876
|
+
mtls: e.object({ enable_endpoint_aliases: e.boolean().optional() }).nullish(),
|
|
1877
|
+
pushed_authorization_requests_supported: e.boolean().optional(),
|
|
1878
|
+
authorization_response_iss_parameter_supported: e.boolean().optional(),
|
|
1879
|
+
attack_protection: ln.optional(),
|
|
1880
|
+
mfa: e.object({
|
|
1881
|
+
policy: e.enum(["never", "always"]).default("never").optional(),
|
|
1882
|
+
factors: e.object({
|
|
1883
|
+
sms: e.boolean().default(!1),
|
|
1884
|
+
otp: e.boolean().default(!1),
|
|
1885
|
+
email: e.boolean().default(!1),
|
|
1886
|
+
push_notification: e.boolean().default(!1),
|
|
1887
|
+
webauthn_roaming: e.boolean().default(!1),
|
|
1888
|
+
webauthn_platform: e.boolean().default(!1),
|
|
1889
|
+
recovery_code: e.boolean().default(!1),
|
|
1890
|
+
duo: e.boolean().default(!1)
|
|
1891
|
+
}).optional(),
|
|
1892
|
+
sms_provider: e.object({ provider: e.enum([
|
|
1893
|
+
"twilio",
|
|
1894
|
+
"vonage",
|
|
1895
|
+
"aws_sns",
|
|
1896
|
+
"phone_message_hook"
|
|
1897
|
+
]).optional() }).optional(),
|
|
1898
|
+
twilio: e.object({
|
|
1899
|
+
sid: e.string().optional(),
|
|
1900
|
+
auth_token: e.string().optional(),
|
|
1901
|
+
from: e.string().optional(),
|
|
1902
|
+
messaging_service_sid: e.string().optional()
|
|
1903
|
+
}).optional(),
|
|
1904
|
+
phone_message: e.object({ message: e.string().optional() }).optional()
|
|
1905
|
+
}).optional()
|
|
1906
|
+
});
|
|
1907
|
+
e.object({
|
|
1908
|
+
created_at: e.string().nullable().transform((e) => e ?? ""),
|
|
1909
|
+
updated_at: e.string().nullable().transform((e) => e ?? "")
|
|
1910
|
+
}).extend(dn.shape).extend({
|
|
1911
|
+
id: e.string(),
|
|
1912
|
+
is_control_plane: e.boolean().optional()
|
|
1913
|
+
}), e.object({
|
|
1914
|
+
access_token: e.string(),
|
|
1915
|
+
id_token: e.string().optional(),
|
|
1916
|
+
scope: e.string().optional(),
|
|
1917
|
+
state: e.string().optional(),
|
|
1918
|
+
refresh_token: e.string().optional(),
|
|
1919
|
+
token_type: e.string(),
|
|
1920
|
+
expires_in: e.number()
|
|
1921
|
+
}), e.object({
|
|
1922
|
+
code: e.string(),
|
|
1923
|
+
state: e.string().optional()
|
|
1924
|
+
});
|
|
1925
|
+
var fn = e.object({
|
|
1926
|
+
button_border_radius: e.number(),
|
|
1927
|
+
button_border_weight: e.number(),
|
|
1928
|
+
buttons_style: e.enum([
|
|
1929
|
+
"pill",
|
|
1930
|
+
"rounded",
|
|
1931
|
+
"sharp"
|
|
1932
|
+
]),
|
|
1933
|
+
input_border_radius: e.number(),
|
|
1934
|
+
input_border_weight: e.number(),
|
|
1935
|
+
inputs_style: e.enum([
|
|
1936
|
+
"pill",
|
|
1937
|
+
"rounded",
|
|
1938
|
+
"sharp"
|
|
1939
|
+
]),
|
|
1940
|
+
show_widget_shadow: e.boolean(),
|
|
1941
|
+
widget_border_weight: e.number(),
|
|
1942
|
+
widget_corner_radius: e.number()
|
|
1943
|
+
}), pn = e.object({
|
|
1944
|
+
base_focus_color: e.string(),
|
|
1945
|
+
base_hover_color: e.string(),
|
|
1946
|
+
body_text: e.string(),
|
|
1947
|
+
captcha_widget_theme: e.enum([
|
|
1948
|
+
"auto",
|
|
1949
|
+
"dark",
|
|
1950
|
+
"light"
|
|
1951
|
+
]),
|
|
1952
|
+
error: e.string(),
|
|
1953
|
+
header: e.string(),
|
|
1954
|
+
icons: e.string(),
|
|
1955
|
+
input_background: e.string(),
|
|
1956
|
+
input_border: e.string(),
|
|
1957
|
+
input_filled_text: e.string(),
|
|
1958
|
+
input_labels_placeholders: e.string(),
|
|
1959
|
+
links_focused_components: e.string(),
|
|
1960
|
+
primary_button: e.string(),
|
|
1961
|
+
primary_button_label: e.string(),
|
|
1962
|
+
secondary_button_border: e.string(),
|
|
1963
|
+
secondary_button_label: e.string(),
|
|
1964
|
+
success: e.string(),
|
|
1965
|
+
widget_background: e.string(),
|
|
1966
|
+
widget_border: e.string()
|
|
1967
|
+
}), k = e.object({
|
|
1968
|
+
bold: e.boolean(),
|
|
1969
|
+
size: e.number()
|
|
1970
|
+
}), mn = e.object({
|
|
1971
|
+
body_text: k,
|
|
1972
|
+
buttons_text: k,
|
|
1973
|
+
font_url: e.string(),
|
|
1974
|
+
input_labels: k,
|
|
1975
|
+
links: k,
|
|
1976
|
+
links_style: e.enum(["normal", "underlined"]),
|
|
1977
|
+
reference_text_size: e.number(),
|
|
1978
|
+
subtitle: k,
|
|
1979
|
+
title: k
|
|
1980
|
+
}), hn = e.object({
|
|
1981
|
+
background_color: e.string(),
|
|
1982
|
+
background_image_url: e.string(),
|
|
1983
|
+
page_layout: e.enum([
|
|
1984
|
+
"center",
|
|
1985
|
+
"left",
|
|
1986
|
+
"right"
|
|
1987
|
+
]),
|
|
1988
|
+
logo_placement: e.enum([
|
|
1989
|
+
"widget",
|
|
1990
|
+
"chip",
|
|
1991
|
+
"none"
|
|
1992
|
+
]).optional()
|
|
1993
|
+
}), gn = e.object({
|
|
1994
|
+
header_text_alignment: e.enum([
|
|
1995
|
+
"center",
|
|
1996
|
+
"left",
|
|
1997
|
+
"right"
|
|
1998
|
+
]),
|
|
1999
|
+
logo_height: e.number(),
|
|
2000
|
+
logo_position: e.enum([
|
|
2001
|
+
"center",
|
|
2002
|
+
"left",
|
|
2003
|
+
"none",
|
|
2004
|
+
"right"
|
|
2005
|
+
]),
|
|
2006
|
+
logo_url: e.string(),
|
|
2007
|
+
social_buttons_layout: e.enum(["bottom", "top"])
|
|
2008
|
+
});
|
|
2009
|
+
e.object({
|
|
2010
|
+
borders: fn,
|
|
2011
|
+
colors: pn,
|
|
2012
|
+
displayName: e.string(),
|
|
2013
|
+
fonts: mn,
|
|
2014
|
+
page_background: hn,
|
|
2015
|
+
widget: gn
|
|
2016
|
+
}).extend({ themeId: e.string() }), e.object({
|
|
2017
|
+
universal_login_experience: e.enum(["new", "classic"]).default("new"),
|
|
2018
|
+
identifier_first: e.boolean().default(!0),
|
|
2019
|
+
password_first: e.boolean().default(!1),
|
|
2020
|
+
webauthn_platform_first_factor: e.boolean()
|
|
2021
|
+
});
|
|
2022
|
+
var A = e.object({
|
|
2023
|
+
hosts: e.array(e.string()).optional(),
|
|
2024
|
+
methods: e.array(e.string()).optional(),
|
|
2025
|
+
path: e.string().default("/*"),
|
|
2026
|
+
headers: e.record(e.string(), e.string()).optional(),
|
|
2027
|
+
query: e.record(e.string(), e.string()).optional()
|
|
2028
|
+
}), j = e.object({
|
|
2029
|
+
type: e.string(),
|
|
2030
|
+
options: e.record(e.string(), e.unknown()).default({})
|
|
2031
|
+
}), M = e.object({
|
|
2032
|
+
custom_domain_id: e.string(),
|
|
2033
|
+
priority: e.number().int().default(100),
|
|
2034
|
+
match: A,
|
|
2035
|
+
handlers: e.array(j).min(1)
|
|
2036
|
+
}), _n = M.extend({
|
|
2037
|
+
id: e.string(),
|
|
2038
|
+
tenant_id: e.string(),
|
|
2039
|
+
created_at: e.string(),
|
|
2040
|
+
updated_at: e.string()
|
|
2041
|
+
}), vn = M.partial().omit({ custom_domain_id: !0 });
|
|
2042
|
+
e.object({
|
|
2043
|
+
name: e.string(),
|
|
2044
|
+
enabled: e.boolean().optional().default(!0),
|
|
2045
|
+
default_from_address: e.string().optional(),
|
|
2046
|
+
credentials: e.record(e.string(), e.unknown()),
|
|
2047
|
+
settings: e.object({}).optional()
|
|
2048
|
+
});
|
|
2049
|
+
var yn = e.enum([
|
|
2050
|
+
"verify_email",
|
|
2051
|
+
"verify_email_by_code",
|
|
2052
|
+
"reset_email",
|
|
2053
|
+
"reset_email_by_code",
|
|
2054
|
+
"welcome_email",
|
|
2055
|
+
"blocked_account",
|
|
2056
|
+
"stolen_credentials",
|
|
2057
|
+
"enrollment_email",
|
|
2058
|
+
"mfa_oob_code",
|
|
2059
|
+
"change_password",
|
|
2060
|
+
"password_reset",
|
|
2061
|
+
"user_invitation"
|
|
2062
|
+
]);
|
|
2063
|
+
e.object({
|
|
2064
|
+
template: yn,
|
|
2065
|
+
body: e.string(),
|
|
2066
|
+
from: e.string(),
|
|
2067
|
+
subject: e.string(),
|
|
2068
|
+
syntax: e.literal("liquid").default("liquid"),
|
|
2069
|
+
resultUrl: e.string().optional(),
|
|
2070
|
+
urlLifetimeInSeconds: e.number().int().nonnegative().optional(),
|
|
2071
|
+
includeEmailInRedirect: e.boolean().default(!1),
|
|
2072
|
+
enabled: e.boolean().default(!0)
|
|
2073
|
+
}), e.object({
|
|
2074
|
+
id: e.string(),
|
|
2075
|
+
login_id: e.string(),
|
|
2076
|
+
user_id: e.string(),
|
|
2077
|
+
client_id: e.string(),
|
|
2078
|
+
expires_at: e.string().optional(),
|
|
2079
|
+
idle_expires_at: e.string().optional(),
|
|
2080
|
+
last_exchanged_at: e.string().optional(),
|
|
2081
|
+
device: O,
|
|
2082
|
+
resource_servers: e.array(e.object({
|
|
2083
|
+
audience: e.string(),
|
|
2084
|
+
scopes: e.string()
|
|
2085
|
+
})),
|
|
2086
|
+
rotating: e.boolean(),
|
|
2087
|
+
token_lookup: e.string().optional(),
|
|
2088
|
+
token_hash: e.string().optional(),
|
|
2089
|
+
family_id: e.string().optional(),
|
|
2090
|
+
rotated_to: e.string().optional(),
|
|
2091
|
+
rotated_at: e.string().optional()
|
|
2092
|
+
}).extend({
|
|
2093
|
+
created_at: e.string(),
|
|
2094
|
+
revoked_at: e.string().optional()
|
|
2095
|
+
}), e.object({
|
|
2096
|
+
to: e.string(),
|
|
2097
|
+
message: e.string()
|
|
2098
|
+
}), e.object({
|
|
2099
|
+
name: e.string(),
|
|
2100
|
+
options: e.object({})
|
|
2101
|
+
});
|
|
2102
|
+
var bn = e.object({
|
|
2103
|
+
value: e.string(),
|
|
2104
|
+
description: e.string().optional()
|
|
2105
|
+
}), xn = e.object({
|
|
2106
|
+
token_dialect: e.enum(["access_token", "access_token_authz"]).optional(),
|
|
2107
|
+
enforce_policies: e.boolean().optional(),
|
|
2108
|
+
allow_skipping_userinfo: e.boolean().optional(),
|
|
2109
|
+
skip_userinfo: e.boolean().optional(),
|
|
2110
|
+
persist_client_authorization: e.boolean().optional(),
|
|
2111
|
+
enable_introspection_endpoint: e.boolean().optional(),
|
|
2112
|
+
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2113
|
+
}), Sn = e.object({
|
|
2114
|
+
id: e.string().optional(),
|
|
2115
|
+
name: e.string(),
|
|
2116
|
+
identifier: e.string(),
|
|
2117
|
+
scopes: e.array(bn).optional(),
|
|
2118
|
+
signing_alg: e.string().optional(),
|
|
2119
|
+
signing_secret: e.string().optional(),
|
|
2120
|
+
token_lifetime: e.number().default(86400),
|
|
2121
|
+
token_lifetime_for_web: e.number().default(7200),
|
|
2122
|
+
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2123
|
+
allow_offline_access: e.boolean().optional(),
|
|
2124
|
+
verificationKey: e.string().optional(),
|
|
2125
|
+
options: xn.optional(),
|
|
2126
|
+
is_system: e.boolean().optional(),
|
|
2127
|
+
metadata: e.record(e.string(), e.any()).optional()
|
|
2128
|
+
}).extend({
|
|
2129
|
+
created_at: e.string().optional(),
|
|
2130
|
+
updated_at: e.string().optional()
|
|
2131
|
+
});
|
|
2132
|
+
e.array(Sn);
|
|
2133
|
+
var Cn = e.object({
|
|
2134
|
+
role_id: e.string(),
|
|
2135
|
+
resource_server_identifier: e.string(),
|
|
2136
|
+
permission_name: e.string()
|
|
2137
|
+
}).extend({ created_at: e.string() });
|
|
2138
|
+
e.array(Cn);
|
|
2139
|
+
var wn = e.object({
|
|
2140
|
+
user_id: e.string(),
|
|
2141
|
+
resource_server_identifier: e.string(),
|
|
2142
|
+
permission_name: e.string(),
|
|
2143
|
+
organization_id: e.string().optional()
|
|
2144
|
+
}).extend({
|
|
2145
|
+
tenant_id: e.string(),
|
|
2146
|
+
created_at: e.string().optional()
|
|
2147
|
+
});
|
|
2148
|
+
e.array(wn);
|
|
2149
|
+
var Tn = e.object({
|
|
2150
|
+
user_id: e.string(),
|
|
2151
|
+
resource_server_identifier: e.string(),
|
|
2152
|
+
resource_server_name: e.string(),
|
|
2153
|
+
permission_name: e.string(),
|
|
2154
|
+
description: e.string().nullable().optional(),
|
|
2155
|
+
created_at: e.string().optional(),
|
|
2156
|
+
organization_id: e.string().optional()
|
|
2157
|
+
});
|
|
2158
|
+
e.array(Tn);
|
|
2159
|
+
var En = e.object({
|
|
2160
|
+
user_id: e.string(),
|
|
2161
|
+
role_id: e.string(),
|
|
2162
|
+
organization_id: e.string().optional()
|
|
2163
|
+
}).extend({
|
|
2164
|
+
tenant_id: e.string(),
|
|
2165
|
+
created_at: e.string().optional()
|
|
2166
|
+
});
|
|
2167
|
+
e.array(En);
|
|
2168
|
+
var Dn = e.object({
|
|
2169
|
+
id: e.string().optional().openapi({ description: "The unique identifier of the role. If not provided, one will be generated." }),
|
|
2170
|
+
name: e.string().min(1).max(50).openapi({ description: "The name of the role. Cannot include '<' or '>'" }),
|
|
2171
|
+
description: e.string().max(255).optional().openapi({ description: "The description of the role" }),
|
|
2172
|
+
is_system: e.boolean().optional(),
|
|
2173
|
+
metadata: e.record(e.string(), e.any()).optional().openapi({ description: "Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios." })
|
|
2174
|
+
}).extend({
|
|
2175
|
+
id: e.string().openapi({ description: "The unique identifier of the role" }),
|
|
2176
|
+
created_at: e.string().optional(),
|
|
2177
|
+
updated_at: e.string().optional()
|
|
2178
|
+
});
|
|
2179
|
+
e.array(Dn);
|
|
2180
|
+
var On = e.object({
|
|
2181
|
+
logo_url: e.string().optional().openapi({ description: "URL of the organization's logo" }),
|
|
2182
|
+
colors: e.object({
|
|
2183
|
+
primary: e.string().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
2184
|
+
page_background: e.string().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
2185
|
+
}).optional()
|
|
2186
|
+
}).optional(), kn = e.object({
|
|
2187
|
+
connection_id: e.string().openapi({ description: "ID of the connection" }),
|
|
2188
|
+
assign_membership_on_login: e.boolean().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
2189
|
+
show_as_button: e.boolean().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
2190
|
+
is_signup_enabled: e.boolean().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
2191
|
+
}), An = e.object({ client_credentials: e.object({
|
|
2192
|
+
enforce: e.boolean().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
2193
|
+
per_day: e.number().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
2194
|
+
per_hour: e.number().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
2195
|
+
}).optional() }).optional();
|
|
2196
|
+
e.object({
|
|
2197
|
+
id: e.string().optional(),
|
|
2198
|
+
name: e.string().min(1).regex(/^[a-z0-9_-]+$/, { message: "Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores" }).openapi({ description: "The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores." }),
|
|
2199
|
+
display_name: e.string().optional().openapi({ description: "The display name of the organization" }),
|
|
2200
|
+
branding: On,
|
|
2201
|
+
metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
2202
|
+
enabled_connections: e.array(kn).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2203
|
+
token_quota: An
|
|
2204
|
+
}).extend(n.shape).extend({
|
|
2205
|
+
id: e.string(),
|
|
2206
|
+
name: e.string().min(1).openapi({ description: "The name of the organization" })
|
|
2207
|
+
});
|
|
2208
|
+
var jn = e.object({
|
|
2209
|
+
connection_id: e.string().openapi({ description: "ID of the tenant-level connection to enable for the org." }),
|
|
2210
|
+
assign_membership_on_login: e.boolean().optional().default(!1),
|
|
2211
|
+
show_as_button: e.boolean().optional().default(!0),
|
|
2212
|
+
is_signup_enabled: e.boolean().optional().default(!0)
|
|
2213
|
+
}).extend({
|
|
2214
|
+
connection: e.object({
|
|
2215
|
+
name: e.string().optional(),
|
|
2216
|
+
strategy: e.string().optional()
|
|
2217
|
+
}).optional(),
|
|
2218
|
+
created_at: e.string().optional(),
|
|
2219
|
+
updated_at: e.string().optional()
|
|
2220
|
+
});
|
|
2221
|
+
e.array(jn), e.object({
|
|
2222
|
+
user_id: e.string().openapi({ description: "ID of the user" }),
|
|
2223
|
+
organization_id: e.string().openapi({ description: "ID of the organization" })
|
|
2224
|
+
}).extend(n.shape).extend({ id: e.string() }), e.object({
|
|
2225
|
+
idle_session_lifetime: e.number().default(72),
|
|
2226
|
+
session_lifetime: e.number().default(168),
|
|
2227
|
+
session_cookie: e.object({ mode: e.enum(["persistent", "non-persistent"]).optional() }).optional(),
|
|
2228
|
+
enable_client_connections: e.boolean().optional(),
|
|
2229
|
+
default_redirection_uri: e.string().optional(),
|
|
2230
|
+
enabled_locales: e.array(e.string()).optional(),
|
|
2231
|
+
default_directory: e.string().optional(),
|
|
2232
|
+
error_page: e.object({
|
|
2233
|
+
html: e.string().optional(),
|
|
2234
|
+
show_log_link: e.boolean().optional(),
|
|
2235
|
+
url: e.string().optional()
|
|
2236
|
+
}).optional(),
|
|
2237
|
+
flags: e.object({
|
|
2238
|
+
allow_legacy_delegation_grant_types: e.boolean().optional(),
|
|
2239
|
+
allow_legacy_ro_grant_types: e.boolean().optional(),
|
|
2240
|
+
allow_legacy_tokeninfo_endpoint: e.boolean().optional(),
|
|
2241
|
+
disable_clickjack_protection_headers: e.boolean().optional(),
|
|
2242
|
+
enable_apis_section: e.boolean().optional(),
|
|
2243
|
+
enable_client_connections: e.boolean().optional(),
|
|
2244
|
+
enable_custom_domain_in_emails: e.boolean().optional(),
|
|
2245
|
+
enable_dynamic_client_registration: e.boolean().optional(),
|
|
2246
|
+
enable_idtoken_api2: e.boolean().optional(),
|
|
2247
|
+
enable_legacy_logs_search_v2: e.boolean().optional(),
|
|
2248
|
+
enable_legacy_profile: e.boolean().optional(),
|
|
2249
|
+
enable_pipeline2: e.boolean().optional(),
|
|
2250
|
+
enable_public_signup_user_exists_error: e.boolean().optional(),
|
|
2251
|
+
use_scope_descriptions_for_consent: e.boolean().optional(),
|
|
2252
|
+
disable_management_api_sms_obfuscation: e.boolean().optional(),
|
|
2253
|
+
enable_adfs_waad_email_verification: e.boolean().optional(),
|
|
2254
|
+
revoke_refresh_token_grant: e.boolean().optional(),
|
|
2255
|
+
dashboard_log_streams_next: e.boolean().optional(),
|
|
2256
|
+
dashboard_insights_view: e.boolean().optional(),
|
|
2257
|
+
disable_fields_map_fix: e.boolean().optional(),
|
|
2258
|
+
mfa_show_factor_list_on_enrollment: e.boolean().optional()
|
|
2259
|
+
}).optional(),
|
|
2260
|
+
friendly_name: e.string().optional(),
|
|
2261
|
+
picture_url: e.string().optional(),
|
|
2262
|
+
support_email: e.string().optional(),
|
|
2263
|
+
support_url: e.string().optional(),
|
|
2264
|
+
sandbox_version: e.string().optional(),
|
|
2265
|
+
sandbox_versions_available: e.array(e.string()).optional(),
|
|
2266
|
+
change_password: e.object({
|
|
2267
|
+
enabled: e.boolean(),
|
|
2268
|
+
html: e.string()
|
|
2269
|
+
}).optional(),
|
|
2270
|
+
guardian_mfa_page: e.object({
|
|
2271
|
+
enabled: e.boolean(),
|
|
2272
|
+
html: e.string()
|
|
2273
|
+
}).optional(),
|
|
2274
|
+
default_audience: e.string().optional(),
|
|
2275
|
+
default_organization: e.string().optional(),
|
|
2276
|
+
sessions: e.object({ oidc_logout_prompt_enabled: e.boolean().optional() }).optional(),
|
|
2277
|
+
mfa: e.object({
|
|
2278
|
+
policy: e.enum(["never", "always"]).default("never").optional(),
|
|
2279
|
+
factors: e.object({
|
|
2280
|
+
sms: e.boolean().default(!1),
|
|
2281
|
+
otp: e.boolean().default(!1),
|
|
2282
|
+
email: e.boolean().default(!1),
|
|
2283
|
+
push_notification: e.boolean().default(!1),
|
|
2284
|
+
webauthn_roaming: e.boolean().default(!1),
|
|
2285
|
+
webauthn_platform: e.boolean().default(!1),
|
|
2286
|
+
recovery_code: e.boolean().default(!1),
|
|
2287
|
+
duo: e.boolean().default(!1)
|
|
2288
|
+
}).optional(),
|
|
2289
|
+
sms_provider: e.object({ provider: e.enum([
|
|
2290
|
+
"twilio",
|
|
2291
|
+
"vonage",
|
|
2292
|
+
"aws_sns",
|
|
2293
|
+
"phone_message_hook"
|
|
2294
|
+
]).optional() }).optional(),
|
|
2295
|
+
twilio: e.object({
|
|
2296
|
+
sid: e.string().optional(),
|
|
2297
|
+
auth_token: e.string().optional(),
|
|
2298
|
+
from: e.string().optional(),
|
|
2299
|
+
messaging_service_sid: e.string().optional()
|
|
2300
|
+
}).optional(),
|
|
2301
|
+
phone_message: e.object({ message: e.string().optional() }).optional()
|
|
2302
|
+
}).optional()
|
|
2303
|
+
}), e.object({
|
|
2304
|
+
date: e.string().openapi({
|
|
2305
|
+
description: "Date these events occurred in ISO 8601 format",
|
|
2306
|
+
example: "2025-12-19"
|
|
2307
|
+
}),
|
|
2308
|
+
logins: e.number().openapi({
|
|
2309
|
+
description: "Number of logins on this date",
|
|
2310
|
+
example: 150
|
|
2311
|
+
}),
|
|
2312
|
+
signups: e.number().openapi({
|
|
2313
|
+
description: "Number of signups on this date",
|
|
2314
|
+
example: 25
|
|
2315
|
+
}),
|
|
2316
|
+
leaked_passwords: e.number().openapi({
|
|
2317
|
+
description: "Number of breached-password detections on this date (subscription required)",
|
|
2318
|
+
example: 0
|
|
2319
|
+
}),
|
|
2320
|
+
updated_at: e.string().openapi({
|
|
2321
|
+
description: "Date and time this stats entry was last updated in ISO 8601 format",
|
|
2322
|
+
example: "2025-12-19T10:30:00.000Z"
|
|
2323
|
+
}),
|
|
2324
|
+
created_at: e.string().openapi({
|
|
2325
|
+
description: "Approximate date and time the first event occurred in ISO 8601 format",
|
|
2326
|
+
example: "2025-12-19T00:00:00.000Z"
|
|
2327
|
+
})
|
|
2328
|
+
}), e.number().openapi({
|
|
2329
|
+
description: "Number of active users in the last 30 days",
|
|
2330
|
+
example: 1234
|
|
2331
|
+
}), e.enum([
|
|
2332
|
+
"active-users",
|
|
2333
|
+
"logins",
|
|
2334
|
+
"signups",
|
|
2335
|
+
"refresh-tokens",
|
|
2336
|
+
"sessions"
|
|
2337
|
+
]), e.enum([
|
|
2338
|
+
"hour",
|
|
2339
|
+
"day",
|
|
2340
|
+
"week",
|
|
2341
|
+
"month"
|
|
2342
|
+
]), e.enum([
|
|
2343
|
+
"time",
|
|
2344
|
+
"connection",
|
|
2345
|
+
"client_id",
|
|
2346
|
+
"user_type",
|
|
2347
|
+
"event"
|
|
2348
|
+
]), e.enum([
|
|
2349
|
+
"password",
|
|
2350
|
+
"social",
|
|
2351
|
+
"passwordless",
|
|
2352
|
+
"enterprise"
|
|
2353
|
+
]);
|
|
2354
|
+
var Mn = e.object({
|
|
2355
|
+
name: e.string(),
|
|
2356
|
+
type: e.string()
|
|
2357
|
+
}), Nn = e.object({
|
|
2358
|
+
elapsed: e.number(),
|
|
2359
|
+
rows_read: e.number().optional(),
|
|
2360
|
+
bytes_read: e.number().optional()
|
|
2361
|
+
});
|
|
2362
|
+
e.object({
|
|
2363
|
+
meta: e.array(Mn),
|
|
2364
|
+
data: e.array(e.record(e.string(), e.any())),
|
|
2365
|
+
rows: e.number(),
|
|
2366
|
+
rows_before_limit_at_least: e.number().optional(),
|
|
2367
|
+
statistics: Nn.optional()
|
|
2368
|
+
});
|
|
2369
|
+
var Pn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options".split(".")), Fn = e.record(e.string(), e.record(e.string(), e.string())).openapi({
|
|
2370
|
+
type: "object",
|
|
2371
|
+
additionalProperties: {
|
|
2372
|
+
type: "object",
|
|
2373
|
+
additionalProperties: { type: "string" }
|
|
2374
|
+
}
|
|
2375
|
+
});
|
|
2376
|
+
e.object({
|
|
2377
|
+
prompt: Pn,
|
|
2378
|
+
language: e.string(),
|
|
2379
|
+
custom_text: Fn
|
|
2380
|
+
});
|
|
2381
|
+
var In = e.enum([
|
|
2382
|
+
"phone",
|
|
2383
|
+
"totp",
|
|
2384
|
+
"email",
|
|
2385
|
+
"push",
|
|
2386
|
+
"webauthn-roaming",
|
|
2387
|
+
"webauthn-platform",
|
|
2388
|
+
"passkey"
|
|
2389
|
+
]), N = e.object({
|
|
2390
|
+
user_id: e.string(),
|
|
2391
|
+
type: In,
|
|
2392
|
+
phone_number: e.string().optional(),
|
|
2393
|
+
totp_secret: e.string().optional(),
|
|
2394
|
+
credential_id: e.string().optional(),
|
|
2395
|
+
public_key: e.string().optional(),
|
|
2396
|
+
sign_count: e.number().int().nonnegative().optional(),
|
|
2397
|
+
credential_backed_up: e.boolean().optional(),
|
|
2398
|
+
transports: e.array(e.string()).optional(),
|
|
2399
|
+
friendly_name: e.string().optional(),
|
|
2400
|
+
confirmed: e.boolean().default(!1)
|
|
2401
|
+
});
|
|
2402
|
+
function P(t, n) {
|
|
2403
|
+
t.type === "phone" && !t.phone_number && n.addIssue({
|
|
2404
|
+
code: e.ZodIssueCode.custom,
|
|
2405
|
+
message: "phone_number is required when type is 'phone'",
|
|
2406
|
+
path: ["phone_number"]
|
|
2407
|
+
}), t.type === "totp" && !t.totp_secret && n.addIssue({
|
|
2408
|
+
code: e.ZodIssueCode.custom,
|
|
2409
|
+
message: "totp_secret is required when type is 'totp'",
|
|
2410
|
+
path: ["totp_secret"]
|
|
2411
|
+
}), [
|
|
2412
|
+
"webauthn-roaming",
|
|
2413
|
+
"webauthn-platform",
|
|
2414
|
+
"passkey"
|
|
2415
|
+
].includes(t.type) && (t.credential_id || n.addIssue({
|
|
2416
|
+
code: e.ZodIssueCode.custom,
|
|
2417
|
+
message: `credential_id is required when type is '${t.type}'`,
|
|
2418
|
+
path: ["credential_id"]
|
|
2419
|
+
}), t.public_key || n.addIssue({
|
|
2420
|
+
code: e.ZodIssueCode.custom,
|
|
2421
|
+
message: `public_key is required when type is '${t.type}'`,
|
|
2422
|
+
path: ["public_key"]
|
|
2423
|
+
}));
|
|
2424
|
+
}
|
|
2425
|
+
N.superRefine(P), N.extend({
|
|
2426
|
+
id: e.string(),
|
|
2427
|
+
created_at: e.string(),
|
|
2428
|
+
updated_at: e.string()
|
|
2429
|
+
}).superRefine(P);
|
|
2430
|
+
//#endregion
|
|
2431
|
+
//#region src/data-plane/cache.ts
|
|
2432
|
+
var Ln = 1e4;
|
|
2433
|
+
function F(e, t, n) {
|
|
2434
|
+
let r = typeof t == "number" ? {
|
|
2435
|
+
freshTtlMs: t,
|
|
2436
|
+
maxEntries: n
|
|
2437
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.negativeTtlMs ?? i, s = r.maxEntries ?? Ln, c = r.waitUntil, l = /* @__PURE__ */ new Map();
|
|
2438
|
+
function u(e) {
|
|
2439
|
+
for (let [t, n] of l) n.stale_until <= e && !n.refreshing && l.delete(t);
|
|
2440
|
+
for (; l.size >= s;) {
|
|
2441
|
+
let e = l.keys().next().value;
|
|
2442
|
+
if (e === void 0) break;
|
|
2443
|
+
l.delete(e);
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
function d(e, t, n) {
|
|
2447
|
+
let r = n + (t === null ? o : i), s = {
|
|
2448
|
+
value: t,
|
|
2449
|
+
fresh_until: r,
|
|
2450
|
+
stale_until: t === null ? r : r + a
|
|
2451
|
+
};
|
|
2452
|
+
return l.delete(e), u(n), l.set(e, s), s;
|
|
2453
|
+
}
|
|
2454
|
+
function f(t) {
|
|
2455
|
+
let n = l.get(t);
|
|
2456
|
+
if (n?.refreshing) return n.refreshing;
|
|
2457
|
+
let r = n ?? {
|
|
2458
|
+
value: null,
|
|
2459
|
+
fresh_until: 0,
|
|
2460
|
+
stale_until: 0
|
|
2461
|
+
};
|
|
2462
|
+
n || (u(Date.now()), l.set(t, r));
|
|
2463
|
+
let i = (async () => {
|
|
2464
|
+
try {
|
|
2465
|
+
let n = await e.resolveHost(t);
|
|
2466
|
+
return d(t, n, Date.now()), n;
|
|
2467
|
+
} catch (e) {
|
|
2468
|
+
let n = l.get(t);
|
|
2469
|
+
throw n && (n.refreshing = void 0, n.stale_until <= Date.now() && l.delete(t)), e;
|
|
2470
|
+
}
|
|
2471
|
+
})();
|
|
2472
|
+
return r.refreshing = i, i;
|
|
2473
|
+
}
|
|
2474
|
+
return { async resolveHost(e) {
|
|
2475
|
+
let t = Date.now(), n = l.get(e);
|
|
2476
|
+
if (n && n.fresh_until > t) return l.delete(e), l.set(e, n), n.value;
|
|
2477
|
+
if (n && n.stale_until > t) {
|
|
2478
|
+
if (l.delete(e), l.set(e, n), !n.refreshing) {
|
|
2479
|
+
let t = f(e).catch(() => void 0);
|
|
2480
|
+
c && c(t);
|
|
2481
|
+
}
|
|
2482
|
+
return n.value;
|
|
2483
|
+
}
|
|
2484
|
+
return f(e);
|
|
2485
|
+
} };
|
|
2486
|
+
}
|
|
2487
|
+
//#endregion
|
|
2488
|
+
//#region src/data-plane/registry.ts
|
|
2489
|
+
var I = class {
|
|
2490
|
+
definitions = /* @__PURE__ */ new Map();
|
|
2491
|
+
bindings;
|
|
2492
|
+
constructor(e = {}) {
|
|
2493
|
+
this.bindings = e;
|
|
2494
|
+
}
|
|
2495
|
+
add(e) {
|
|
2496
|
+
return this.definitions.set(e.type, e), this;
|
|
2497
|
+
}
|
|
2498
|
+
has(e) {
|
|
2499
|
+
return this.definitions.has(e);
|
|
2500
|
+
}
|
|
2501
|
+
build(e, t) {
|
|
2502
|
+
let n = this.definitions.get(e);
|
|
2503
|
+
if (!n) throw Error(`Unknown proxy handler type: ${e}`);
|
|
2504
|
+
let r = n.optionsSchema.safeParse(t);
|
|
2505
|
+
if (!r.success) throw Error(`Invalid options for proxy handler "${e}": ${r.error.message}`);
|
|
2506
|
+
return n.build(r.data, { bindings: this.bindings });
|
|
2507
|
+
}
|
|
2508
|
+
};
|
|
2509
|
+
function L(e) {
|
|
2510
|
+
return e;
|
|
2511
|
+
}
|
|
2512
|
+
//#endregion
|
|
2513
|
+
//#region src/data-plane/handlers/cors.ts
|
|
2514
|
+
var Rn = e.object({
|
|
2515
|
+
origins: e.array(e.string()).optional(),
|
|
2516
|
+
allow_credentials: e.boolean().optional(),
|
|
2517
|
+
allow_headers: e.array(e.string()).optional(),
|
|
2518
|
+
allow_methods: e.array(e.string()).optional(),
|
|
2519
|
+
expose_headers: e.array(e.string()).optional(),
|
|
2520
|
+
max_age: e.number().int().optional()
|
|
2521
|
+
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2522
|
+
function R(e, t) {
|
|
2523
|
+
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2524
|
+
return i && !e.allow_credentials ? n.set("Access-Control-Allow-Origin", "*") : t && (i || r.includes(t)) && (n.set("Access-Control-Allow-Origin", t), n.append("Vary", "Origin")), e.allow_credentials && n.set("Access-Control-Allow-Credentials", "true"), e.allow_methods?.length && n.set("Access-Control-Allow-Methods", e.allow_methods.join(", ")), e.allow_headers?.length && n.set("Access-Control-Allow-Headers", e.allow_headers.join(", ")), e.expose_headers?.length && n.set("Access-Control-Expose-Headers", e.expose_headers.join(", ")), e.max_age !== void 0 && n.set("Access-Control-Max-Age", String(e.max_age)), n;
|
|
2525
|
+
}
|
|
2526
|
+
var z = L({
|
|
2527
|
+
type: "cors",
|
|
2528
|
+
optionsSchema: Rn,
|
|
2529
|
+
build(e) {
|
|
2530
|
+
return async (t, n) => {
|
|
2531
|
+
let r = t.req.header("origin") ?? null;
|
|
2532
|
+
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2533
|
+
let t = R(e, r);
|
|
2534
|
+
return new Response(null, {
|
|
2535
|
+
status: 204,
|
|
2536
|
+
headers: t
|
|
2537
|
+
});
|
|
2538
|
+
}
|
|
2539
|
+
await n(), R(e, r).forEach((e, n) => {
|
|
2540
|
+
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2541
|
+
});
|
|
2542
|
+
};
|
|
2543
|
+
}
|
|
2544
|
+
}), zn = e.object({
|
|
2545
|
+
username: e.string(),
|
|
2546
|
+
password: e.string(),
|
|
2547
|
+
realm: e.string().optional()
|
|
2548
|
+
});
|
|
2549
|
+
function Bn(e, t) {
|
|
2550
|
+
let n = `${e}:${t}`;
|
|
2551
|
+
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2552
|
+
}
|
|
2553
|
+
var B = L({
|
|
2554
|
+
type: "basic_auth",
|
|
2555
|
+
optionsSchema: zn,
|
|
2556
|
+
build(e) {
|
|
2557
|
+
let t = Bn(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2558
|
+
return async (e, r) => {
|
|
2559
|
+
let i = e.req.header("authorization");
|
|
2560
|
+
if (i) {
|
|
2561
|
+
let e = i.indexOf(" ");
|
|
2562
|
+
if (e > 0) {
|
|
2563
|
+
let n = i.slice(0, e), a = i.slice(e + 1);
|
|
2564
|
+
if (n.toLowerCase() === "basic" && a === t) return r();
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
return new Response("Unauthorized", {
|
|
2568
|
+
status: 401,
|
|
2569
|
+
headers: { "WWW-Authenticate": `Basic realm="${n}"` }
|
|
2570
|
+
});
|
|
2571
|
+
};
|
|
2572
|
+
}
|
|
2573
|
+
}), V = "__authhero_proxy_request__";
|
|
2574
|
+
function Vn(e, t) {
|
|
2575
|
+
e.set(V, t);
|
|
2576
|
+
}
|
|
2577
|
+
function H(e) {
|
|
2578
|
+
return e.get(V) ?? e.req.raw;
|
|
2579
|
+
}
|
|
2580
|
+
function U(e, t) {
|
|
2581
|
+
let n = H(e), r = new Headers(n.headers);
|
|
2582
|
+
t(r), Vn(e, new Request(n, { headers: r }));
|
|
2583
|
+
}
|
|
2584
|
+
var Hn = L({
|
|
2585
|
+
type: "headers",
|
|
2586
|
+
optionsSchema: e.object({
|
|
2587
|
+
request: e.record(e.string(), e.string()).optional(),
|
|
2588
|
+
response: e.record(e.string(), e.string()).optional(),
|
|
2589
|
+
remove_request: e.array(e.string()).optional(),
|
|
2590
|
+
remove_response: e.array(e.string()).optional()
|
|
2591
|
+
}),
|
|
2592
|
+
build(e) {
|
|
2593
|
+
return async (t, n) => {
|
|
2594
|
+
if ((e.request || e.remove_request) && U(t, (t) => {
|
|
2595
|
+
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2596
|
+
}), await n(), (e.response || e.remove_response) && (e.remove_response?.forEach((e) => t.res.headers.delete(e)), e.response)) for (let [n, r] of Object.entries(e.response)) t.res.headers.set(n, r);
|
|
2597
|
+
};
|
|
2598
|
+
}
|
|
2599
|
+
}), W = L({
|
|
2600
|
+
type: "cache",
|
|
2601
|
+
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2602
|
+
build(e) {
|
|
2603
|
+
return async (t, n) => {
|
|
2604
|
+
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2605
|
+
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2606
|
+
t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2607
|
+
}
|
|
2608
|
+
};
|
|
2609
|
+
}
|
|
2610
|
+
}), G = L({
|
|
2611
|
+
type: "forwarded_headers",
|
|
2612
|
+
optionsSchema: e.object({
|
|
2613
|
+
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
2614
|
+
set_x_real_ip: e.boolean().default(!0),
|
|
2615
|
+
set_x_original_url: e.boolean().default(!0)
|
|
2616
|
+
}),
|
|
2617
|
+
build(e) {
|
|
2618
|
+
return async (t, n) => {
|
|
2619
|
+
let r = new URL(t.req.url);
|
|
2620
|
+
U(t, (n) => {
|
|
2621
|
+
n.set("x-forwarded-host", r.host), n.set("x-forwarded-proto", r.protocol.replace(":", "")), e.set_x_original_url && n.set("x-original-url", t.req.url);
|
|
2622
|
+
let i = n.get(e.client_ip_header), a = (n.get("x-forwarded-for") ?? "").split(",").map((e) => e.trim()).filter(Boolean), o = i ?? a[a.length - 1] ?? "127.0.0.1", s = a.length === 0 || a[a.length - 1] !== o, c = a.length ? s ? `${a.join(", ")}, ${o}` : a.join(", ") : o;
|
|
2623
|
+
n.set("x-forwarded-for", c), e.set_x_real_ip && n.set("x-real-ip", o);
|
|
2624
|
+
}), await n();
|
|
2625
|
+
};
|
|
2626
|
+
}
|
|
2627
|
+
}), Un = e.object({ upstream_host: e.string().optional() });
|
|
2628
|
+
function Wn(e) {
|
|
2629
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2630
|
+
}
|
|
2631
|
+
function Gn(e) {
|
|
2632
|
+
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
2633
|
+
let t = [];
|
|
2634
|
+
return e.forEach((e, n) => {
|
|
2635
|
+
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
2636
|
+
}), t;
|
|
2637
|
+
}
|
|
2638
|
+
var K = L({
|
|
2639
|
+
type: "rewrite_cookies",
|
|
2640
|
+
optionsSchema: Un,
|
|
2641
|
+
build(e) {
|
|
2642
|
+
return async (t, n) => {
|
|
2643
|
+
await n();
|
|
2644
|
+
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
2645
|
+
if (!i) return;
|
|
2646
|
+
let a = Gn(t.res.headers);
|
|
2647
|
+
if (a.length === 0) return;
|
|
2648
|
+
let o = Wn(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
2649
|
+
t.res.headers.delete("set-cookie");
|
|
2650
|
+
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
2651
|
+
};
|
|
2652
|
+
}
|
|
2653
|
+
}), q = L({
|
|
2654
|
+
type: "rewrite_location",
|
|
2655
|
+
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
2656
|
+
build(e) {
|
|
2657
|
+
return async (t, n) => {
|
|
2658
|
+
await n();
|
|
2659
|
+
let r = t.res.status;
|
|
2660
|
+
if (r < 300 || r >= 400) return;
|
|
2661
|
+
let i = t.res.headers.get("location");
|
|
2662
|
+
if (!i) return;
|
|
2663
|
+
let a = e.upstream_origin ?? t.get("__proxy_upstream_origin__");
|
|
2664
|
+
if (!a) return;
|
|
2665
|
+
let o;
|
|
2666
|
+
try {
|
|
2667
|
+
o = new URL(i);
|
|
2668
|
+
} catch {
|
|
2669
|
+
return;
|
|
2670
|
+
}
|
|
2671
|
+
if (o.origin !== a) return;
|
|
2672
|
+
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
2673
|
+
t.res.headers.set("location", c);
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
}), Kn = new Set([
|
|
2677
|
+
"connection",
|
|
2678
|
+
"keep-alive",
|
|
2679
|
+
"proxy-authenticate",
|
|
2680
|
+
"proxy-authorization",
|
|
2681
|
+
"te",
|
|
2682
|
+
"trailers",
|
|
2683
|
+
"transfer-encoding",
|
|
2684
|
+
"upgrade"
|
|
2685
|
+
]), qn = 3e4, Jn = e.object({
|
|
2686
|
+
upstream_url: e.string(),
|
|
2687
|
+
preserve_host: e.boolean().default(!1),
|
|
2688
|
+
timeout_ms: e.number().int().positive().optional()
|
|
2689
|
+
});
|
|
2690
|
+
function Yn(e, t) {
|
|
2691
|
+
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
2692
|
+
}
|
|
2693
|
+
function Xn(e) {
|
|
2694
|
+
return e !== "GET" && e !== "HEAD";
|
|
2695
|
+
}
|
|
2696
|
+
function J(e, t) {
|
|
2697
|
+
let n = new URL(t.url), r = new URL(e.upstream_url);
|
|
2698
|
+
r.pathname = Yn(r.pathname, n.pathname), r.search = n.search;
|
|
2699
|
+
let i = new Headers(t.headers);
|
|
2700
|
+
for (let e of Kn) i.delete(e);
|
|
2701
|
+
e.preserve_host || i.set("host", r.host), i.has("x-forwarded-host") || i.set("x-forwarded-host", n.host), i.has("x-forwarded-proto") || i.set("x-forwarded-proto", n.protocol.replace(":", ""));
|
|
2702
|
+
let a = Xn(t.method) ? t.body : void 0, o = {
|
|
2703
|
+
method: t.method,
|
|
2704
|
+
headers: i,
|
|
2705
|
+
body: a,
|
|
2706
|
+
redirect: "manual"
|
|
2707
|
+
};
|
|
2708
|
+
return a instanceof ReadableStream && (o.duplex = "half"), {
|
|
2709
|
+
target: r,
|
|
2710
|
+
init: o
|
|
2711
|
+
};
|
|
2712
|
+
}
|
|
2713
|
+
var Y = L({
|
|
2714
|
+
type: "http",
|
|
2715
|
+
optionsSchema: Jn,
|
|
2716
|
+
build(e) {
|
|
2717
|
+
let t = e.timeout_ms ?? qn;
|
|
2718
|
+
return async (n) => {
|
|
2719
|
+
let { target: r, init: i } = J(e, H(n));
|
|
2720
|
+
n.set("__proxy_upstream_host__", r.hostname), n.set("__proxy_upstream_origin__", `${r.protocol}//${r.host}`);
|
|
2721
|
+
let a = new AbortController(), o = setTimeout(() => a.abort(), t);
|
|
2722
|
+
try {
|
|
2723
|
+
return await fetch(r.toString(), {
|
|
2724
|
+
...i,
|
|
2725
|
+
signal: a.signal
|
|
2726
|
+
});
|
|
2727
|
+
} catch (e) {
|
|
2728
|
+
if (e instanceof Error && e.name === "AbortError") return new Response("Upstream timeout", { status: 504 });
|
|
2729
|
+
throw e;
|
|
2730
|
+
} finally {
|
|
2731
|
+
clearTimeout(o);
|
|
2732
|
+
}
|
|
2733
|
+
};
|
|
2734
|
+
}
|
|
2735
|
+
}), Zn = e.object({
|
|
2736
|
+
binding: e.string(),
|
|
2737
|
+
upstream_url: e.string().optional(),
|
|
2738
|
+
preserve_host: e.boolean().default(!0)
|
|
2739
|
+
});
|
|
2740
|
+
function Qn(e) {
|
|
2741
|
+
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
2742
|
+
}
|
|
2743
|
+
var X = L({
|
|
2744
|
+
type: "service_binding",
|
|
2745
|
+
optionsSchema: Zn,
|
|
2746
|
+
build(e, t) {
|
|
2747
|
+
let n = t.bindings[e.binding];
|
|
2748
|
+
if (!Qn(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
2749
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`;
|
|
2750
|
+
return async (t) => {
|
|
2751
|
+
let i = H(t), { target: a, init: o } = J({
|
|
2752
|
+
upstream_url: r,
|
|
2753
|
+
preserve_host: e.preserve_host
|
|
2754
|
+
}, i);
|
|
2755
|
+
return t.set("__proxy_upstream_host__", a.hostname), t.set("__proxy_upstream_origin__", `${a.protocol}//${a.host}`), n.fetch(new Request(a.toString(), o));
|
|
2756
|
+
};
|
|
2757
|
+
}
|
|
2758
|
+
}), $n = L({
|
|
2759
|
+
type: "redirect",
|
|
2760
|
+
optionsSchema: e.object({
|
|
2761
|
+
upstream_url: e.string().refine((e) => {
|
|
2762
|
+
try {
|
|
2763
|
+
let t = new URL(e);
|
|
2764
|
+
return (t.protocol === "http:" || t.protocol === "https:") && !!t.hostname;
|
|
2765
|
+
} catch {
|
|
2766
|
+
return !1;
|
|
2767
|
+
}
|
|
2768
|
+
}, { message: "upstream_url must be a valid http(s) URL with a hostname" }),
|
|
2769
|
+
status: e.union([
|
|
2770
|
+
e.literal(301),
|
|
2771
|
+
e.literal(302),
|
|
2772
|
+
e.literal(307),
|
|
2773
|
+
e.literal(308)
|
|
2774
|
+
]).default(302),
|
|
2775
|
+
preserve_path: e.boolean().default(!0),
|
|
2776
|
+
preserve_query: e.boolean().default(!0)
|
|
2777
|
+
}),
|
|
2778
|
+
build(e) {
|
|
2779
|
+
return async (t) => {
|
|
2780
|
+
let n = new URL(t.req.url), r = new URL(e.upstream_url), i = r.pathname && r.pathname !== "/";
|
|
2781
|
+
return e.preserve_path && !i && (r.pathname = n.pathname), e.preserve_query && !r.search && (r.search = n.search), new Response(null, {
|
|
2782
|
+
status: e.status,
|
|
2783
|
+
headers: { location: r.toString() }
|
|
2784
|
+
});
|
|
2785
|
+
};
|
|
2786
|
+
}
|
|
2787
|
+
}), er = L({
|
|
2788
|
+
type: "static",
|
|
2789
|
+
optionsSchema: e.object({
|
|
2790
|
+
status: e.number().int().default(200),
|
|
2791
|
+
headers: e.record(e.string(), e.string()).optional(),
|
|
2792
|
+
body: e.string().optional(),
|
|
2793
|
+
json: e.unknown().optional()
|
|
2794
|
+
}),
|
|
2795
|
+
build(e) {
|
|
2796
|
+
return async () => {
|
|
2797
|
+
let t = new Headers(e.headers ?? {}), n = e.body ?? null;
|
|
2798
|
+
return e.json !== void 0 && (n = JSON.stringify(e.json), t.has("content-type") || t.set("content-type", "application/json; charset=utf-8")), new Response(n, {
|
|
2799
|
+
status: e.status,
|
|
2800
|
+
headers: t
|
|
2801
|
+
});
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
});
|
|
2805
|
+
//#endregion
|
|
2806
|
+
//#region src/data-plane/handlers/index.ts
|
|
2807
|
+
function tr(e) {
|
|
2808
|
+
e.add(z).add(B).add(Hn).add(W).add(G).add(K).add(q).add(Y).add(X).add($n).add(er);
|
|
2809
|
+
}
|
|
2810
|
+
//#endregion
|
|
2811
|
+
//#region src/data-plane/matcher.ts
|
|
2812
|
+
function nr(e) {
|
|
2813
|
+
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
2814
|
+
}
|
|
2815
|
+
function rr(e, t) {
|
|
2816
|
+
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
2817
|
+
if (n === r) return !0;
|
|
2818
|
+
if (n.startsWith("*.")) {
|
|
2819
|
+
let e = n.slice(1);
|
|
2820
|
+
return r.endsWith(e) && r.length > e.length;
|
|
2821
|
+
}
|
|
2822
|
+
return !1;
|
|
2823
|
+
}
|
|
2824
|
+
function Z(e, t) {
|
|
2825
|
+
return !e || e.length === 0 ? !0 : e.some((e) => rr(e, t));
|
|
2826
|
+
}
|
|
2827
|
+
function ir(e) {
|
|
2828
|
+
let t = (e.headers ? Object.entries(e.headers) : []).map(([e, t]) => [e.toLowerCase(), new RegExp(t)]), n = (e.query ? Object.entries(e.query) : []).map(([e, t]) => [e, new RegExp(t)]), r = e.hosts;
|
|
2829
|
+
return async (e, i) => {
|
|
2830
|
+
if (r && !Z(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
2831
|
+
for (let [n, r] of t) {
|
|
2832
|
+
let t = e.req.header(n);
|
|
2833
|
+
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
2834
|
+
}
|
|
2835
|
+
if (n.length > 0) {
|
|
2836
|
+
let t = new URL(e.req.url);
|
|
2837
|
+
for (let [e, r] of n) {
|
|
2838
|
+
let n = t.searchParams.get(e);
|
|
2839
|
+
if (n === null || !r.test(n)) return new Response("No matching route", { status: 404 });
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
await i();
|
|
2843
|
+
};
|
|
2844
|
+
}
|
|
2845
|
+
//#endregion
|
|
2846
|
+
//#region src/data-plane/compile.ts
|
|
2847
|
+
var ar = [
|
|
2848
|
+
"GET",
|
|
2849
|
+
"POST",
|
|
2850
|
+
"PUT",
|
|
2851
|
+
"PATCH",
|
|
2852
|
+
"DELETE",
|
|
2853
|
+
"OPTIONS",
|
|
2854
|
+
"HEAD"
|
|
2855
|
+
];
|
|
2856
|
+
function or(e, n) {
|
|
2857
|
+
let r = new t(), i = nr(e);
|
|
2858
|
+
for (let e of i) {
|
|
2859
|
+
let t = [];
|
|
2860
|
+
t.push(ir(e.match));
|
|
2861
|
+
for (let r of e.handlers) t.push(n.build(r.type, r.options));
|
|
2862
|
+
let i = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : ar, a = e.match.path || "/*";
|
|
2863
|
+
r.on(i, [a], ...t);
|
|
2864
|
+
}
|
|
2865
|
+
return r.all("*", (e) => e.text("No matching route", 404)), r;
|
|
2866
|
+
}
|
|
2867
|
+
//#endregion
|
|
2868
|
+
//#region src/data-plane/router.ts
|
|
2869
|
+
function sr(e) {
|
|
2870
|
+
return e.resolver ? e.resolver : e.cache ? F(e.data, e.cache) : F(e.data, e.cacheTtlMs ?? 3e4);
|
|
2871
|
+
}
|
|
2872
|
+
function cr(e) {
|
|
2873
|
+
if (e.registry) return e.registry;
|
|
2874
|
+
let t = new I(e.bindings ?? {});
|
|
2875
|
+
return tr(t), t;
|
|
2876
|
+
}
|
|
2877
|
+
function Q(e) {
|
|
2878
|
+
let t = sr(e), n = cr(e), r = /* @__PURE__ */ new WeakMap();
|
|
2879
|
+
return async (e) => {
|
|
2880
|
+
let i = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
2881
|
+
if (!i) return e.text("Missing host", 400);
|
|
2882
|
+
let a = await t.resolveHost(i);
|
|
2883
|
+
if (!a) return e.text("Unknown host", 404);
|
|
2884
|
+
let o = r.get(a);
|
|
2885
|
+
return o || (o = or(a.routes, n), r.set(a, o)), o.fetch(e.req.raw);
|
|
2886
|
+
};
|
|
2887
|
+
}
|
|
2888
|
+
function lr(e) {
|
|
2889
|
+
let n = new t();
|
|
2890
|
+
return n.all("*", Q(e)), n;
|
|
2891
|
+
}
|
|
2892
|
+
//#endregion
|
|
2893
|
+
//#region src/app.ts
|
|
2894
|
+
function ur(e) {
|
|
2895
|
+
let n = new t();
|
|
2896
|
+
return n.all("*", Q({
|
|
2897
|
+
data: e.data,
|
|
2898
|
+
cacheTtlMs: e.cacheTtlMs,
|
|
2899
|
+
cache: e.cache,
|
|
2900
|
+
registry: e.registry,
|
|
2901
|
+
bindings: e.bindings
|
|
2902
|
+
})), n;
|
|
2903
|
+
}
|
|
2904
|
+
//#endregion
|
|
2905
|
+
//#region src/data-plane/cache-api-cache.ts
|
|
2906
|
+
function dr(e, t) {
|
|
2907
|
+
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
2908
|
+
}
|
|
2909
|
+
function fr() {
|
|
2910
|
+
return globalThis.caches?.default;
|
|
2911
|
+
}
|
|
2912
|
+
function pr(e) {
|
|
2913
|
+
let t = e.cache ?? fr();
|
|
2914
|
+
if (!t) return e.upstream;
|
|
2915
|
+
let n = e.namespace ?? "authhero-proxy", r = e.cacheTtlSeconds ?? 60, i = e.negativeCacheTtlSeconds ?? 10, a = e.waitUntil;
|
|
2916
|
+
return { async resolveHost(o) {
|
|
2917
|
+
let s = dr(n, o), c = await t.match(s);
|
|
2918
|
+
if (c) try {
|
|
2919
|
+
return (await c.json()).value;
|
|
2920
|
+
} catch {}
|
|
2921
|
+
let l = await e.upstream.resolveHost(o), u = l === null ? i : r, d = new Response(JSON.stringify({ value: l }), { headers: {
|
|
2922
|
+
"content-type": "application/json",
|
|
2923
|
+
"cache-control": `public, max-age=${u}`
|
|
2924
|
+
} }), f = t.put(s, d);
|
|
2925
|
+
return a ? a(f) : await f.catch(() => void 0), l;
|
|
2926
|
+
} };
|
|
2927
|
+
}
|
|
2928
|
+
function mr(e, t) {
|
|
2929
|
+
return dr(e, t);
|
|
2930
|
+
}
|
|
2931
|
+
//#endregion
|
|
2932
|
+
//#region src/static/index.ts
|
|
2933
|
+
function $() {
|
|
2934
|
+
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
2935
|
+
}
|
|
2936
|
+
function hr(e, t, n, r, i, a) {
|
|
2937
|
+
return {
|
|
2938
|
+
id: e.id ?? `${n}:${t}`,
|
|
2939
|
+
tenant_id: r,
|
|
2940
|
+
custom_domain_id: i,
|
|
2941
|
+
priority: e.priority ?? 100,
|
|
2942
|
+
match: {
|
|
2943
|
+
...e.match,
|
|
2944
|
+
path: e.match.path || "/*"
|
|
2945
|
+
},
|
|
2946
|
+
handlers: e.handlers,
|
|
2947
|
+
created_at: e.created_at ?? a,
|
|
2948
|
+
updated_at: e.updated_at ?? a
|
|
2949
|
+
};
|
|
2950
|
+
}
|
|
2951
|
+
function gr(e) {
|
|
2952
|
+
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
2953
|
+
for (let [i, a] of Object.entries(e.hosts)) {
|
|
2954
|
+
let e = i.toLowerCase(), o = Array.isArray(a) ? { routes: a } : a, s = o.tenant_id ?? n, c = o.custom_domain_id ?? e, l = o.routes.map((n, r) => hr(n, r, e, s, c, t)).sort((e, t) => e.priority - t.priority);
|
|
2955
|
+
r.set(e, {
|
|
2956
|
+
tenant_id: s,
|
|
2957
|
+
custom_domain_id: c,
|
|
2958
|
+
domain: e,
|
|
2959
|
+
routes: l
|
|
2960
|
+
});
|
|
2961
|
+
}
|
|
2962
|
+
return {
|
|
2963
|
+
proxyRoutes: {
|
|
2964
|
+
async create() {
|
|
2965
|
+
return $();
|
|
2966
|
+
},
|
|
2967
|
+
async update() {
|
|
2968
|
+
return $();
|
|
2969
|
+
},
|
|
2970
|
+
async remove() {
|
|
2971
|
+
return $();
|
|
2972
|
+
},
|
|
2973
|
+
async get(e, t) {
|
|
2974
|
+
for (let n of r.values()) {
|
|
2975
|
+
if (n.tenant_id !== e) continue;
|
|
2976
|
+
let r = n.routes.find((e) => e.id === t);
|
|
2977
|
+
if (r) return r;
|
|
2978
|
+
}
|
|
2979
|
+
return null;
|
|
2980
|
+
},
|
|
2981
|
+
async list(e, t) {
|
|
2982
|
+
let n = [];
|
|
2983
|
+
for (let i of r.values()) i.tenant_id === e && (t?.custom_domain_id && i.custom_domain_id !== t.custom_domain_id || n.push(...i.routes));
|
|
2984
|
+
let i = t?.per_page ?? n.length, a = (t?.page ?? 0) * i, o = n.slice(a, a + i);
|
|
2985
|
+
return {
|
|
2986
|
+
proxy_routes: o,
|
|
2987
|
+
start: a,
|
|
2988
|
+
limit: i,
|
|
2989
|
+
length: o.length
|
|
2990
|
+
};
|
|
2991
|
+
}
|
|
2992
|
+
},
|
|
2993
|
+
async resolveHost(e) {
|
|
2994
|
+
return r.get(e.toLowerCase()) ?? null;
|
|
2995
|
+
}
|
|
2996
|
+
};
|
|
2997
|
+
}
|
|
2998
|
+
function _r(e, t = {}) {
|
|
2999
|
+
return {
|
|
3000
|
+
priority: t.priority,
|
|
3001
|
+
match: { path: t.path ?? "/*" },
|
|
3002
|
+
handlers: [{
|
|
3003
|
+
type: "http",
|
|
3004
|
+
options: {
|
|
3005
|
+
upstream_url: e,
|
|
3006
|
+
preserve_host: t.preserve_host ?? !1
|
|
3007
|
+
}
|
|
3008
|
+
}]
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
//#endregion
|
|
3012
|
+
//#region src/http-adapter/index.ts
|
|
3013
|
+
function vr() {
|
|
3014
|
+
let e = () => {
|
|
3015
|
+
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3016
|
+
};
|
|
3017
|
+
return {
|
|
3018
|
+
async create() {
|
|
3019
|
+
return e();
|
|
3020
|
+
},
|
|
3021
|
+
async update() {
|
|
3022
|
+
return e();
|
|
3023
|
+
},
|
|
3024
|
+
async remove() {
|
|
3025
|
+
return e();
|
|
3026
|
+
},
|
|
3027
|
+
async get() {
|
|
3028
|
+
throw Error("HTTP proxy adapter does not expose per-route reads; use resolveHost");
|
|
3029
|
+
},
|
|
3030
|
+
async list() {
|
|
3031
|
+
throw Error("HTTP proxy adapter does not expose per-route reads; use resolveHost");
|
|
3032
|
+
}
|
|
3033
|
+
};
|
|
3034
|
+
}
|
|
3035
|
+
function yr(e) {
|
|
3036
|
+
let t = e.fetch ?? fetch, n = e.baseUrl.replace(/\/+$/, ""), r = e.resolveHostPath ?? "/api/v2/proxy/control-plane/hosts/", i = e.audience ?? `${n}/api/v2/`, a = e.tokenRefreshSkewSeconds ?? 60, o = e.timeoutMs ?? 5e3;
|
|
3037
|
+
function s(e) {
|
|
3038
|
+
let t = new AbortController(), n = setTimeout(() => t.abort(), o);
|
|
3039
|
+
return e(t.signal).finally(() => clearTimeout(n));
|
|
3040
|
+
}
|
|
3041
|
+
let c = null, l = null;
|
|
3042
|
+
async function u() {
|
|
3043
|
+
let r = await s((r) => t(`${n}/oauth/token`, {
|
|
3044
|
+
method: "POST",
|
|
3045
|
+
headers: { "content-type": "application/json" },
|
|
3046
|
+
body: JSON.stringify({
|
|
3047
|
+
grant_type: "client_credentials",
|
|
3048
|
+
client_id: e.clientId,
|
|
3049
|
+
client_secret: e.clientSecret,
|
|
3050
|
+
audience: i
|
|
3051
|
+
}),
|
|
3052
|
+
signal: r
|
|
3053
|
+
}));
|
|
3054
|
+
if (!r.ok) throw Error(`Proxy adapter token request failed: ${r.status} ${await r.text().catch(() => "")}`);
|
|
3055
|
+
let o = await r.json(), l = o.expires_in ?? 3600;
|
|
3056
|
+
return c = {
|
|
3057
|
+
value: o.access_token,
|
|
3058
|
+
expires_at: Date.now() + (l - a) * 1e3
|
|
3059
|
+
}, o.access_token;
|
|
3060
|
+
}
|
|
3061
|
+
async function d() {
|
|
3062
|
+
return c && c.expires_at > Date.now() ? c.value : l || (l = u().finally(() => {
|
|
3063
|
+
l = null;
|
|
3064
|
+
}), l);
|
|
3065
|
+
}
|
|
3066
|
+
return {
|
|
3067
|
+
proxyRoutes: vr(),
|
|
3068
|
+
async resolveHost(e) {
|
|
3069
|
+
let i = await d(), a = `${n}${r}${encodeURIComponent(e.toLowerCase())}`, o = await s((e) => t(a, {
|
|
3070
|
+
headers: { authorization: `Bearer ${i}` },
|
|
3071
|
+
signal: e
|
|
3072
|
+
}));
|
|
3073
|
+
if (o.status === 404) return null;
|
|
3074
|
+
if (!o.ok) throw Error(`Proxy adapter resolveHost failed: ${o.status} ${await o.text().catch(() => "")}`);
|
|
3075
|
+
return await o.json();
|
|
3076
|
+
}
|
|
3077
|
+
};
|
|
3078
|
+
}
|
|
3079
|
+
//#endregion
|
|
3080
|
+
export { I as HandlerRegistry, B as basicAuthHandler, mr as buildCacheApiKey, ir as buildMatchFilter, W as cacheHandler, or as compileHostApp, z as corsHandler, pr as createCacheApiHostCache, yr as createHttpProxyAdapter, F as createInMemoryHostCache, ur as createProxyApp, Q as createProxyDataPlaneHandler, lr as createProxyDataPlaneRouter, gr as createStaticProxyAdapter, L as defineHandler, G as forwardedHeadersHandler, j as handlerConfigSchema, Hn as headersHandler, Y as httpHandler, _r as httpRoute, A as matchSchema, Z as matchesAnyHost, rr as matchesHost, M as proxyRouteInsertSchema, _n as proxyRouteSchema, vn as proxyRouteUpdateSchema, $n as redirectHandler, tr as registerBuiltinHandlers, K as rewriteCookiesHandler, q as rewriteLocationHandler, X as serviceBindingHandler, nr as sortRoutes, er as staticHandler };
|