@authhero/proxy 0.10.15 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/proxy.cjs +1 -1
- package/dist/proxy.d.ts +10 -3
- package/dist/proxy.mjs +692 -621
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/adapter.d.ts +8 -1
- package/dist/types/data-plane/cache.d.ts +2 -2
- package/dist/types/data-plane/timeout.d.ts +2 -0
- package/package.json +2 -2
package/dist/proxy.mjs
CHANGED
|
@@ -121,7 +121,7 @@ var h = e.enum([
|
|
|
121
121
|
old: e.unknown(),
|
|
122
122
|
new: e.unknown()
|
|
123
123
|
})).optional()
|
|
124
|
-
}),
|
|
124
|
+
}), ee = e.object({
|
|
125
125
|
method: e.string(),
|
|
126
126
|
path: e.string(),
|
|
127
127
|
query: e.record(e.string(), e.string()).optional(),
|
|
@@ -130,17 +130,17 @@ var h = e.enum([
|
|
|
130
130
|
user_agent: e.string().optional(),
|
|
131
131
|
correlation_id: e.string().optional(),
|
|
132
132
|
redirect_uri: e.string().optional()
|
|
133
|
-
}),
|
|
133
|
+
}), v = e.object({
|
|
134
134
|
status_code: e.number(),
|
|
135
135
|
body: e.unknown().optional()
|
|
136
|
-
}),
|
|
136
|
+
}), te = e.object({
|
|
137
137
|
country_code: e.string(),
|
|
138
138
|
city_name: e.string(),
|
|
139
139
|
latitude: e.string(),
|
|
140
140
|
longitude: e.string(),
|
|
141
141
|
time_zone: e.string(),
|
|
142
142
|
continent_code: e.string()
|
|
143
|
-
}),
|
|
143
|
+
}), ne = e.object({
|
|
144
144
|
name: e.string(),
|
|
145
145
|
version: e.string(),
|
|
146
146
|
env: e.record(e.string(), e.string()).optional()
|
|
@@ -153,8 +153,8 @@ e.object({
|
|
|
153
153
|
category: h,
|
|
154
154
|
actor: g,
|
|
155
155
|
target: _,
|
|
156
|
-
request:
|
|
157
|
-
response:
|
|
156
|
+
request: ee,
|
|
157
|
+
response: v.optional(),
|
|
158
158
|
connection: e.string().optional(),
|
|
159
159
|
connection_id: e.string().optional(),
|
|
160
160
|
client_name: e.string().optional(),
|
|
@@ -162,8 +162,8 @@ e.object({
|
|
|
162
162
|
strategy_type: e.string().optional(),
|
|
163
163
|
audience: e.string().optional(),
|
|
164
164
|
scope: e.string().optional(),
|
|
165
|
-
location:
|
|
166
|
-
auth0_client:
|
|
165
|
+
location: te.optional(),
|
|
166
|
+
auth0_client: ne.optional(),
|
|
167
167
|
hostname: e.string(),
|
|
168
168
|
is_mobile: e.boolean().optional(),
|
|
169
169
|
timestamp: e.string()
|
|
@@ -178,14 +178,14 @@ e.object({
|
|
|
178
178
|
"SEND_REQUEST",
|
|
179
179
|
"SEND_EMAIL"
|
|
180
180
|
]), e.enum(["VERIFY_EMAIL"]);
|
|
181
|
-
var
|
|
181
|
+
var re = e.object({
|
|
182
182
|
require_mx_record: e.boolean().optional(),
|
|
183
183
|
block_aliases: e.boolean().optional(),
|
|
184
184
|
block_free_emails: e.boolean().optional(),
|
|
185
185
|
block_disposable_emails: e.boolean().optional(),
|
|
186
186
|
blocklist: e.array(e.string()).optional(),
|
|
187
187
|
allowlist: e.array(e.string()).optional()
|
|
188
|
-
}),
|
|
188
|
+
}), ie = e.object({
|
|
189
189
|
id: e.string(),
|
|
190
190
|
alias: e.string().max(100).optional(),
|
|
191
191
|
type: e.literal("AUTH0"),
|
|
@@ -197,7 +197,7 @@ var ne = e.object({
|
|
|
197
197
|
user_id: e.string(),
|
|
198
198
|
changes: e.record(e.string(), e.any())
|
|
199
199
|
})
|
|
200
|
-
}),
|
|
200
|
+
}), ae = e.object({
|
|
201
201
|
id: e.string(),
|
|
202
202
|
alias: e.string().max(100).optional(),
|
|
203
203
|
type: e.literal("EMAIL"),
|
|
@@ -206,13 +206,13 @@ var ne = e.object({
|
|
|
206
206
|
mask_output: e.boolean().optional(),
|
|
207
207
|
params: e.object({
|
|
208
208
|
email: e.string(),
|
|
209
|
-
rules:
|
|
209
|
+
rules: re.optional()
|
|
210
210
|
})
|
|
211
|
-
}),
|
|
211
|
+
}), oe = e.enum([
|
|
212
212
|
"change-email",
|
|
213
213
|
"account",
|
|
214
214
|
"custom"
|
|
215
|
-
]),
|
|
215
|
+
]), se = e.object({
|
|
216
216
|
id: e.string(),
|
|
217
217
|
alias: e.string().max(100).optional(),
|
|
218
218
|
type: e.literal("REDIRECT"),
|
|
@@ -220,17 +220,17 @@ var ne = e.object({
|
|
|
220
220
|
allow_failure: e.boolean().optional(),
|
|
221
221
|
mask_output: e.boolean().optional(),
|
|
222
222
|
params: e.object({
|
|
223
|
-
target:
|
|
223
|
+
target: oe.openapi({ description: "The predefined target to redirect to, or 'custom' for a custom URL" }),
|
|
224
224
|
custom_url: e.string().optional().openapi({ description: "Custom URL to redirect to when target is 'custom'" })
|
|
225
225
|
})
|
|
226
|
-
}),
|
|
227
|
-
re,
|
|
226
|
+
}), ce = e.union([
|
|
228
227
|
ie,
|
|
229
|
-
|
|
228
|
+
ae,
|
|
229
|
+
se
|
|
230
230
|
]);
|
|
231
231
|
e.object({
|
|
232
232
|
name: e.string().min(1).max(150).openapi({ description: "The name of the flow" }),
|
|
233
|
-
actions: e.array(
|
|
233
|
+
actions: e.array(ce).optional().default([]).openapi({ description: "The list of actions to execute in sequence" })
|
|
234
234
|
}).extend(n.shape).extend({ id: e.string().openapi({
|
|
235
235
|
description: "Unique identifier for the flow",
|
|
236
236
|
example: "af_12tMpdJ3iek7svMyZkSh5M"
|
|
@@ -247,7 +247,7 @@ e.object({
|
|
|
247
247
|
total: e.number().optional(),
|
|
248
248
|
next: e.string().optional()
|
|
249
249
|
});
|
|
250
|
-
var
|
|
250
|
+
var le = e.object({
|
|
251
251
|
email: e.string().optional(),
|
|
252
252
|
email_verified: e.boolean().optional(),
|
|
253
253
|
name: e.string().optional(),
|
|
@@ -256,7 +256,7 @@ var ce = e.object({
|
|
|
256
256
|
phone_number: e.string().optional(),
|
|
257
257
|
phone_verified: e.boolean().optional(),
|
|
258
258
|
family_name: e.string().optional()
|
|
259
|
-
}).catchall(e.any()),
|
|
259
|
+
}).catchall(e.any()), ue = e.object({
|
|
260
260
|
connection: e.string(),
|
|
261
261
|
user_id: e.string(),
|
|
262
262
|
provider: e.string(),
|
|
@@ -269,15 +269,15 @@ var ce = e.object({
|
|
|
269
269
|
access_token: e.string().optional(),
|
|
270
270
|
access_token_secret: e.string().optional(),
|
|
271
271
|
refresh_token: e.string().optional(),
|
|
272
|
-
profileData:
|
|
273
|
-
}),
|
|
272
|
+
profileData: le.optional()
|
|
273
|
+
}), de = e.object({
|
|
274
274
|
formatted: e.string().optional(),
|
|
275
275
|
street_address: e.string().optional(),
|
|
276
276
|
locality: e.string().optional(),
|
|
277
277
|
region: e.string().optional(),
|
|
278
278
|
postal_code: e.string().optional(),
|
|
279
279
|
country: e.string().optional()
|
|
280
|
-
}).optional(),
|
|
280
|
+
}).optional(), fe = e.object({
|
|
281
281
|
email: e.string().transform((e) => e.toLowerCase()).optional(),
|
|
282
282
|
username: e.string().refine((e) => !e.includes("@"), { message: "Usernames must not contain \"@\". Use the email field for email addresses." }).optional(),
|
|
283
283
|
phone_number: e.string().optional(),
|
|
@@ -300,9 +300,9 @@ var ce = e.object({
|
|
|
300
300
|
gender: e.string().optional(),
|
|
301
301
|
birthdate: e.string().optional(),
|
|
302
302
|
zoneinfo: e.string().optional(),
|
|
303
|
-
address:
|
|
303
|
+
address: de
|
|
304
304
|
});
|
|
305
|
-
|
|
305
|
+
fe.extend({
|
|
306
306
|
email_verified: e.boolean().default(!1),
|
|
307
307
|
verify_email: e.boolean().optional(),
|
|
308
308
|
last_ip: e.string().optional(),
|
|
@@ -323,24 +323,24 @@ de.extend({
|
|
|
323
323
|
is_social: e.boolean(),
|
|
324
324
|
email: e.string().optional(),
|
|
325
325
|
login_count: e.number().default(0),
|
|
326
|
-
identities: e.array(
|
|
327
|
-
}).omit({ registration_completed_at: !0 }),
|
|
326
|
+
identities: e.array(ue).optional()
|
|
327
|
+
}).omit({ registration_completed_at: !0 }), fe.extend({
|
|
328
328
|
login_count: e.number(),
|
|
329
329
|
multifactor: e.array(e.string()).optional(),
|
|
330
330
|
last_ip: e.string().optional(),
|
|
331
331
|
last_login: e.string().optional(),
|
|
332
332
|
user_id: e.string()
|
|
333
333
|
}).catchall(e.any());
|
|
334
|
-
var
|
|
334
|
+
var pe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", me = (e = 21) => {
|
|
335
335
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
336
|
-
for (; e--;) t +=
|
|
336
|
+
for (; e--;) t += pe[n[e] & 63];
|
|
337
337
|
return t;
|
|
338
|
-
},
|
|
338
|
+
}, he = e.object({
|
|
339
339
|
client_id: e.string().optional().openapi({ description: "ID of this client. Generated server-side if omitted (Auth0 behavior)." }),
|
|
340
340
|
name: e.string().min(1).openapi({ description: "Name of this client (min length: 1 character, does not allow < or >)." }),
|
|
341
341
|
description: e.string().max(140).optional().openapi({ description: "Free text description of this client (max length: 140 characters)." }),
|
|
342
342
|
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)." }),
|
|
343
|
-
client_secret: e.string().default(() =>
|
|
343
|
+
client_secret: e.string().default(() => me()).optional().openapi({ description: "Client secret (which you must not make public)." }),
|
|
344
344
|
app_type: e.enum([
|
|
345
345
|
"native",
|
|
346
346
|
"spa",
|
|
@@ -452,13 +452,14 @@ var fe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", pe
|
|
|
452
452
|
"iat_dcr"
|
|
453
453
|
]).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." }),
|
|
454
454
|
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." }),
|
|
455
|
+
token_exchange: e.object({ allow_any_profile_of_type: e.array(e.literal("custom_authentication")).optional() }).optional().openapi({ description: "Custom Token Exchange settings. Set `allow_any_profile_of_type` to `[\"custom_authentication\"]` to let this client exchange subject tokens through the tenant's token exchange profiles." }),
|
|
455
456
|
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." })
|
|
456
457
|
});
|
|
457
458
|
e.object({
|
|
458
459
|
created_at: e.string(),
|
|
459
460
|
updated_at: e.string()
|
|
460
|
-
}).extend(
|
|
461
|
-
var
|
|
461
|
+
}).extend(he.shape).extend({ client_id: e.string() });
|
|
462
|
+
var ge = e.object({
|
|
462
463
|
client_id: e.string().min(1).openapi({ description: "ID of the client." }),
|
|
463
464
|
audience: e.string().min(1).openapi({ description: "The audience (API identifier) of this client grant." }),
|
|
464
465
|
scope: e.array(e.string()).optional().openapi({ description: "Scopes allowed for this client grant." }),
|
|
@@ -471,15 +472,15 @@ var he = e.object({
|
|
|
471
472
|
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." }),
|
|
472
473
|
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." }),
|
|
473
474
|
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." })
|
|
474
|
-
}),
|
|
475
|
+
}), _e = e.object({ id: e.string().openapi({ description: "ID of the client grant." }) }).extend(ge.shape).extend({
|
|
475
476
|
created_at: e.string().optional(),
|
|
476
477
|
updated_at: e.string().optional()
|
|
477
478
|
});
|
|
478
|
-
e.array(
|
|
479
|
-
var
|
|
479
|
+
e.array(_e);
|
|
480
|
+
var ve = e.enum(["iat", "rat"]), ye = e.object({
|
|
480
481
|
id: e.string(),
|
|
481
482
|
token_hash: e.string(),
|
|
482
|
-
type:
|
|
483
|
+
type: ve,
|
|
483
484
|
client_id: e.string().optional(),
|
|
484
485
|
sub: e.string().optional(),
|
|
485
486
|
constraints: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -490,23 +491,23 @@ e.object({
|
|
|
490
491
|
created_at: e.string(),
|
|
491
492
|
used_at: e.string().optional(),
|
|
492
493
|
revoked_at: e.string().optional()
|
|
493
|
-
}).extend(
|
|
494
|
-
var
|
|
494
|
+
}).extend(ye.shape);
|
|
495
|
+
var y = e.object({
|
|
495
496
|
x: e.number(),
|
|
496
497
|
y: e.number()
|
|
497
|
-
}),
|
|
498
|
+
}), be = /* @__PURE__ */ function(e) {
|
|
498
499
|
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;
|
|
499
|
-
}({}),
|
|
500
|
+
}({}), xe = /* @__PURE__ */ function(e) {
|
|
500
501
|
return e.BLOCK = "BLOCK", e.FIELD = "FIELD", e;
|
|
501
|
-
}({}),
|
|
502
|
+
}({}), b = e.object({
|
|
502
503
|
id: e.string(),
|
|
503
|
-
category: e.nativeEnum(
|
|
504
|
-
type: e.nativeEnum(
|
|
505
|
-
}),
|
|
504
|
+
category: e.nativeEnum(xe),
|
|
505
|
+
type: e.nativeEnum(be)
|
|
506
|
+
}), Se = b.extend({
|
|
506
507
|
category: e.literal("BLOCK"),
|
|
507
508
|
type: e.literal("RICH_TEXT"),
|
|
508
509
|
config: e.object({ content: e.string() }).passthrough()
|
|
509
|
-
}),
|
|
510
|
+
}), Ce = b.extend({
|
|
510
511
|
category: e.literal("BLOCK"),
|
|
511
512
|
type: e.union([
|
|
512
513
|
e.literal("NEXT_BUTTON"),
|
|
@@ -514,13 +515,13 @@ var b = e.object({
|
|
|
514
515
|
e.literal("SUBMIT_BUTTON")
|
|
515
516
|
]),
|
|
516
517
|
config: e.object({ text: e.string() }).passthrough()
|
|
517
|
-
}),
|
|
518
|
+
}), we = b.extend({
|
|
518
519
|
category: e.literal("FIELD"),
|
|
519
520
|
type: e.literal("LEGAL"),
|
|
520
521
|
required: e.boolean().optional(),
|
|
521
522
|
sensitive: e.boolean().optional(),
|
|
522
523
|
config: e.object({ text: e.string() }).passthrough()
|
|
523
|
-
}),
|
|
524
|
+
}), Te = b.extend({
|
|
524
525
|
category: e.literal("FIELD"),
|
|
525
526
|
type: e.union([
|
|
526
527
|
e.literal("TEXT"),
|
|
@@ -540,38 +541,38 @@ var b = e.object({
|
|
|
540
541
|
label: e.string().optional(),
|
|
541
542
|
placeholder: e.string().optional()
|
|
542
543
|
}).passthrough()
|
|
543
|
-
}),
|
|
544
|
+
}), Ee = e.object({
|
|
544
545
|
id: e.string(),
|
|
545
546
|
category: e.string(),
|
|
546
547
|
type: e.string()
|
|
547
|
-
}).passthrough(),
|
|
548
|
-
xe,
|
|
548
|
+
}).passthrough(), De = e.union([
|
|
549
549
|
Se,
|
|
550
550
|
Ce,
|
|
551
551
|
we,
|
|
552
|
-
Te
|
|
553
|
-
|
|
552
|
+
Te,
|
|
553
|
+
Ee
|
|
554
|
+
]), Oe = e.object({
|
|
554
555
|
id: e.string(),
|
|
555
556
|
type: e.literal("STEP"),
|
|
556
|
-
coordinates:
|
|
557
|
+
coordinates: y,
|
|
557
558
|
alias: e.string().optional(),
|
|
558
559
|
config: e.object({
|
|
559
|
-
components: e.array(
|
|
560
|
+
components: e.array(De),
|
|
560
561
|
next_node: e.string()
|
|
561
562
|
}).passthrough()
|
|
562
|
-
}),
|
|
563
|
+
}), ke = e.object({
|
|
563
564
|
id: e.string(),
|
|
564
565
|
type: e.literal("FLOW"),
|
|
565
|
-
coordinates:
|
|
566
|
+
coordinates: y,
|
|
566
567
|
alias: e.string().optional(),
|
|
567
568
|
config: e.object({
|
|
568
569
|
flow_id: e.string(),
|
|
569
570
|
next_node: e.string()
|
|
570
571
|
})
|
|
571
|
-
}),
|
|
572
|
+
}), Ae = e.object({
|
|
572
573
|
id: e.string(),
|
|
573
574
|
type: e.literal("ACTION"),
|
|
574
|
-
coordinates:
|
|
575
|
+
coordinates: y,
|
|
575
576
|
alias: e.string().optional(),
|
|
576
577
|
config: e.object({
|
|
577
578
|
action_type: e.enum(["REDIRECT"]).openapi({ description: "The type of action to perform" }),
|
|
@@ -583,29 +584,29 @@ var b = e.object({
|
|
|
583
584
|
custom_url: e.string().optional().openapi({ description: "Custom URL when target is 'custom'" }),
|
|
584
585
|
next_node: e.string().openapi({ description: "The next node to navigate to after action (for non-redirect actions)" })
|
|
585
586
|
}).passthrough()
|
|
586
|
-
}),
|
|
587
|
+
}), je = e.object({
|
|
587
588
|
id: e.string(),
|
|
588
589
|
type: e.string(),
|
|
589
|
-
coordinates:
|
|
590
|
-
}).passthrough(),
|
|
591
|
-
De,
|
|
590
|
+
coordinates: y
|
|
591
|
+
}).passthrough(), Me = e.union([
|
|
592
592
|
Oe,
|
|
593
593
|
ke,
|
|
594
|
-
Ae
|
|
595
|
-
|
|
594
|
+
Ae,
|
|
595
|
+
je
|
|
596
|
+
]), Ne = e.object({
|
|
596
597
|
next_node: e.string(),
|
|
597
|
-
coordinates:
|
|
598
|
-
}).passthrough(),
|
|
598
|
+
coordinates: y
|
|
599
|
+
}).passthrough(), Pe = e.object({
|
|
599
600
|
resume_flow: e.boolean().optional(),
|
|
600
|
-
coordinates:
|
|
601
|
+
coordinates: y
|
|
601
602
|
}).passthrough();
|
|
602
603
|
e.object({
|
|
603
604
|
id: e.string(),
|
|
604
605
|
name: e.string(),
|
|
605
606
|
languages: e.object({ primary: e.string() }).passthrough(),
|
|
606
|
-
nodes: e.array(
|
|
607
|
-
start:
|
|
608
|
-
ending:
|
|
607
|
+
nodes: e.array(Me),
|
|
608
|
+
start: Ne,
|
|
609
|
+
ending: Pe,
|
|
609
610
|
created_at: e.string(),
|
|
610
611
|
updated_at: e.string(),
|
|
611
612
|
links: e.object({
|
|
@@ -617,24 +618,24 @@ e.object({
|
|
|
617
618
|
created_at: !0,
|
|
618
619
|
updated_at: !0
|
|
619
620
|
});
|
|
620
|
-
var
|
|
621
|
+
var Fe = /* @__PURE__ */ function(e) {
|
|
621
622
|
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;
|
|
622
|
-
}({}),
|
|
623
|
+
}({}), Ie = /* @__PURE__ */ function(e) {
|
|
623
624
|
return e.QUERY = "query", e.FRAGMENT = "fragment", e.FORM_POST = "form_post", e.WEB_MESSAGE = "web_message", e.SAML_POST = "saml_post", e;
|
|
624
|
-
}({}),
|
|
625
|
+
}({}), Le = /* @__PURE__ */ function(e) {
|
|
625
626
|
return e.S256 = "S256", e.Plain = "plain", e;
|
|
626
|
-
}({}),
|
|
627
|
+
}({}), x = e.union([e.null(), e.object({
|
|
627
628
|
essential: e.boolean().optional(),
|
|
628
629
|
value: e.unknown().optional(),
|
|
629
630
|
values: e.array(e.unknown()).optional()
|
|
630
|
-
})]).nullable(),
|
|
631
|
-
userinfo: e.record(e.string(),
|
|
632
|
-
id_token: e.record(e.string(),
|
|
633
|
-
}),
|
|
631
|
+
})]).nullable(), Re = e.object({
|
|
632
|
+
userinfo: e.record(e.string(), x).optional(),
|
|
633
|
+
id_token: e.record(e.string(), x).optional()
|
|
634
|
+
}), ze = e.object({
|
|
634
635
|
client_id: e.string(),
|
|
635
636
|
act_as: e.string().optional(),
|
|
636
|
-
response_type: e.nativeEnum(
|
|
637
|
-
response_mode: e.nativeEnum(
|
|
637
|
+
response_type: e.nativeEnum(Fe).optional(),
|
|
638
|
+
response_mode: e.nativeEnum(Ie).optional(),
|
|
638
639
|
redirect_uri: e.string().optional(),
|
|
639
640
|
audience: e.string().optional(),
|
|
640
641
|
organization: e.string().optional(),
|
|
@@ -642,13 +643,13 @@ var S = /* @__PURE__ */ function(e) {
|
|
|
642
643
|
nonce: e.string().optional(),
|
|
643
644
|
scope: e.string().optional(),
|
|
644
645
|
prompt: e.string().optional(),
|
|
645
|
-
code_challenge_method: e.nativeEnum(
|
|
646
|
+
code_challenge_method: e.nativeEnum(Le).optional(),
|
|
646
647
|
code_challenge: e.string().optional(),
|
|
647
648
|
username: e.string().optional(),
|
|
648
649
|
ui_locales: e.string().optional(),
|
|
649
650
|
max_age: e.number().optional(),
|
|
650
651
|
acr_values: e.string().optional(),
|
|
651
|
-
claims:
|
|
652
|
+
claims: Re.optional(),
|
|
652
653
|
vendor_id: e.string().optional()
|
|
653
654
|
});
|
|
654
655
|
e.object({
|
|
@@ -671,7 +672,7 @@ e.object({
|
|
|
671
672
|
"auto"
|
|
672
673
|
]).optional()
|
|
673
674
|
});
|
|
674
|
-
var
|
|
675
|
+
var Be = e.enum([
|
|
675
676
|
"password_reset",
|
|
676
677
|
"email_verification",
|
|
677
678
|
"otp",
|
|
@@ -679,13 +680,14 @@ var ze = e.enum([
|
|
|
679
680
|
"authorization_code",
|
|
680
681
|
"oauth2_state",
|
|
681
682
|
"ticket",
|
|
682
|
-
"client_assertion_jti"
|
|
683
|
+
"client_assertion_jti",
|
|
684
|
+
"subject_token_jti"
|
|
683
685
|
]);
|
|
684
686
|
e.object({
|
|
685
687
|
code_id: e.string().openapi({ description: "The code that will be used in for instance an email verification flow" }),
|
|
686
688
|
login_id: e.string().optional().openapi({ description: "The id of the login session that the code is connected to" }),
|
|
687
689
|
connection_id: e.string().optional().openapi({ description: "The connection that the code is connected to" }),
|
|
688
|
-
code_type:
|
|
690
|
+
code_type: Be,
|
|
689
691
|
code_verifier: e.string().optional().openapi({ description: "The code verifier used in PKCE in outbound flows" }),
|
|
690
692
|
code_challenge: e.string().optional().openapi({ description: "The code challenge used in PKCE in outbound flows" }),
|
|
691
693
|
code_challenge_method: e.enum(["plain", "S256"]).optional().openapi({ description: "The code challenge method used in PKCE in outbound flows" }),
|
|
@@ -697,7 +699,7 @@ e.object({
|
|
|
697
699
|
used_at: e.string().optional(),
|
|
698
700
|
user_id: e.string().optional()
|
|
699
701
|
}).extend({ created_at: e.string() });
|
|
700
|
-
var
|
|
702
|
+
var Ve = e.object({
|
|
701
703
|
kid: e.string().optional(),
|
|
702
704
|
team_id: e.string().optional(),
|
|
703
705
|
realms: e.string().optional(),
|
|
@@ -817,26 +819,26 @@ var Be = e.object({
|
|
|
817
819
|
"never_on_login"
|
|
818
820
|
]).optional()
|
|
819
821
|
});
|
|
820
|
-
function
|
|
822
|
+
function S(e) {
|
|
821
823
|
if (e !== null) {
|
|
822
|
-
if (Array.isArray(e)) return e.filter((e) => e !== null).map(
|
|
824
|
+
if (Array.isArray(e)) return e.filter((e) => e !== null).map(S);
|
|
823
825
|
if (e && typeof e == "object") {
|
|
824
826
|
let t = {};
|
|
825
|
-
for (let [n, r] of Object.entries(e)) r !== null && (t[n] =
|
|
827
|
+
for (let [n, r] of Object.entries(e)) r !== null && (t[n] = S(r));
|
|
826
828
|
return t;
|
|
827
829
|
}
|
|
828
830
|
return e;
|
|
829
831
|
}
|
|
830
832
|
}
|
|
831
|
-
var
|
|
833
|
+
var He = e.object({
|
|
832
834
|
id: e.string().optional(),
|
|
833
835
|
name: e.string(),
|
|
834
836
|
display_name: e.string().optional(),
|
|
835
837
|
strategy: e.string(),
|
|
836
|
-
options: e.preprocess((e) => e === null ? {} :
|
|
838
|
+
options: e.preprocess((e) => e === null ? {} : S(e), Ve).default({}),
|
|
837
839
|
enabled_clients: e.array(e.string()).default([]).optional(),
|
|
838
|
-
response_type: e.nativeEnum(
|
|
839
|
-
response_mode: e.nativeEnum(
|
|
840
|
+
response_type: e.nativeEnum(Fe).optional(),
|
|
841
|
+
response_mode: e.nativeEnum(Ie).optional(),
|
|
840
842
|
is_domain_connection: e.boolean().optional(),
|
|
841
843
|
show_as_button: e.boolean().optional(),
|
|
842
844
|
metadata: e.record(e.string(), e.any()).optional(),
|
|
@@ -846,8 +848,8 @@ e.object({
|
|
|
846
848
|
id: e.string(),
|
|
847
849
|
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
848
850
|
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
849
|
-
}).extend(
|
|
850
|
-
var
|
|
851
|
+
}).extend(He.shape);
|
|
852
|
+
var Ue = e.object({
|
|
851
853
|
domain: e.string(),
|
|
852
854
|
custom_domain_id: e.string().optional(),
|
|
853
855
|
type: e.enum(["auth0_managed_certs", "self_managed_certs"]),
|
|
@@ -861,7 +863,7 @@ var w = e.object({
|
|
|
861
863
|
"null"
|
|
862
864
|
]).optional(),
|
|
863
865
|
domain_metadata: e.record(e.string(), e.string().max(255)).optional()
|
|
864
|
-
}),
|
|
866
|
+
}), We = e.discriminatedUnion("name", [e.object({
|
|
865
867
|
name: e.literal("txt"),
|
|
866
868
|
record: e.string(),
|
|
867
869
|
domain: e.string()
|
|
@@ -869,7 +871,7 @@ var w = e.object({
|
|
|
869
871
|
name: e.literal("http"),
|
|
870
872
|
http_body: e.string(),
|
|
871
873
|
http_url: e.string()
|
|
872
|
-
})]),
|
|
874
|
+
})]), Ge = Ue.extend({
|
|
873
875
|
custom_domain_id: e.string(),
|
|
874
876
|
primary: e.boolean(),
|
|
875
877
|
status: e.enum([
|
|
@@ -879,28 +881,28 @@ var w = e.object({
|
|
|
879
881
|
"ready"
|
|
880
882
|
]),
|
|
881
883
|
origin_domain_name: e.string().optional(),
|
|
882
|
-
verification: e.object({ methods: e.array(
|
|
884
|
+
verification: e.object({ methods: e.array(We) }).optional(),
|
|
883
885
|
tls_policy: e.string().optional()
|
|
884
886
|
});
|
|
885
|
-
|
|
887
|
+
Ue.pick({
|
|
886
888
|
tls_policy: !0,
|
|
887
889
|
custom_client_ip_header: !0,
|
|
888
890
|
domain_metadata: !0
|
|
889
|
-
}).strict(),
|
|
891
|
+
}).strict(), Ge.extend({ tenant_id: e.string() }), e.object({
|
|
890
892
|
certificate: e.string().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/, "must be PEM-encoded; include the full certificate chain in leaf-first order"),
|
|
891
893
|
private_key: e.string().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/, "must be a PEM-encoded private key")
|
|
892
894
|
});
|
|
893
|
-
var
|
|
895
|
+
var C = e.object({
|
|
894
896
|
id: e.string(),
|
|
895
897
|
order: e.number().optional(),
|
|
896
898
|
visible: e.boolean().optional().default(!0)
|
|
897
|
-
}),
|
|
899
|
+
}), w = C.extend({ category: e.literal("BLOCK").optional() }), Ke = w.extend({
|
|
898
900
|
type: e.literal("DIVIDER"),
|
|
899
901
|
config: e.object({ text: e.string().optional() }).optional()
|
|
900
|
-
}),
|
|
902
|
+
}), qe = w.extend({
|
|
901
903
|
type: e.literal("HTML"),
|
|
902
904
|
config: e.object({ content: e.string().optional() }).optional()
|
|
903
|
-
}),
|
|
905
|
+
}), Je = w.extend({
|
|
904
906
|
type: e.literal("IMAGE"),
|
|
905
907
|
config: e.object({
|
|
906
908
|
src: e.string().optional(),
|
|
@@ -908,43 +910,47 @@ var T = e.object({
|
|
|
908
910
|
width: e.number().optional(),
|
|
909
911
|
height: e.number().optional()
|
|
910
912
|
}).optional()
|
|
911
|
-
}),
|
|
913
|
+
}), Ye = w.extend({
|
|
912
914
|
type: e.literal("JUMP_BUTTON"),
|
|
913
915
|
config: e.object({
|
|
914
916
|
text: e.string().optional(),
|
|
915
917
|
target_step: e.string().optional()
|
|
916
918
|
})
|
|
917
|
-
}),
|
|
919
|
+
}), Xe = w.extend({
|
|
918
920
|
type: e.literal("RESEND_BUTTON"),
|
|
919
921
|
config: e.object({
|
|
920
922
|
text: e.string().optional(),
|
|
921
923
|
resend_action: e.string().optional()
|
|
922
924
|
})
|
|
923
|
-
}),
|
|
925
|
+
}), Ze = w.extend({
|
|
924
926
|
type: e.literal("NEXT_BUTTON"),
|
|
925
|
-
config: e.object({
|
|
926
|
-
|
|
927
|
+
config: e.object({
|
|
928
|
+
text: e.string().optional(),
|
|
929
|
+
variant: e.enum(["primary", "secondary"]).optional(),
|
|
930
|
+
skip_validation: e.boolean().optional()
|
|
931
|
+
})
|
|
932
|
+
}), Qe = w.extend({
|
|
927
933
|
type: e.literal("PREVIOUS_BUTTON"),
|
|
928
934
|
config: e.object({ text: e.string().optional() })
|
|
929
|
-
}),
|
|
935
|
+
}), $e = w.extend({
|
|
930
936
|
type: e.literal("RICH_TEXT"),
|
|
931
937
|
config: e.object({ content: e.string().optional() }).optional()
|
|
932
|
-
}),
|
|
938
|
+
}), T = C.extend({
|
|
933
939
|
category: e.literal("WIDGET").optional(),
|
|
934
940
|
label: e.string().min(1).optional(),
|
|
935
941
|
hint: e.string().min(1).max(500).optional(),
|
|
936
942
|
required: e.boolean().optional(),
|
|
937
943
|
sensitive: e.boolean().optional()
|
|
938
|
-
}),
|
|
944
|
+
}), et = T.extend({
|
|
939
945
|
type: e.literal("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
940
946
|
config: e.object({ credential_type: e.string().optional() })
|
|
941
|
-
}),
|
|
947
|
+
}), tt = T.extend({
|
|
942
948
|
type: e.literal("GMAPS_ADDRESS"),
|
|
943
949
|
config: e.object({ api_key: e.string().optional() })
|
|
944
|
-
}),
|
|
950
|
+
}), nt = T.extend({
|
|
945
951
|
type: e.literal("RECAPTCHA"),
|
|
946
952
|
config: e.object({ site_key: e.string().optional() })
|
|
947
|
-
}),
|
|
953
|
+
}), E = C.extend({
|
|
948
954
|
category: e.literal("FIELD").optional(),
|
|
949
955
|
label: e.string().min(1).optional(),
|
|
950
956
|
hint: e.string().min(1).max(500).optional(),
|
|
@@ -960,10 +966,10 @@ var T = e.object({
|
|
|
960
966
|
})).optional(),
|
|
961
967
|
required: e.boolean().optional(),
|
|
962
968
|
sensitive: e.boolean().optional()
|
|
963
|
-
}),
|
|
969
|
+
}), rt = E.extend({
|
|
964
970
|
type: e.literal("BOOLEAN"),
|
|
965
971
|
config: e.object({ default_value: e.boolean().optional() }).optional()
|
|
966
|
-
}),
|
|
972
|
+
}), it = E.extend({
|
|
967
973
|
type: e.literal("CARDS"),
|
|
968
974
|
config: e.object({
|
|
969
975
|
options: e.array(e.object({
|
|
@@ -974,7 +980,7 @@ var T = e.object({
|
|
|
974
980
|
})).optional(),
|
|
975
981
|
multi_select: e.boolean().optional()
|
|
976
982
|
}).optional()
|
|
977
|
-
}),
|
|
983
|
+
}), at = E.extend({
|
|
978
984
|
type: e.literal("CHOICE"),
|
|
979
985
|
config: e.object({
|
|
980
986
|
options: e.array(e.object({
|
|
@@ -985,7 +991,7 @@ var T = e.object({
|
|
|
985
991
|
multiple: e.boolean().optional(),
|
|
986
992
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
987
993
|
}).optional()
|
|
988
|
-
}),
|
|
994
|
+
}), ot = E.extend({
|
|
989
995
|
type: e.literal("CODE"),
|
|
990
996
|
config: e.object({
|
|
991
997
|
length: e.number().int().positive().max(100).optional(),
|
|
@@ -1002,7 +1008,7 @@ var T = e.object({
|
|
|
1002
1008
|
message: "default_value is longer than the configured length",
|
|
1003
1009
|
path: ["default_value"]
|
|
1004
1010
|
}).optional()
|
|
1005
|
-
}),
|
|
1011
|
+
}), st = E.extend({
|
|
1006
1012
|
type: e.literal("CUSTOM"),
|
|
1007
1013
|
config: e.object({
|
|
1008
1014
|
component: e.string().optional(),
|
|
@@ -1010,7 +1016,7 @@ var T = e.object({
|
|
|
1010
1016
|
schema: e.record(e.string(), e.any()).optional(),
|
|
1011
1017
|
code: e.string().optional()
|
|
1012
1018
|
})
|
|
1013
|
-
}),
|
|
1019
|
+
}), ct = E.extend({
|
|
1014
1020
|
type: e.literal("DATE"),
|
|
1015
1021
|
config: e.object({
|
|
1016
1022
|
format: e.string().optional(),
|
|
@@ -1018,7 +1024,7 @@ var T = e.object({
|
|
|
1018
1024
|
max: e.string().optional(),
|
|
1019
1025
|
default_value: e.string().optional()
|
|
1020
1026
|
}).optional()
|
|
1021
|
-
}),
|
|
1027
|
+
}), lt = E.extend({
|
|
1022
1028
|
type: e.literal("DROPDOWN"),
|
|
1023
1029
|
config: e.object({
|
|
1024
1030
|
options: e.array(e.object({
|
|
@@ -1030,7 +1036,7 @@ var T = e.object({
|
|
|
1030
1036
|
multiple: e.boolean().optional(),
|
|
1031
1037
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
1032
1038
|
}).optional()
|
|
1033
|
-
}),
|
|
1039
|
+
}), ut = E.extend({
|
|
1034
1040
|
type: e.literal("EMAIL"),
|
|
1035
1041
|
config: e.object({
|
|
1036
1042
|
placeholder: e.string().optional(),
|
|
@@ -1038,20 +1044,20 @@ var T = e.object({
|
|
|
1038
1044
|
last_used: e.boolean().optional(),
|
|
1039
1045
|
last_used_label: e.string().optional()
|
|
1040
1046
|
}).optional()
|
|
1041
|
-
}),
|
|
1047
|
+
}), dt = E.extend({
|
|
1042
1048
|
type: e.literal("FILE"),
|
|
1043
1049
|
config: e.object({
|
|
1044
1050
|
accept: e.string().optional(),
|
|
1045
1051
|
max_size: e.number().optional(),
|
|
1046
1052
|
multiple: e.boolean().optional()
|
|
1047
1053
|
}).optional()
|
|
1048
|
-
}),
|
|
1054
|
+
}), ft = E.extend({
|
|
1049
1055
|
type: e.literal("LEGAL"),
|
|
1050
1056
|
config: e.object({
|
|
1051
1057
|
text: e.string(),
|
|
1052
1058
|
html: e.boolean().optional()
|
|
1053
1059
|
}).optional()
|
|
1054
|
-
}),
|
|
1060
|
+
}), pt = E.extend({
|
|
1055
1061
|
type: e.literal("NUMBER"),
|
|
1056
1062
|
config: e.object({
|
|
1057
1063
|
placeholder: e.string().optional(),
|
|
@@ -1060,7 +1066,7 @@ var T = e.object({
|
|
|
1060
1066
|
step: e.number().optional(),
|
|
1061
1067
|
default_value: e.string().optional()
|
|
1062
1068
|
}).optional()
|
|
1063
|
-
}),
|
|
1069
|
+
}), mt = E.extend({
|
|
1064
1070
|
type: e.literal("PASSWORD"),
|
|
1065
1071
|
config: e.object({
|
|
1066
1072
|
placeholder: e.string().optional(),
|
|
@@ -1069,13 +1075,13 @@ var T = e.object({
|
|
|
1069
1075
|
forgot_password_link: e.string().optional(),
|
|
1070
1076
|
default_value: e.string().optional()
|
|
1071
1077
|
}).optional()
|
|
1072
|
-
}),
|
|
1078
|
+
}), ht = E.extend({
|
|
1073
1079
|
type: e.literal("PAYMENT"),
|
|
1074
1080
|
config: e.object({
|
|
1075
1081
|
provider: e.string().optional(),
|
|
1076
1082
|
currency: e.string().optional()
|
|
1077
1083
|
}).optional()
|
|
1078
|
-
}),
|
|
1084
|
+
}), gt = E.extend({
|
|
1079
1085
|
type: e.literal("SOCIAL"),
|
|
1080
1086
|
config: e.object({
|
|
1081
1087
|
providers: e.array(e.string()).optional(),
|
|
@@ -1089,7 +1095,7 @@ var T = e.object({
|
|
|
1089
1095
|
last_used_label: e.string().optional()
|
|
1090
1096
|
})).optional()
|
|
1091
1097
|
}).optional()
|
|
1092
|
-
}),
|
|
1098
|
+
}), _t = E.extend({
|
|
1093
1099
|
type: e.literal("TEL"),
|
|
1094
1100
|
config: e.object({
|
|
1095
1101
|
placeholder: e.string().optional(),
|
|
@@ -1097,7 +1103,7 @@ var T = e.object({
|
|
|
1097
1103
|
default_value: e.string().optional(),
|
|
1098
1104
|
allow_email: e.boolean().optional()
|
|
1099
1105
|
}).optional()
|
|
1100
|
-
}),
|
|
1106
|
+
}), vt = E.extend({
|
|
1101
1107
|
type: e.literal("TEXT"),
|
|
1102
1108
|
config: e.object({
|
|
1103
1109
|
placeholder: e.string().optional(),
|
|
@@ -1107,39 +1113,37 @@ var T = e.object({
|
|
|
1107
1113
|
last_used: e.boolean().optional(),
|
|
1108
1114
|
last_used_label: e.string().optional()
|
|
1109
1115
|
}).optional()
|
|
1110
|
-
}),
|
|
1116
|
+
}), yt = E.extend({
|
|
1111
1117
|
type: e.literal("COUNTRY"),
|
|
1112
1118
|
config: e.object({
|
|
1113
1119
|
placeholder: e.string().optional(),
|
|
1114
1120
|
default_value: e.string().optional()
|
|
1115
1121
|
}).optional()
|
|
1116
|
-
}),
|
|
1122
|
+
}), bt = E.extend({
|
|
1117
1123
|
type: e.literal("URL"),
|
|
1118
1124
|
config: e.object({
|
|
1119
1125
|
placeholder: e.string().optional(),
|
|
1120
1126
|
default_value: e.string().optional()
|
|
1121
1127
|
}).optional()
|
|
1122
|
-
}),
|
|
1123
|
-
We,
|
|
1124
|
-
Ge,
|
|
1128
|
+
}), xt = e.discriminatedUnion("type", [
|
|
1125
1129
|
Ke,
|
|
1126
1130
|
qe,
|
|
1127
1131
|
Je,
|
|
1128
1132
|
Ye,
|
|
1129
1133
|
Xe,
|
|
1130
|
-
Ze
|
|
1131
|
-
]), bt = e.discriminatedUnion("type", [
|
|
1134
|
+
Ze,
|
|
1132
1135
|
Qe,
|
|
1133
|
-
$e
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
+
$e
|
|
1137
|
+
]), St = e.discriminatedUnion("type", [
|
|
1138
|
+
et,
|
|
1136
1139
|
tt,
|
|
1137
|
-
nt
|
|
1140
|
+
nt
|
|
1141
|
+
]), Ct = e.discriminatedUnion("type", [
|
|
1138
1142
|
rt,
|
|
1139
1143
|
it,
|
|
1140
|
-
_t,
|
|
1141
1144
|
at,
|
|
1142
1145
|
ot,
|
|
1146
|
+
yt,
|
|
1143
1147
|
st,
|
|
1144
1148
|
ct,
|
|
1145
1149
|
lt,
|
|
@@ -1150,11 +1154,13 @@ var T = e.object({
|
|
|
1150
1154
|
mt,
|
|
1151
1155
|
ht,
|
|
1152
1156
|
gt,
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
xt
|
|
1157
|
+
_t,
|
|
1158
|
+
vt,
|
|
1159
|
+
bt
|
|
1160
|
+
]), wt = e.union([
|
|
1161
|
+
xt,
|
|
1162
|
+
St,
|
|
1163
|
+
Ct
|
|
1158
1164
|
]);
|
|
1159
1165
|
new Set([
|
|
1160
1166
|
"BOOLEAN",
|
|
@@ -1181,22 +1187,22 @@ new Set([
|
|
|
1181
1187
|
visible: e.boolean().optional().default(!0),
|
|
1182
1188
|
customizations: e.record(e.string(), e.any()).optional()
|
|
1183
1189
|
});
|
|
1184
|
-
var
|
|
1190
|
+
var D = e.object({
|
|
1185
1191
|
x: e.number(),
|
|
1186
1192
|
y: e.number()
|
|
1187
|
-
}),
|
|
1193
|
+
}), Tt = e.object({
|
|
1188
1194
|
id: e.string(),
|
|
1189
1195
|
type: e.literal("FLOW"),
|
|
1190
|
-
coordinates:
|
|
1196
|
+
coordinates: D,
|
|
1191
1197
|
alias: e.string().min(1).max(150).optional(),
|
|
1192
1198
|
config: e.object({
|
|
1193
1199
|
flow_id: e.string().max(30),
|
|
1194
1200
|
next_node: e.string().optional()
|
|
1195
1201
|
})
|
|
1196
|
-
}),
|
|
1202
|
+
}), Et = e.object({
|
|
1197
1203
|
id: e.string(),
|
|
1198
1204
|
type: e.literal("ROUTER"),
|
|
1199
|
-
coordinates:
|
|
1205
|
+
coordinates: D,
|
|
1200
1206
|
alias: e.string().min(1).max(150),
|
|
1201
1207
|
config: e.object({
|
|
1202
1208
|
rules: e.array(e.object({
|
|
@@ -1207,20 +1213,20 @@ var k = e.object({
|
|
|
1207
1213
|
})),
|
|
1208
1214
|
fallback: e.string()
|
|
1209
1215
|
})
|
|
1210
|
-
}),
|
|
1216
|
+
}), Dt = e.object({
|
|
1211
1217
|
id: e.string(),
|
|
1212
1218
|
type: e.literal("STEP"),
|
|
1213
|
-
coordinates:
|
|
1219
|
+
coordinates: D,
|
|
1214
1220
|
alias: e.string().min(1).max(150).optional(),
|
|
1215
1221
|
config: e.object({
|
|
1216
|
-
components: e.array(
|
|
1222
|
+
components: e.array(wt),
|
|
1217
1223
|
next_node: e.string().optional()
|
|
1218
1224
|
})
|
|
1219
|
-
}),
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
]),
|
|
1225
|
+
}), Ot = e.discriminatedUnion("type", [
|
|
1226
|
+
Tt,
|
|
1227
|
+
Et,
|
|
1228
|
+
Dt
|
|
1229
|
+
]), kt = e.object({
|
|
1224
1230
|
name: e.string().openapi({ description: "The name of the form" }),
|
|
1225
1231
|
messages: e.object({
|
|
1226
1232
|
errors: e.record(e.string(), e.any()).optional(),
|
|
@@ -1231,14 +1237,14 @@ var k = e.object({
|
|
|
1231
1237
|
default: e.string().optional()
|
|
1232
1238
|
}).optional(),
|
|
1233
1239
|
translations: e.record(e.string(), e.any()).optional(),
|
|
1234
|
-
nodes: e.array(
|
|
1240
|
+
nodes: e.array(Ot).optional(),
|
|
1235
1241
|
start: e.object({
|
|
1236
1242
|
hidden_fields: e.array(e.object({
|
|
1237
1243
|
key: e.string(),
|
|
1238
1244
|
value: e.string()
|
|
1239
1245
|
})).optional(),
|
|
1240
1246
|
next_node: e.string().optional(),
|
|
1241
|
-
coordinates:
|
|
1247
|
+
coordinates: D.optional()
|
|
1242
1248
|
}).optional(),
|
|
1243
1249
|
ending: e.object({
|
|
1244
1250
|
redirection: e.object({
|
|
@@ -1246,7 +1252,7 @@ var k = e.object({
|
|
|
1246
1252
|
target: e.string().optional()
|
|
1247
1253
|
}).optional(),
|
|
1248
1254
|
after_submit: e.object({ flow_id: e.string().optional() }).optional(),
|
|
1249
|
-
coordinates:
|
|
1255
|
+
coordinates: D.optional(),
|
|
1250
1256
|
resume_flow: e.boolean().optional()
|
|
1251
1257
|
}).optional(),
|
|
1252
1258
|
style: e.object({ css: e.string().optional() }).optional(),
|
|
@@ -1255,8 +1261,8 @@ var k = e.object({
|
|
|
1255
1261
|
sdk_src: e.string().optional()
|
|
1256
1262
|
}).optional()
|
|
1257
1263
|
}).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
|
|
1258
|
-
n.extend(
|
|
1259
|
-
var
|
|
1264
|
+
n.extend(kt.shape).extend({ id: e.string() });
|
|
1265
|
+
var At = e.object({
|
|
1260
1266
|
id: e.number().optional(),
|
|
1261
1267
|
text: e.string(),
|
|
1262
1268
|
type: e.enum([
|
|
@@ -1265,7 +1271,7 @@ var Ot = e.object({
|
|
|
1265
1271
|
"success",
|
|
1266
1272
|
"warning"
|
|
1267
1273
|
])
|
|
1268
|
-
}),
|
|
1274
|
+
}), jt = e.object({
|
|
1269
1275
|
id: e.string().optional(),
|
|
1270
1276
|
text: e.string(),
|
|
1271
1277
|
href: e.string(),
|
|
@@ -1277,12 +1283,12 @@ e.object({
|
|
|
1277
1283
|
method: e.enum(["POST", "GET"]),
|
|
1278
1284
|
title: e.string().optional(),
|
|
1279
1285
|
description: e.string().optional(),
|
|
1280
|
-
components: e.array(
|
|
1281
|
-
messages: e.array(
|
|
1282
|
-
links: e.array(
|
|
1286
|
+
components: e.array(wt),
|
|
1287
|
+
messages: e.array(At).optional(),
|
|
1288
|
+
links: e.array(jt).optional(),
|
|
1283
1289
|
footer: e.string().optional()
|
|
1284
1290
|
});
|
|
1285
|
-
var
|
|
1291
|
+
var O = e.enum([
|
|
1286
1292
|
"pre-user-registration",
|
|
1287
1293
|
"post-user-registration",
|
|
1288
1294
|
"post-user-login",
|
|
@@ -1290,95 +1296,95 @@ var A = e.enum([
|
|
|
1290
1296
|
"validate-registration-username",
|
|
1291
1297
|
"pre-user-deletion",
|
|
1292
1298
|
"post-user-deletion"
|
|
1293
|
-
]),
|
|
1299
|
+
]), k = e.enum(["post-user-login"]), A = e.enum([
|
|
1294
1300
|
"post-user-login",
|
|
1295
1301
|
"post-user-registration",
|
|
1296
1302
|
"post-user-update",
|
|
1297
1303
|
"credentials-exchange"
|
|
1298
|
-
]),
|
|
1304
|
+
]), j = e.enum([
|
|
1299
1305
|
"post-user-login",
|
|
1300
1306
|
"credentials-exchange",
|
|
1301
1307
|
"pre-user-registration",
|
|
1302
1308
|
"post-user-registration"
|
|
1303
|
-
]),
|
|
1304
|
-
|
|
1305
|
-
var
|
|
1309
|
+
]), M = e.enum(["post-user-login"]);
|
|
1310
|
+
O.options, k.options, A.options, j.options, M.options;
|
|
1311
|
+
var Mt = e.enum(["impersonate"]), Nt = e.enum([
|
|
1306
1312
|
"ensure-username",
|
|
1307
1313
|
"set-preferred-username",
|
|
1308
1314
|
"account-linking"
|
|
1309
|
-
]),
|
|
1315
|
+
]), N = {
|
|
1310
1316
|
enabled: e.boolean().default(!1),
|
|
1311
1317
|
synchronous: e.boolean().default(!1),
|
|
1312
1318
|
priority: e.number().optional(),
|
|
1313
1319
|
hook_id: e.string().optional(),
|
|
1314
1320
|
metadata: e.record(e.string(), e.unknown()).optional()
|
|
1315
|
-
},
|
|
1316
|
-
...
|
|
1317
|
-
trigger_id:
|
|
1321
|
+
}, Pt = e.object({
|
|
1322
|
+
...N,
|
|
1323
|
+
trigger_id: O,
|
|
1318
1324
|
url: e.string()
|
|
1319
|
-
}), Nt = e.object({
|
|
1320
|
-
...F,
|
|
1321
|
-
trigger_id: j,
|
|
1322
|
-
form_id: e.string()
|
|
1323
|
-
}), Pt = e.object({
|
|
1324
|
-
...F,
|
|
1325
|
-
trigger_id: M,
|
|
1326
|
-
template_id: jt
|
|
1327
1325
|
}), Ft = e.object({
|
|
1328
|
-
...
|
|
1329
|
-
trigger_id:
|
|
1330
|
-
|
|
1326
|
+
...N,
|
|
1327
|
+
trigger_id: k,
|
|
1328
|
+
form_id: e.string()
|
|
1331
1329
|
}), It = e.object({
|
|
1332
|
-
...
|
|
1333
|
-
trigger_id:
|
|
1334
|
-
|
|
1330
|
+
...N,
|
|
1331
|
+
trigger_id: A,
|
|
1332
|
+
template_id: Nt
|
|
1333
|
+
}), Lt = e.object({
|
|
1334
|
+
...N,
|
|
1335
|
+
trigger_id: j,
|
|
1336
|
+
code_id: e.string()
|
|
1337
|
+
}), Rt = e.object({
|
|
1338
|
+
...N,
|
|
1339
|
+
trigger_id: M,
|
|
1340
|
+
page_id: Mt,
|
|
1335
1341
|
permission_required: e.string().optional()
|
|
1336
1342
|
});
|
|
1337
1343
|
e.union([
|
|
1338
|
-
Mt,
|
|
1339
|
-
Nt,
|
|
1340
1344
|
Pt,
|
|
1341
1345
|
Ft,
|
|
1342
|
-
It
|
|
1346
|
+
It,
|
|
1347
|
+
Lt,
|
|
1348
|
+
Rt
|
|
1343
1349
|
]);
|
|
1344
|
-
var
|
|
1345
|
-
...
|
|
1346
|
-
trigger_id:
|
|
1350
|
+
var zt = e.object({
|
|
1351
|
+
...N,
|
|
1352
|
+
trigger_id: O
|
|
1347
1353
|
}).extend(n.shape).extend({
|
|
1348
1354
|
hook_id: e.string(),
|
|
1349
1355
|
url: e.string()
|
|
1350
|
-
}),
|
|
1351
|
-
...
|
|
1352
|
-
trigger_id:
|
|
1356
|
+
}), Bt = e.object({
|
|
1357
|
+
...N,
|
|
1358
|
+
trigger_id: k
|
|
1353
1359
|
}).extend(n.shape).extend({
|
|
1354
1360
|
hook_id: e.string(),
|
|
1355
1361
|
form_id: e.string()
|
|
1356
|
-
}),
|
|
1357
|
-
...
|
|
1358
|
-
trigger_id:
|
|
1362
|
+
}), Vt = e.object({
|
|
1363
|
+
...N,
|
|
1364
|
+
trigger_id: A
|
|
1359
1365
|
}).extend(n.shape).extend({
|
|
1360
1366
|
hook_id: e.string(),
|
|
1361
|
-
template_id:
|
|
1362
|
-
}),
|
|
1363
|
-
...
|
|
1364
|
-
trigger_id:
|
|
1367
|
+
template_id: Nt
|
|
1368
|
+
}), Ht = e.object({
|
|
1369
|
+
...N,
|
|
1370
|
+
trigger_id: j
|
|
1365
1371
|
}).extend(n.shape).extend({
|
|
1366
1372
|
hook_id: e.string(),
|
|
1367
1373
|
code_id: e.string()
|
|
1368
|
-
}),
|
|
1369
|
-
...
|
|
1370
|
-
trigger_id:
|
|
1374
|
+
}), Ut = e.object({
|
|
1375
|
+
...N,
|
|
1376
|
+
trigger_id: M
|
|
1371
1377
|
}).extend(n.shape).extend({
|
|
1372
1378
|
hook_id: e.string(),
|
|
1373
|
-
page_id:
|
|
1379
|
+
page_id: Mt,
|
|
1374
1380
|
permission_required: e.string().optional()
|
|
1375
1381
|
});
|
|
1376
1382
|
e.union([
|
|
1377
|
-
Lt,
|
|
1378
|
-
Rt,
|
|
1379
1383
|
zt,
|
|
1380
1384
|
Bt,
|
|
1381
|
-
Vt
|
|
1385
|
+
Vt,
|
|
1386
|
+
Ht,
|
|
1387
|
+
Ut
|
|
1382
1388
|
]), e.object({
|
|
1383
1389
|
code: e.string().max(1e5),
|
|
1384
1390
|
secrets: e.record(e.string(), e.string()).optional()
|
|
@@ -1386,11 +1392,11 @@ e.union([
|
|
|
1386
1392
|
id: e.string(),
|
|
1387
1393
|
tenant_id: e.string()
|
|
1388
1394
|
}).extend(n.shape);
|
|
1389
|
-
var
|
|
1395
|
+
var Wt = e.object({ name: e.string().optional() }), Gt = e.object({ email: e.string().optional() }), Kt = e.object({
|
|
1390
1396
|
id: e.string().optional(),
|
|
1391
1397
|
organization_id: e.string().max(50),
|
|
1392
|
-
inviter:
|
|
1393
|
-
invitee:
|
|
1398
|
+
inviter: Wt,
|
|
1399
|
+
invitee: Gt,
|
|
1394
1400
|
invitation_url: e.string().url(),
|
|
1395
1401
|
client_id: e.string(),
|
|
1396
1402
|
connection_id: e.string().optional(),
|
|
@@ -1406,8 +1412,8 @@ e.object({
|
|
|
1406
1412
|
created_at: e.string().datetime(),
|
|
1407
1413
|
expires_at: e.string().datetime(),
|
|
1408
1414
|
ticket_id: e.string().optional()
|
|
1409
|
-
}).extend(
|
|
1410
|
-
var
|
|
1415
|
+
}).extend(Kt.omit({ id: !0 }).shape);
|
|
1416
|
+
var qt = e.object({
|
|
1411
1417
|
alg: e.enum([
|
|
1412
1418
|
"RS256",
|
|
1413
1419
|
"RS384",
|
|
@@ -1418,7 +1424,7 @@ var Gt = e.object({
|
|
|
1418
1424
|
"HS256",
|
|
1419
1425
|
"HS384",
|
|
1420
1426
|
"HS512"
|
|
1421
|
-
]),
|
|
1427
|
+
]).optional(),
|
|
1422
1428
|
kid: e.string().optional(),
|
|
1423
1429
|
kty: e.enum([
|
|
1424
1430
|
"RSA",
|
|
@@ -1448,8 +1454,8 @@ var Gt = e.object({
|
|
|
1448
1454
|
path: [r],
|
|
1449
1455
|
message: `EC JWK is missing required member '${r}'`
|
|
1450
1456
|
});
|
|
1451
|
-
});
|
|
1452
|
-
e.object({
|
|
1457
|
+
}), Jt = e.object({ keys: e.array(qt) });
|
|
1458
|
+
e.object({
|
|
1453
1459
|
issuer: e.string(),
|
|
1454
1460
|
authorization_endpoint: e.string(),
|
|
1455
1461
|
token_endpoint: e.string(),
|
|
@@ -1476,35 +1482,35 @@ e.object({ keys: e.array(Gt) }), e.object({
|
|
|
1476
1482
|
backchannel_logout_supported: e.boolean().optional(),
|
|
1477
1483
|
backchannel_logout_session_supported: e.boolean().optional()
|
|
1478
1484
|
});
|
|
1479
|
-
var
|
|
1485
|
+
var Yt = /* @__PURE__ */ function(e) {
|
|
1480
1486
|
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.AWAITING_CONSENT = "awaiting_consent", e.COMPLETED = "completed", e.FAILED = "failed", e.EXPIRED = "expired", e;
|
|
1481
|
-
}({}),
|
|
1487
|
+
}({}), Xt = e.nativeEnum(Yt), Zt = e.object({
|
|
1482
1488
|
strategy: e.string(),
|
|
1483
1489
|
strategy_type: e.string()
|
|
1484
1490
|
});
|
|
1485
1491
|
e.object({
|
|
1486
1492
|
csrf_token: e.string(),
|
|
1487
1493
|
auth0Client: e.string().optional(),
|
|
1488
|
-
authParams:
|
|
1494
|
+
authParams: ze,
|
|
1489
1495
|
expires_at: e.string(),
|
|
1490
1496
|
deleted_at: e.string().optional(),
|
|
1491
1497
|
ip: e.string().optional(),
|
|
1492
1498
|
useragent: e.string().optional(),
|
|
1493
1499
|
session_id: e.string().optional(),
|
|
1494
1500
|
authorization_url: e.string().optional(),
|
|
1495
|
-
state:
|
|
1501
|
+
state: Xt.optional().default("pending"),
|
|
1496
1502
|
state_data: e.string().optional(),
|
|
1497
1503
|
failure_reason: e.string().optional(),
|
|
1498
1504
|
user_id: e.string().optional(),
|
|
1499
1505
|
auth_connection: e.string().optional(),
|
|
1500
|
-
auth_strategy:
|
|
1506
|
+
auth_strategy: Zt.optional(),
|
|
1501
1507
|
authenticated_at: e.string().optional()
|
|
1502
1508
|
}).openapi({ description: "This represents a login sesion" }).extend({
|
|
1503
1509
|
id: e.string().openapi({ description: "This is is used as the state in the universal login" }),
|
|
1504
1510
|
created_at: e.string(),
|
|
1505
1511
|
updated_at: e.string()
|
|
1506
1512
|
});
|
|
1507
|
-
var
|
|
1513
|
+
var P = {
|
|
1508
1514
|
ACLS_SUMMARY: "acls_summary",
|
|
1509
1515
|
ACTIONS_EXECUTION_FAILED: "actions_execution_failed",
|
|
1510
1516
|
API_LIMIT: "api_limit",
|
|
@@ -1664,17 +1670,17 @@ var L = {
|
|
|
1664
1670
|
WARNING_DURING_LOGIN: "w",
|
|
1665
1671
|
WARNING_SENDING_NOTIFICATION: "wn",
|
|
1666
1672
|
WARNING_USER_MANAGEMENT: "wum"
|
|
1667
|
-
},
|
|
1668
|
-
|
|
1673
|
+
}, Qt = e.string().refine((e) => Object.values(P).includes(e), { message: "Invalid log type" });
|
|
1674
|
+
P.ACLS_SUMMARY, P.ACTIONS_EXECUTION_FAILED, P.API_LIMIT, P.API_LIMIT_WARNING, P.APPI, P.CIBA_EXCHANGE_FAILED, P.CIBA_EXCHANGE_SUCCEEDED, P.CIBA_START_FAILED, P.CIBA_START_SUCCEEDED, P.CODE_LINK_SENT, P.CODE_SENT, P.DEPRECATION_NOTICE, P.FAILED_LOGIN, P.FAILED_BY_CONNECTOR, P.FAILED_CHANGE_EMAIL, P.FAILED_BY_CORS, P.FAILED_CROSS_ORIGIN_AUTHENTICATION, P.FAILED_CHANGE_PASSWORD, P.FAILED_POST_CHANGE_PASSWORD_HOOK, P.FAILED_CHANGE_PHONE_NUMBER, P.FAILED_CHANGE_PASSWORD_REQUEST, P.FAILED_CONNECTOR_PROVISIONING, P.FAILED_CHANGE_USERNAME, P.FAILED_DELEGATION, P.FAILED_DEVICE_ACTIVATION, P.FAILED_DEVICE_AUTHORIZATION_REQUEST, P.USER_CANCELED_DEVICE_CONFIRMATION, P.FAILED_USER_DELETION, P.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, P.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, P.FAILED_EXCHANGE_CUSTOM_TOKEN, P.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, P.FAILED_FEDERATED_LOGOUT, P.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN, P.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, P.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, P.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, P.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, P.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, P.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN, P.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, P.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, P.FAILED_HOOK, P.FAILED_IMPERSONATION, P.FAILED_INVITE_ACCEPT, P.FAILED_LOGOUT, P.FLOWS_EXECUTION_COMPLETED, P.FLOWS_EXECUTION_FAILED, P.FAILED_SENDING_NOTIFICATION, P.FORMS_SUBMISSION_FAILED, P.FORMS_SUBMISSION_SUCCEEDED, P.FAILED_LOGIN_INCORRECT_PASSWORD, P.FAILED_PUSHED_AUTHORIZATION_REQUEST, P.FAILED_POST_USER_REGISTRATION_HOOK, P.FAILED_SIGNUP, P.FAILED_SILENT_AUTH, P.FAILED_LOGIN_INVALID_EMAIL_USERNAME, P.FAILED_USERS_IMPORT, P.FAILED_VERIFICATION_EMAIL, P.FAILED_VERIFICATION_EMAIL_REQUEST, P.EMAIL_VERIFICATION_CONFIRMED, P.EMAIL_VERIFICATION_FAILED, P.MFA_AUTH_FAILED, P.MFA_AUTH_REJECTED, P.MFA_AUTH_SUCCESS, P.MFA_ENROLLMENT_COMPLETE, P.TOO_MANY_MFA_FAILURES, P.MFA_RECOVERY_FAILED, P.MFA_RECOVERY_RATE_LIMIT_EXCEED, P.MFA_RECOVERY_SUCCESS, P.MFA_EMAIL_SENT, P.EMAIL_VERIFICATION_SENT, P.EMAIL_VERIFICATION_SEND_FAILURE, P.PUSH_NOTIFICATION_SENT, P.ERROR_SENDING_MFA_PUSH_NOTIFICATION, P.MFA_SMS_SENT, P.ERROR_SENDING_MFA_SMS, P.MFA_VOICE_CALL_SUCCESS, P.MFA_VOICE_CALL_FAILED, P.SECOND_FACTOR_STARTED, P.MFA_ENROLL_STARTED, P.MFA_ENROLLMENT_FAILED, P.GUARDIAN_TENANT_UPDATE, P.UNENROLL_DEVICE_ACCOUNT, P.UPDATE_DEVICE_ACCOUNT, P.WEBAUTHN_CHALLENGE_FAILED, P.WEBAUTHN_ENROLLMENT_FAILED, P.FAILED_KMS_API_OPERATION, P.SUCCESS_KMS_API_OPERATION, P.KMS_KEY_STATE_CHANGED, P.TOO_MANY_CALLS_TO_DELEGATION, P.BLOCKED_IP_ADDRESS, P.BLOCKED_ACCOUNT_IP, P.BLOCKED_ACCOUNT_EMAIL, P.INFORMATION, P.MFA_REQUIRED, P.MANAGEMENT_API_READ_OPERATION, P.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, P.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, P.FAILED_OIDC_BACKCHANNEL_LOGOUT, P.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT, P.ORGANIZATION_MEMBER_ADDED, P.PASSKEY_CHALLENGE_FAILED, P.PASSKEY_CHALLENGE_STARTED, P.PRE_LOGIN_ASSESSMENT, P.BREACHED_PASSWORD, P.BREACHED_PASSWORD_ON_RESET, P.SUCCESS_RESOURCE_CLEANUP, P.RICH_CONSENTS_ACCESS_ERROR, P.SUCCESS_LOGIN, P.SUCCESS_API_OPERATION, P.FAILED_API_OPERATION, P.SUCCESS_CHANGE_EMAIL, P.SUCCESS_CROSS_ORIGIN_AUTHENTICATION, P.SUCCESS_CHANGE_PASSWORD, P.SUCCESS_CHANGE_PHONE_NUMBER, P.SUCCESS_CHANGE_PASSWORD_REQUEST, P.SUCCESS_CHANGE_USERNAME, P.SUCCESS_CREDENTIAL_VALIDATION, P.SUCCESS_DELEGATION, P.SUCCESS_USER_DELETION, P.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, P.SUCCESS_EXCHANGE_CUSTOM_TOKEN, P.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN, P.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, P.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, P.SUCCESS_IMPERSONATION, P.SUCCESSFULLY_ACCEPTED_USER_INVITE, P.BREACHED_PASSWORD_ON_SIGNUP, P.SUCCESS_LOGOUT, P.SUCCESS_HOOK, P.SUCCESS_PASSWORD_MIGRATION, P.SUCCESS_REVOCATION, P.SUCCESS_SIGNUP, P.FAILED_SS_SSO_OPERATION, P.INFORMATION_FROM_SS_SSO_OPERATION, P.SUCCESS_SS_SSO_OPERATION, P.SUCCESS_SILENT_AUTH, P.SUCCESSFUL_SCIM_OPERATION, P.SUCCESSFULLY_IMPORTED_USERS, P.SUCCESS_VERIFICATION_EMAIL, P.SUCCESS_VERIFICATION_EMAIL_REQUEST, P.MAX_AMOUNT_OF_AUTHENTICATORS, P.USER_LOGIN_BLOCK_RELEASED, P.FAILED_UNIVERSAL_LOGOUT, P.SUCCESSFUL_UNIVERSAL_LOGOUT, P.WARNING_DURING_LOGIN, P.WARNING_SENDING_NOTIFICATION, P.WARNING_USER_MANAGEMENT, (() => {
|
|
1669
1675
|
let e = {};
|
|
1670
|
-
for (let [t, n] of Object.entries(
|
|
1676
|
+
for (let [t, n] of Object.entries(P)) 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";
|
|
1671
1677
|
return e;
|
|
1672
1678
|
})();
|
|
1673
|
-
var
|
|
1679
|
+
var $t = e.object({
|
|
1674
1680
|
name: e.string(),
|
|
1675
1681
|
version: e.string(),
|
|
1676
1682
|
env: e.object({ node: e.string().optional() }).optional()
|
|
1677
|
-
}),
|
|
1683
|
+
}), en = e.object({
|
|
1678
1684
|
country_code: e.string().length(2),
|
|
1679
1685
|
city_name: e.string(),
|
|
1680
1686
|
latitude: e.string(),
|
|
@@ -1683,7 +1689,7 @@ var Yt = e.object({
|
|
|
1683
1689
|
continent_code: e.string()
|
|
1684
1690
|
});
|
|
1685
1691
|
e.object({
|
|
1686
|
-
type:
|
|
1692
|
+
type: Qt,
|
|
1687
1693
|
date: e.string(),
|
|
1688
1694
|
description: e.string().optional(),
|
|
1689
1695
|
ip: e.string().optional(),
|
|
@@ -1701,63 +1707,63 @@ e.object({
|
|
|
1701
1707
|
strategy: e.string().optional(),
|
|
1702
1708
|
strategy_type: e.string().optional(),
|
|
1703
1709
|
hostname: e.string().optional(),
|
|
1704
|
-
auth0_client:
|
|
1710
|
+
auth0_client: $t.optional(),
|
|
1705
1711
|
log_id: e.string().optional(),
|
|
1706
|
-
location_info:
|
|
1712
|
+
location_info: en.optional()
|
|
1707
1713
|
}).extend({ log_id: e.string() });
|
|
1708
|
-
var
|
|
1714
|
+
var tn = e.enum([
|
|
1709
1715
|
"http",
|
|
1710
1716
|
"eventbridge",
|
|
1711
1717
|
"eventgrid",
|
|
1712
1718
|
"splunk",
|
|
1713
1719
|
"datadog",
|
|
1714
1720
|
"sumo"
|
|
1715
|
-
]),
|
|
1721
|
+
]), nn = e.enum([
|
|
1716
1722
|
"active",
|
|
1717
1723
|
"paused",
|
|
1718
1724
|
"suspended"
|
|
1719
|
-
]),
|
|
1725
|
+
]), rn = e.object({
|
|
1720
1726
|
type: e.string(),
|
|
1721
1727
|
name: e.string()
|
|
1722
1728
|
});
|
|
1723
1729
|
e.object({
|
|
1724
1730
|
name: e.string(),
|
|
1725
|
-
type:
|
|
1726
|
-
status:
|
|
1731
|
+
type: tn,
|
|
1732
|
+
status: nn.optional(),
|
|
1727
1733
|
sink: e.record(e.string(), e.unknown()),
|
|
1728
|
-
filters: e.array(
|
|
1734
|
+
filters: e.array(rn).optional(),
|
|
1729
1735
|
isPriority: e.boolean().optional()
|
|
1730
1736
|
}).extend({
|
|
1731
1737
|
id: e.string(),
|
|
1732
|
-
status:
|
|
1738
|
+
status: nn,
|
|
1733
1739
|
created_at: e.string().optional(),
|
|
1734
1740
|
updated_at: e.string().optional()
|
|
1735
1741
|
});
|
|
1736
|
-
var
|
|
1742
|
+
var an = e.enum([
|
|
1737
1743
|
"auth0",
|
|
1738
1744
|
"cognito",
|
|
1739
1745
|
"okta",
|
|
1740
1746
|
"oidc"
|
|
1741
|
-
]),
|
|
1747
|
+
]), on = e.object({
|
|
1742
1748
|
domain: e.string(),
|
|
1743
1749
|
client_id: e.string(),
|
|
1744
1750
|
client_secret: e.string(),
|
|
1745
1751
|
audience: e.string().optional(),
|
|
1746
1752
|
scope: e.string().optional()
|
|
1747
|
-
}),
|
|
1753
|
+
}), sn = e.object({
|
|
1748
1754
|
id: e.string().optional(),
|
|
1749
1755
|
name: e.string(),
|
|
1750
|
-
provider:
|
|
1756
|
+
provider: an,
|
|
1751
1757
|
connection: e.string(),
|
|
1752
1758
|
enabled: e.boolean().default(!0),
|
|
1753
|
-
credentials:
|
|
1759
|
+
credentials: on
|
|
1754
1760
|
});
|
|
1755
1761
|
e.object({
|
|
1756
1762
|
id: e.string(),
|
|
1757
1763
|
created_at: e.string(),
|
|
1758
1764
|
updated_at: e.string()
|
|
1759
|
-
}).extend(
|
|
1760
|
-
var
|
|
1765
|
+
}).extend(sn.shape);
|
|
1766
|
+
var cn = e.object({
|
|
1761
1767
|
enabled: e.boolean().optional(),
|
|
1762
1768
|
shields: e.array(e.string()).optional(),
|
|
1763
1769
|
admin_notification_frequency: e.array(e.string()).optional(),
|
|
@@ -1766,13 +1772,13 @@ var rn = e.object({
|
|
|
1766
1772
|
"pre-user-registration": e.object({ shields: e.array(e.string()).optional() }).optional(),
|
|
1767
1773
|
"pre-change-password": e.object({ shields: e.array(e.string()).optional() }).optional()
|
|
1768
1774
|
}).optional()
|
|
1769
|
-
}),
|
|
1775
|
+
}), ln = e.object({
|
|
1770
1776
|
enabled: e.boolean().optional(),
|
|
1771
1777
|
shields: e.array(e.string()).optional(),
|
|
1772
1778
|
allowlist: e.array(e.string()).optional(),
|
|
1773
1779
|
mode: e.string().optional(),
|
|
1774
1780
|
max_attempts: e.number().optional()
|
|
1775
|
-
}),
|
|
1781
|
+
}), un = e.object({
|
|
1776
1782
|
enabled: e.boolean().optional(),
|
|
1777
1783
|
shields: e.array(e.string()).optional(),
|
|
1778
1784
|
allowlist: e.array(e.string()).optional(),
|
|
@@ -1786,10 +1792,10 @@ var rn = e.object({
|
|
|
1786
1792
|
rate: e.number().optional()
|
|
1787
1793
|
}).optional()
|
|
1788
1794
|
}).optional()
|
|
1789
|
-
}),
|
|
1790
|
-
breached_password_detection:
|
|
1791
|
-
brute_force_protection:
|
|
1792
|
-
suspicious_ip_throttling:
|
|
1795
|
+
}), dn = e.object({
|
|
1796
|
+
breached_password_detection: cn.optional(),
|
|
1797
|
+
brute_force_protection: ln.optional(),
|
|
1798
|
+
suspicious_ip_throttling: un.optional()
|
|
1793
1799
|
});
|
|
1794
1800
|
e.object({
|
|
1795
1801
|
id: e.string().optional(),
|
|
@@ -1802,14 +1808,14 @@ e.object({
|
|
|
1802
1808
|
created_at: e.string(),
|
|
1803
1809
|
updated_at: e.string()
|
|
1804
1810
|
});
|
|
1805
|
-
var
|
|
1811
|
+
var fn = e.object({
|
|
1806
1812
|
initial_user_agent: e.string().describe("First user agent of the device from which this user logged in"),
|
|
1807
1813
|
initial_ip: e.string().describe("First IP address associated with this session"),
|
|
1808
1814
|
initial_asn: e.string().describe("First autonomous system number associated with this session"),
|
|
1809
1815
|
last_user_agent: e.string().describe("Last user agent of the device from which this user logged in"),
|
|
1810
1816
|
last_ip: e.string().describe("Last IP address from which this user logged in"),
|
|
1811
1817
|
last_asn: e.string().describe("Last autonomous system number from which this user logged in")
|
|
1812
|
-
}),
|
|
1818
|
+
}), pn = e.object({
|
|
1813
1819
|
id: e.string(),
|
|
1814
1820
|
revoked_at: e.string().optional(),
|
|
1815
1821
|
used_at: e.string().optional(),
|
|
@@ -1817,7 +1823,7 @@ var cn = e.object({
|
|
|
1817
1823
|
expires_at: e.string().optional(),
|
|
1818
1824
|
login_session_id: e.string(),
|
|
1819
1825
|
idle_expires_at: e.string().optional(),
|
|
1820
|
-
device:
|
|
1826
|
+
device: fn.describe("Metadata related to the device used in the session"),
|
|
1821
1827
|
clients: e.array(e.string()).describe("List of client details for the session")
|
|
1822
1828
|
});
|
|
1823
1829
|
e.object({
|
|
@@ -1825,7 +1831,7 @@ e.object({
|
|
|
1825
1831
|
updated_at: e.string(),
|
|
1826
1832
|
authenticated_at: e.string(),
|
|
1827
1833
|
last_interaction_at: e.string()
|
|
1828
|
-
}).extend(
|
|
1834
|
+
}).extend(pn.shape), e.object({
|
|
1829
1835
|
kid: e.string().openapi({ description: "The key id of the signing key" }),
|
|
1830
1836
|
tenant_id: e.string().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
|
|
1831
1837
|
cert: e.string().openapi({ description: "The public certificate of the signing key" }),
|
|
@@ -1842,7 +1848,7 @@ e.object({
|
|
|
1842
1848
|
connection: e.string().optional().openapi({ description: "The connection identifier associated with the key" }),
|
|
1843
1849
|
type: e.enum(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
|
|
1844
1850
|
});
|
|
1845
|
-
var
|
|
1851
|
+
var mn = e.object({
|
|
1846
1852
|
id: e.string().optional(),
|
|
1847
1853
|
audience: e.string().optional(),
|
|
1848
1854
|
friendly_name: e.string(),
|
|
@@ -1960,7 +1966,7 @@ var un = e.object({
|
|
|
1960
1966
|
"shared_planetscale"
|
|
1961
1967
|
]).optional(),
|
|
1962
1968
|
d1_database_id: e.string().max(64).optional(),
|
|
1963
|
-
attack_protection:
|
|
1969
|
+
attack_protection: dn.optional(),
|
|
1964
1970
|
mfa: e.object({
|
|
1965
1971
|
policy: e.enum(["never", "always"]).default("never").optional(),
|
|
1966
1972
|
factors: e.object({
|
|
@@ -1991,29 +1997,29 @@ var un = e.object({
|
|
|
1991
1997
|
e.object({
|
|
1992
1998
|
created_at: e.string().nullable().transform((e) => e ?? ""),
|
|
1993
1999
|
updated_at: e.string().nullable().transform((e) => e ?? "")
|
|
1994
|
-
}).extend(
|
|
2000
|
+
}).extend(mn.shape).extend({
|
|
1995
2001
|
id: e.string(),
|
|
1996
2002
|
is_control_plane: e.boolean().optional()
|
|
1997
2003
|
});
|
|
1998
|
-
var
|
|
2004
|
+
var hn = e.enum([
|
|
1999
2005
|
"provision",
|
|
2000
2006
|
"seed",
|
|
2001
2007
|
"upgrade",
|
|
2002
2008
|
"backup",
|
|
2003
2009
|
"deprovision",
|
|
2004
2010
|
"users_import"
|
|
2005
|
-
]),
|
|
2011
|
+
]), gn = e.enum([
|
|
2006
2012
|
"pending",
|
|
2007
2013
|
"running",
|
|
2008
2014
|
"succeeded",
|
|
2009
2015
|
"failed",
|
|
2010
2016
|
"cancelled"
|
|
2011
|
-
]),
|
|
2017
|
+
]), _n = e.string().max(64);
|
|
2012
2018
|
e.object({
|
|
2013
2019
|
tenant_id: e.string().max(255).nullable().default(null),
|
|
2014
2020
|
rollout_id: e.string().max(255).nullable().optional(),
|
|
2015
|
-
kind:
|
|
2016
|
-
engine:
|
|
2021
|
+
kind: hn,
|
|
2022
|
+
engine: _n,
|
|
2017
2023
|
engine_instance_id: e.string().max(100).nullable().optional(),
|
|
2018
2024
|
target_worker_version: e.string().max(255).nullable().optional(),
|
|
2019
2025
|
target_database_version: e.string().max(255).nullable().optional(),
|
|
@@ -2021,7 +2027,7 @@ e.object({
|
|
|
2021
2027
|
input: e.record(e.string(), e.unknown()).nullable().optional()
|
|
2022
2028
|
}).extend({
|
|
2023
2029
|
id: e.string(),
|
|
2024
|
-
status:
|
|
2030
|
+
status: gn,
|
|
2025
2031
|
current_step: e.string().max(255).nullable().optional(),
|
|
2026
2032
|
error: e.string().nullable().optional(),
|
|
2027
2033
|
result: e.record(e.string(), e.unknown()).nullable().optional(),
|
|
@@ -2042,7 +2048,7 @@ e.object({
|
|
|
2042
2048
|
claim_expires_at: !0,
|
|
2043
2049
|
finished_at: !0
|
|
2044
2050
|
}).partial();
|
|
2045
|
-
var
|
|
2051
|
+
var vn = e.enum([
|
|
2046
2052
|
"started",
|
|
2047
2053
|
"succeeded",
|
|
2048
2054
|
"failed",
|
|
@@ -2053,14 +2059,14 @@ var mn = e.enum([
|
|
|
2053
2059
|
e.object({
|
|
2054
2060
|
operation_id: e.string().max(255),
|
|
2055
2061
|
step: e.string().max(255),
|
|
2056
|
-
outcome:
|
|
2062
|
+
outcome: vn,
|
|
2057
2063
|
detail: e.record(e.string(), e.unknown()).nullable().optional(),
|
|
2058
2064
|
attempt: e.number().int().min(1).default(1)
|
|
2059
2065
|
}).extend({
|
|
2060
2066
|
id: e.string(),
|
|
2061
2067
|
created_at: e.string()
|
|
2062
2068
|
});
|
|
2063
|
-
var
|
|
2069
|
+
var F = e.enum([
|
|
2064
2070
|
"pending",
|
|
2065
2071
|
"inserted",
|
|
2066
2072
|
"updated",
|
|
@@ -2071,28 +2077,28 @@ e.object({
|
|
|
2071
2077
|
operation_id: e.string().max(255),
|
|
2072
2078
|
seq: e.number().int().min(0),
|
|
2073
2079
|
payload: e.record(e.string(), e.unknown()),
|
|
2074
|
-
status:
|
|
2080
|
+
status: F.default("pending"),
|
|
2075
2081
|
error_code: e.string().max(64).nullable().optional(),
|
|
2076
2082
|
error_message: e.string().nullable().optional(),
|
|
2077
2083
|
error_path: e.string().max(255).nullable().optional(),
|
|
2078
2084
|
entity_id: e.string().max(255).nullable().optional()
|
|
2079
2085
|
}).extend({
|
|
2080
|
-
status:
|
|
2086
|
+
status: F,
|
|
2081
2087
|
created_at: e.string(),
|
|
2082
2088
|
updated_at: e.string()
|
|
2083
2089
|
}), e.object({
|
|
2084
2090
|
seq: e.number().int().min(0),
|
|
2085
|
-
status:
|
|
2091
|
+
status: F,
|
|
2086
2092
|
error_code: e.string().max(64).nullable().optional(),
|
|
2087
2093
|
error_message: e.string().nullable().optional(),
|
|
2088
2094
|
error_path: e.string().max(255).nullable().optional(),
|
|
2089
2095
|
entity_id: e.string().max(255).nullable().optional()
|
|
2090
2096
|
});
|
|
2091
|
-
var
|
|
2097
|
+
var yn = e.enum([
|
|
2092
2098
|
"upgrade",
|
|
2093
2099
|
"reseed",
|
|
2094
2100
|
"backup"
|
|
2095
|
-
]),
|
|
2101
|
+
]), bn = e.enum([
|
|
2096
2102
|
"pending",
|
|
2097
2103
|
"canary",
|
|
2098
2104
|
"rolling",
|
|
@@ -2101,7 +2107,7 @@ var hn = e.enum([
|
|
|
2101
2107
|
"failed"
|
|
2102
2108
|
]);
|
|
2103
2109
|
e.object({
|
|
2104
|
-
kind:
|
|
2110
|
+
kind: yn,
|
|
2105
2111
|
target_worker_version: e.string().max(255).nullable().optional(),
|
|
2106
2112
|
target_database_version: e.string().max(255).nullable().optional(),
|
|
2107
2113
|
wave_size: e.number().int().min(1).default(10),
|
|
@@ -2110,7 +2116,7 @@ e.object({
|
|
|
2110
2116
|
initiated_by: e.string().max(255).nullable().optional()
|
|
2111
2117
|
}).extend({
|
|
2112
2118
|
id: e.string(),
|
|
2113
|
-
status:
|
|
2119
|
+
status: bn,
|
|
2114
2120
|
created_at: e.string(),
|
|
2115
2121
|
updated_at: e.string(),
|
|
2116
2122
|
finished_at: e.string().nullable().optional()
|
|
@@ -2132,7 +2138,7 @@ e.object({
|
|
|
2132
2138
|
code: e.string(),
|
|
2133
2139
|
state: e.string().optional()
|
|
2134
2140
|
});
|
|
2135
|
-
var
|
|
2141
|
+
var xn = e.object({
|
|
2136
2142
|
button_border_radius: e.number(),
|
|
2137
2143
|
button_border_weight: e.number(),
|
|
2138
2144
|
buttons_style: e.enum([
|
|
@@ -2150,7 +2156,7 @@ var _n = e.object({
|
|
|
2150
2156
|
show_widget_shadow: e.boolean(),
|
|
2151
2157
|
widget_border_weight: e.number(),
|
|
2152
2158
|
widget_corner_radius: e.number()
|
|
2153
|
-
}),
|
|
2159
|
+
}), Sn = e.object({
|
|
2154
2160
|
base_focus_color: e.string(),
|
|
2155
2161
|
base_hover_color: e.string(),
|
|
2156
2162
|
body_text: e.string(),
|
|
@@ -2174,20 +2180,20 @@ var _n = e.object({
|
|
|
2174
2180
|
success: e.string(),
|
|
2175
2181
|
widget_background: e.string(),
|
|
2176
2182
|
widget_border: e.string()
|
|
2177
|
-
}),
|
|
2183
|
+
}), I = e.object({
|
|
2178
2184
|
bold: e.boolean(),
|
|
2179
2185
|
size: e.number()
|
|
2180
|
-
}),
|
|
2181
|
-
body_text:
|
|
2182
|
-
buttons_text:
|
|
2186
|
+
}), Cn = e.object({
|
|
2187
|
+
body_text: I,
|
|
2188
|
+
buttons_text: I,
|
|
2183
2189
|
font_url: e.string(),
|
|
2184
|
-
input_labels:
|
|
2185
|
-
links:
|
|
2190
|
+
input_labels: I,
|
|
2191
|
+
links: I,
|
|
2186
2192
|
links_style: e.enum(["normal", "underlined"]),
|
|
2187
2193
|
reference_text_size: e.number(),
|
|
2188
|
-
subtitle:
|
|
2189
|
-
title:
|
|
2190
|
-
}),
|
|
2194
|
+
subtitle: I,
|
|
2195
|
+
title: I
|
|
2196
|
+
}), wn = e.object({
|
|
2191
2197
|
background_color: e.string(),
|
|
2192
2198
|
background_image_url: e.string(),
|
|
2193
2199
|
page_layout: e.enum([
|
|
@@ -2200,7 +2206,7 @@ var _n = e.object({
|
|
|
2200
2206
|
"chip",
|
|
2201
2207
|
"none"
|
|
2202
2208
|
]).optional()
|
|
2203
|
-
}),
|
|
2209
|
+
}), Tn = e.object({
|
|
2204
2210
|
header_text_alignment: e.enum([
|
|
2205
2211
|
"center",
|
|
2206
2212
|
"left",
|
|
@@ -2217,12 +2223,12 @@ var _n = e.object({
|
|
|
2217
2223
|
social_buttons_layout: e.enum(["bottom", "top"])
|
|
2218
2224
|
});
|
|
2219
2225
|
e.object({
|
|
2220
|
-
borders:
|
|
2221
|
-
colors:
|
|
2226
|
+
borders: xn,
|
|
2227
|
+
colors: Sn,
|
|
2222
2228
|
displayName: e.string(),
|
|
2223
|
-
fonts:
|
|
2224
|
-
page_background:
|
|
2225
|
-
widget:
|
|
2229
|
+
fonts: Cn,
|
|
2230
|
+
page_background: wn,
|
|
2231
|
+
widget: Tn
|
|
2226
2232
|
}).extend({ themeId: e.string() }), e.object({
|
|
2227
2233
|
universal_login_experience: e.enum(["new", "classic"]).default("new"),
|
|
2228
2234
|
identifier_first: e.boolean().default(!0),
|
|
@@ -2230,42 +2236,87 @@ e.object({
|
|
|
2230
2236
|
show_last_used_connection: e.boolean().default(!1),
|
|
2231
2237
|
webauthn_platform_first_factor: e.boolean()
|
|
2232
2238
|
});
|
|
2233
|
-
var
|
|
2239
|
+
var En = e.object({
|
|
2234
2240
|
hosts: e.array(e.string()).optional(),
|
|
2235
2241
|
methods: e.array(e.string()).optional(),
|
|
2236
2242
|
path: e.string().default("/*"),
|
|
2237
2243
|
headers: e.record(e.string(), e.string()).optional(),
|
|
2238
2244
|
query: e.record(e.string(), e.string()).optional()
|
|
2239
|
-
}),
|
|
2245
|
+
}), Dn = e.object({
|
|
2240
2246
|
type: e.string(),
|
|
2241
2247
|
options: e.record(e.string(), e.unknown()).default({})
|
|
2242
|
-
}),
|
|
2248
|
+
}), L = e.object({
|
|
2243
2249
|
id: e.string().optional(),
|
|
2244
2250
|
custom_domain_id: e.string(),
|
|
2245
2251
|
priority: e.number().int().default(100),
|
|
2246
|
-
match:
|
|
2247
|
-
handlers: e.array(
|
|
2248
|
-
}),
|
|
2252
|
+
match: En,
|
|
2253
|
+
handlers: e.array(Dn).min(1)
|
|
2254
|
+
}), On = L.extend({
|
|
2249
2255
|
id: e.string(),
|
|
2250
2256
|
tenant_id: e.string(),
|
|
2251
2257
|
created_at: e.string(),
|
|
2252
2258
|
updated_at: e.string()
|
|
2253
|
-
}),
|
|
2259
|
+
}), kn = L.partial().omit({
|
|
2254
2260
|
id: !0,
|
|
2255
2261
|
custom_domain_id: !0
|
|
2256
|
-
}),
|
|
2262
|
+
}), An = "custom_authentication", jn = [
|
|
2263
|
+
"urn:ietf:params:oauth:",
|
|
2264
|
+
"urn:auth0",
|
|
2265
|
+
"urn:okta",
|
|
2266
|
+
"http://auth0.com",
|
|
2267
|
+
"https://auth0.com",
|
|
2268
|
+
"http://okta.com",
|
|
2269
|
+
"https://okta.com"
|
|
2270
|
+
], Mn = e.string().min(1).max(200).refine((e) => e.startsWith("https://") || e.startsWith("urn:"), { message: "subject_token_type must be a URI starting with https:// or urn:" }).refine((e) => !jn.some((t) => e.toLowerCase().startsWith(t)), { message: "subject_token_type uses a reserved namespace" }), Nn = e.enum([
|
|
2271
|
+
"RS256",
|
|
2272
|
+
"RS384",
|
|
2273
|
+
"RS512",
|
|
2274
|
+
"ES256",
|
|
2275
|
+
"ES384",
|
|
2276
|
+
"ES512"
|
|
2277
|
+
]), Pn = e.discriminatedUnion("type", [e.object({
|
|
2278
|
+
type: e.literal("connection"),
|
|
2279
|
+
connection: e.string().min(1),
|
|
2280
|
+
create_if_not_exists: e.boolean().default(!0),
|
|
2281
|
+
trust_email_verified: e.boolean().default(!1)
|
|
2282
|
+
}), e.object({ type: e.literal("user_id") })]), Fn = e.object({
|
|
2283
|
+
issuer: e.string().min(1).max(2048),
|
|
2284
|
+
jwks: Jt.optional(),
|
|
2285
|
+
jwks_uri: e.string().url().optional(),
|
|
2286
|
+
audience: e.array(e.string().min(1)).min(1).optional(),
|
|
2287
|
+
algorithms: e.array(Nn).min(1).optional(),
|
|
2288
|
+
max_lifetime_seconds: e.number().int().min(1).max(3600).default(300),
|
|
2289
|
+
require_jti: e.boolean().default(!0),
|
|
2290
|
+
user_mapping: Pn
|
|
2291
|
+
});
|
|
2292
|
+
e.object({
|
|
2293
|
+
name: e.string().min(1).max(255),
|
|
2294
|
+
subject_token_type: Mn,
|
|
2295
|
+
action_id: e.string().min(1).optional(),
|
|
2296
|
+
type: e.literal(An),
|
|
2297
|
+
jwt_verification: Fn.optional()
|
|
2298
|
+
}).extend({
|
|
2299
|
+
id: e.string(),
|
|
2300
|
+
created_at: e.string(),
|
|
2301
|
+
updated_at: e.string()
|
|
2302
|
+
}), e.object({
|
|
2303
|
+
name: e.string().min(1).max(255).optional(),
|
|
2304
|
+
subject_token_type: Mn.optional(),
|
|
2305
|
+
jwt_verification: Fn.optional()
|
|
2306
|
+
});
|
|
2307
|
+
var In = e.object({
|
|
2257
2308
|
scim: e.string(),
|
|
2258
2309
|
auth0: e.string()
|
|
2259
|
-
}),
|
|
2310
|
+
}), Ln = e.object({
|
|
2260
2311
|
connection_id: e.string(),
|
|
2261
2312
|
user_id_attribute: e.string().default("externalId"),
|
|
2262
|
-
mapping: e.array(
|
|
2313
|
+
mapping: e.array(In).default([])
|
|
2263
2314
|
});
|
|
2264
2315
|
e.object({
|
|
2265
2316
|
created_at: e.string(),
|
|
2266
2317
|
updated_at: e.string()
|
|
2267
|
-
}).extend(
|
|
2268
|
-
var
|
|
2318
|
+
}).extend(Ln.shape);
|
|
2319
|
+
var Rn = e.object({
|
|
2269
2320
|
token_id: e.string(),
|
|
2270
2321
|
connection_id: e.string(),
|
|
2271
2322
|
token_hash: e.string(),
|
|
@@ -2275,20 +2326,20 @@ var On = e.object({
|
|
|
2275
2326
|
e.object({
|
|
2276
2327
|
created_at: e.string(),
|
|
2277
2328
|
last_used_at: e.string().optional()
|
|
2278
|
-
}).extend(
|
|
2279
|
-
var
|
|
2329
|
+
}).extend(Rn.shape);
|
|
2330
|
+
var zn = e.object({
|
|
2280
2331
|
connection_id: e.string(),
|
|
2281
2332
|
external_id: e.string(),
|
|
2282
2333
|
user_id: e.string()
|
|
2283
2334
|
});
|
|
2284
|
-
e.object({ created_at: e.string() }).extend(
|
|
2335
|
+
e.object({ created_at: e.string() }).extend(zn.shape), e.object({
|
|
2285
2336
|
name: e.string(),
|
|
2286
2337
|
enabled: e.boolean().optional().default(!0),
|
|
2287
2338
|
default_from_address: e.string().optional(),
|
|
2288
2339
|
credentials: e.record(e.string(), e.unknown()),
|
|
2289
2340
|
settings: e.object({}).optional()
|
|
2290
2341
|
});
|
|
2291
|
-
var
|
|
2342
|
+
var Bn = e.enum([
|
|
2292
2343
|
"verify_email",
|
|
2293
2344
|
"verify_email_by_code",
|
|
2294
2345
|
"reset_email",
|
|
@@ -2303,7 +2354,7 @@ var An = e.enum([
|
|
|
2303
2354
|
"user_invitation"
|
|
2304
2355
|
]);
|
|
2305
2356
|
e.object({
|
|
2306
|
-
template:
|
|
2357
|
+
template: Bn,
|
|
2307
2358
|
body: e.string(),
|
|
2308
2359
|
from: e.string(),
|
|
2309
2360
|
subject: e.string(),
|
|
@@ -2318,13 +2369,13 @@ e.object({
|
|
|
2318
2369
|
session_id: e.string().optional(),
|
|
2319
2370
|
organization: e.string().optional(),
|
|
2320
2371
|
auth_connection: e.string().optional(),
|
|
2321
|
-
auth_strategy:
|
|
2372
|
+
auth_strategy: Zt.optional(),
|
|
2322
2373
|
user_id: e.string(),
|
|
2323
2374
|
client_id: e.string(),
|
|
2324
2375
|
expires_at: e.string().optional(),
|
|
2325
2376
|
idle_expires_at: e.string().optional(),
|
|
2326
2377
|
last_exchanged_at: e.string().optional(),
|
|
2327
|
-
device:
|
|
2378
|
+
device: fn,
|
|
2328
2379
|
resource_servers: e.array(e.object({
|
|
2329
2380
|
audience: e.string(),
|
|
2330
2381
|
scopes: e.string()
|
|
@@ -2345,10 +2396,10 @@ e.object({
|
|
|
2345
2396
|
name: e.string(),
|
|
2346
2397
|
options: e.object({})
|
|
2347
2398
|
});
|
|
2348
|
-
var
|
|
2399
|
+
var Vn = e.object({
|
|
2349
2400
|
value: e.string(),
|
|
2350
2401
|
description: e.string().optional()
|
|
2351
|
-
}),
|
|
2402
|
+
}), Hn = e.object({
|
|
2352
2403
|
token_dialect: e.enum(["access_token", "access_token_authz"]).optional(),
|
|
2353
2404
|
enforce_policies: e.boolean().optional(),
|
|
2354
2405
|
allow_skipping_userinfo: e.boolean().optional(),
|
|
@@ -2356,11 +2407,11 @@ var jn = e.object({
|
|
|
2356
2407
|
persist_client_authorization: e.boolean().optional(),
|
|
2357
2408
|
enable_introspection_endpoint: e.boolean().optional(),
|
|
2358
2409
|
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2359
|
-
}),
|
|
2410
|
+
}), Un = e.object({
|
|
2360
2411
|
id: e.string().optional(),
|
|
2361
2412
|
name: e.string(),
|
|
2362
2413
|
identifier: e.string(),
|
|
2363
|
-
scopes: e.array(
|
|
2414
|
+
scopes: e.array(Vn).optional(),
|
|
2364
2415
|
signing_alg: e.string().optional(),
|
|
2365
2416
|
signing_secret: e.string().optional(),
|
|
2366
2417
|
token_lifetime: e.number().default(86400),
|
|
@@ -2368,20 +2419,20 @@ var jn = e.object({
|
|
|
2368
2419
|
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2369
2420
|
allow_offline_access: e.boolean().optional(),
|
|
2370
2421
|
verificationKey: e.string().optional(),
|
|
2371
|
-
options:
|
|
2422
|
+
options: Hn.optional(),
|
|
2372
2423
|
is_system: e.boolean().optional(),
|
|
2373
2424
|
metadata: e.record(e.string(), e.any()).optional()
|
|
2374
2425
|
}).extend({
|
|
2375
2426
|
created_at: e.string().optional(),
|
|
2376
2427
|
updated_at: e.string().optional()
|
|
2377
2428
|
});
|
|
2378
|
-
e.array(
|
|
2379
|
-
var
|
|
2429
|
+
e.array(Un);
|
|
2430
|
+
var Wn = e.object({
|
|
2380
2431
|
role_id: e.string(),
|
|
2381
2432
|
resource_server_identifier: e.string(),
|
|
2382
2433
|
permission_name: e.string()
|
|
2383
2434
|
}).extend({ created_at: e.string() });
|
|
2384
|
-
e.array(
|
|
2435
|
+
e.array(Wn), e.object({
|
|
2385
2436
|
user_id: e.string().openapi({ description: "The id of the user that granted the consent" }),
|
|
2386
2437
|
clientID: e.string().openapi({ description: "The id of the client the grant was issued to" }),
|
|
2387
2438
|
audience: e.string().optional().openapi({ description: "The audience the grant applies to" }),
|
|
@@ -2394,7 +2445,7 @@ e.array(Pn), e.object({
|
|
|
2394
2445
|
failed_logins: e.array(e.string()).optional(),
|
|
2395
2446
|
last_password_reset: e.string().optional()
|
|
2396
2447
|
});
|
|
2397
|
-
var
|
|
2448
|
+
var Gn = e.object({
|
|
2398
2449
|
user_id: e.string(),
|
|
2399
2450
|
resource_server_identifier: e.string(),
|
|
2400
2451
|
permission_name: e.string(),
|
|
@@ -2403,8 +2454,8 @@ var Fn = e.object({
|
|
|
2403
2454
|
tenant_id: e.string(),
|
|
2404
2455
|
created_at: e.string().optional()
|
|
2405
2456
|
});
|
|
2406
|
-
e.array(
|
|
2407
|
-
var
|
|
2457
|
+
e.array(Gn);
|
|
2458
|
+
var Kn = e.object({
|
|
2408
2459
|
user_id: e.string(),
|
|
2409
2460
|
resource_server_identifier: e.string(),
|
|
2410
2461
|
resource_server_name: e.string(),
|
|
@@ -2413,8 +2464,8 @@ var In = e.object({
|
|
|
2413
2464
|
created_at: e.string().optional(),
|
|
2414
2465
|
organization_id: e.string().optional()
|
|
2415
2466
|
});
|
|
2416
|
-
e.array(
|
|
2417
|
-
var
|
|
2467
|
+
e.array(Kn);
|
|
2468
|
+
var qn = e.object({
|
|
2418
2469
|
user_id: e.string(),
|
|
2419
2470
|
role_id: e.string(),
|
|
2420
2471
|
organization_id: e.string().optional()
|
|
@@ -2422,8 +2473,8 @@ var Ln = e.object({
|
|
|
2422
2473
|
tenant_id: e.string(),
|
|
2423
2474
|
created_at: e.string().optional()
|
|
2424
2475
|
});
|
|
2425
|
-
e.array(
|
|
2426
|
-
var
|
|
2476
|
+
e.array(qn);
|
|
2477
|
+
var Jn = e.object({
|
|
2427
2478
|
id: e.string().optional().openapi({ description: "The unique identifier of the role. If not provided, one will be generated." }),
|
|
2428
2479
|
name: e.string().min(1).max(50).openapi({ description: "The name of the role. Cannot include '<' or '>'" }),
|
|
2429
2480
|
description: e.string().max(255).optional().openapi({ description: "The description of the role" }),
|
|
@@ -2434,19 +2485,19 @@ var Rn = e.object({
|
|
|
2434
2485
|
created_at: e.string().optional(),
|
|
2435
2486
|
updated_at: e.string().optional()
|
|
2436
2487
|
});
|
|
2437
|
-
e.array(
|
|
2438
|
-
var
|
|
2488
|
+
e.array(Jn);
|
|
2489
|
+
var Yn = e.object({
|
|
2439
2490
|
logo_url: e.string().optional().openapi({ description: "URL of the organization's logo" }),
|
|
2440
2491
|
colors: e.object({
|
|
2441
2492
|
primary: e.string().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
2442
2493
|
page_background: e.string().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
2443
2494
|
}).optional()
|
|
2444
|
-
}).optional(),
|
|
2495
|
+
}).optional(), Xn = e.object({
|
|
2445
2496
|
connection_id: e.string().openapi({ description: "ID of the connection" }),
|
|
2446
2497
|
assign_membership_on_login: e.boolean().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
2447
2498
|
show_as_button: e.boolean().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
2448
2499
|
is_signup_enabled: e.boolean().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
2449
|
-
}),
|
|
2500
|
+
}), Zn = e.object({ client_credentials: e.object({
|
|
2450
2501
|
enforce: e.boolean().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
2451
2502
|
per_day: e.number().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
2452
2503
|
per_hour: e.number().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
@@ -2455,15 +2506,15 @@ e.object({
|
|
|
2455
2506
|
id: e.string().optional(),
|
|
2456
2507
|
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." }),
|
|
2457
2508
|
display_name: e.string().optional().openapi({ description: "The display name of the organization" }),
|
|
2458
|
-
branding:
|
|
2509
|
+
branding: Yn,
|
|
2459
2510
|
metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
2460
|
-
enabled_connections: e.array(
|
|
2461
|
-
token_quota:
|
|
2511
|
+
enabled_connections: e.array(Xn).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2512
|
+
token_quota: Zn
|
|
2462
2513
|
}).extend(n.shape).extend({
|
|
2463
2514
|
id: e.string(),
|
|
2464
2515
|
name: e.string().min(1).openapi({ description: "The name of the organization" })
|
|
2465
2516
|
});
|
|
2466
|
-
var
|
|
2517
|
+
var Qn = e.object({
|
|
2467
2518
|
connection_id: e.string().openapi({ description: "ID of the tenant-level connection to enable for the org." }),
|
|
2468
2519
|
assign_membership_on_login: e.boolean().optional().default(!1),
|
|
2469
2520
|
show_as_button: e.boolean().optional().default(!0),
|
|
@@ -2476,7 +2527,7 @@ var Hn = e.object({
|
|
|
2476
2527
|
created_at: e.string().optional(),
|
|
2477
2528
|
updated_at: e.string().optional()
|
|
2478
2529
|
});
|
|
2479
|
-
e.array(
|
|
2530
|
+
e.array(Qn), e.object({
|
|
2480
2531
|
user_id: e.string().openapi({ description: "ID of the user" }),
|
|
2481
2532
|
organization_id: e.string().openapi({ description: "ID of the organization" })
|
|
2482
2533
|
}).extend(n.shape).extend({ id: e.string() }), e.object({
|
|
@@ -2615,7 +2666,7 @@ e.array(Hn), e.object({
|
|
|
2615
2666
|
"passwordless",
|
|
2616
2667
|
"enterprise"
|
|
2617
2668
|
]);
|
|
2618
|
-
var
|
|
2669
|
+
var $n = e.object({
|
|
2619
2670
|
cohort: e.string(),
|
|
2620
2671
|
sessions: e.number(),
|
|
2621
2672
|
active: e.array(e.number())
|
|
@@ -2624,9 +2675,9 @@ e.object({
|
|
|
2624
2675
|
interval: e.literal("week"),
|
|
2625
2676
|
from: e.string(),
|
|
2626
2677
|
to: e.string(),
|
|
2627
|
-
cohorts: e.array(
|
|
2678
|
+
cohorts: e.array($n)
|
|
2628
2679
|
});
|
|
2629
|
-
var
|
|
2680
|
+
var er = e.object({
|
|
2630
2681
|
cohort: e.string(),
|
|
2631
2682
|
tokens: e.number(),
|
|
2632
2683
|
active: e.array(e.number())
|
|
@@ -2635,24 +2686,24 @@ e.object({
|
|
|
2635
2686
|
interval: e.literal("week"),
|
|
2636
2687
|
from: e.string(),
|
|
2637
2688
|
to: e.string(),
|
|
2638
|
-
cohorts: e.array(
|
|
2689
|
+
cohorts: e.array(er)
|
|
2639
2690
|
});
|
|
2640
|
-
var
|
|
2691
|
+
var tr = e.object({
|
|
2641
2692
|
name: e.string(),
|
|
2642
2693
|
type: e.string()
|
|
2643
|
-
}),
|
|
2694
|
+
}), nr = e.object({
|
|
2644
2695
|
elapsed: e.number(),
|
|
2645
2696
|
rows_read: e.number().optional(),
|
|
2646
2697
|
bytes_read: e.number().optional()
|
|
2647
2698
|
});
|
|
2648
2699
|
e.object({
|
|
2649
|
-
meta: e.array(
|
|
2700
|
+
meta: e.array(tr),
|
|
2650
2701
|
data: e.array(e.record(e.string(), e.any())),
|
|
2651
2702
|
rows: e.number(),
|
|
2652
2703
|
rows_before_limit_at_least: e.number().optional(),
|
|
2653
|
-
statistics:
|
|
2704
|
+
statistics: nr.optional()
|
|
2654
2705
|
});
|
|
2655
|
-
var
|
|
2706
|
+
var rr = 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(".")), ir = e.record(e.string(), e.record(e.string(), e.string())).openapi({
|
|
2656
2707
|
type: "object",
|
|
2657
2708
|
additionalProperties: {
|
|
2658
2709
|
type: "object",
|
|
@@ -2660,11 +2711,11 @@ var qn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.
|
|
|
2660
2711
|
}
|
|
2661
2712
|
});
|
|
2662
2713
|
e.object({
|
|
2663
|
-
prompt:
|
|
2714
|
+
prompt: rr,
|
|
2664
2715
|
language: e.string(),
|
|
2665
|
-
custom_text:
|
|
2716
|
+
custom_text: ir
|
|
2666
2717
|
});
|
|
2667
|
-
var
|
|
2718
|
+
var ar = e.enum([
|
|
2668
2719
|
"phone",
|
|
2669
2720
|
"totp",
|
|
2670
2721
|
"email",
|
|
@@ -2672,9 +2723,9 @@ var Yn = e.enum([
|
|
|
2672
2723
|
"webauthn-roaming",
|
|
2673
2724
|
"webauthn-platform",
|
|
2674
2725
|
"passkey"
|
|
2675
|
-
]),
|
|
2726
|
+
]), or = e.object({
|
|
2676
2727
|
user_id: e.string(),
|
|
2677
|
-
type:
|
|
2728
|
+
type: ar,
|
|
2678
2729
|
phone_number: e.string().optional(),
|
|
2679
2730
|
totp_secret: e.string().optional(),
|
|
2680
2731
|
credential_id: e.string().optional(),
|
|
@@ -2685,7 +2736,7 @@ var Yn = e.enum([
|
|
|
2685
2736
|
friendly_name: e.string().optional(),
|
|
2686
2737
|
confirmed: e.boolean().default(!1)
|
|
2687
2738
|
});
|
|
2688
|
-
function
|
|
2739
|
+
function R(t, n) {
|
|
2689
2740
|
t.type === "phone" && !t.phone_number && n.addIssue({
|
|
2690
2741
|
code: e.ZodIssueCode.custom,
|
|
2691
2742
|
message: "phone_number is required when type is 'phone'",
|
|
@@ -2708,31 +2759,53 @@ function Zn(t, n) {
|
|
|
2708
2759
|
path: ["public_key"]
|
|
2709
2760
|
}));
|
|
2710
2761
|
}
|
|
2711
|
-
|
|
2762
|
+
or.superRefine(R), or.extend({
|
|
2712
2763
|
id: e.string(),
|
|
2713
2764
|
created_at: e.string(),
|
|
2714
2765
|
updated_at: e.string()
|
|
2715
|
-
}).superRefine(
|
|
2766
|
+
}).superRefine(R), e.object({
|
|
2716
2767
|
id: e.string().optional(),
|
|
2717
2768
|
created_at: e.string().datetime({ offset: !0 }).optional(),
|
|
2718
2769
|
updated_at: e.string().datetime({ offset: !0 }).optional()
|
|
2719
2770
|
});
|
|
2720
|
-
var
|
|
2771
|
+
var sr = "x-authhero-preserve-location", z = class extends Error {
|
|
2721
2772
|
ms;
|
|
2722
2773
|
constructor(e, t) {
|
|
2723
2774
|
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2724
2775
|
}
|
|
2725
2776
|
};
|
|
2726
|
-
function
|
|
2727
|
-
return e instanceof
|
|
2777
|
+
function B(e) {
|
|
2778
|
+
return e instanceof z ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2728
2779
|
}
|
|
2729
|
-
function
|
|
2780
|
+
function V(e, t) {
|
|
2730
2781
|
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
2731
2782
|
return t(n.signal).finally(() => clearTimeout(r));
|
|
2732
2783
|
}
|
|
2733
|
-
function
|
|
2784
|
+
function cr(e) {
|
|
2785
|
+
let t = e.filter((e) => e !== void 0);
|
|
2786
|
+
if (t.length <= 1) return t[0];
|
|
2787
|
+
if (typeof AbortSignal.any == "function") return AbortSignal.any(t);
|
|
2788
|
+
let n = new AbortController(), r = t.find((e) => e.aborted);
|
|
2789
|
+
if (r) return n.abort(r.reason), n.signal;
|
|
2790
|
+
let i = () => {
|
|
2791
|
+
for (let e of t) e.removeEventListener("abort", i);
|
|
2792
|
+
n.abort(t.find((e) => e.aborted)?.reason);
|
|
2793
|
+
};
|
|
2794
|
+
for (let e of t) e.addEventListener("abort", i);
|
|
2795
|
+
return n.signal;
|
|
2796
|
+
}
|
|
2797
|
+
function H(e, t, n, r) {
|
|
2798
|
+
let i = new AbortController(), a = cr([n, i.signal]) ?? i.signal, o, s = new Promise((n, r) => {
|
|
2799
|
+
o = setTimeout(() => {
|
|
2800
|
+
let n = new z(e, t);
|
|
2801
|
+
i.abort(n), r(n);
|
|
2802
|
+
}, e);
|
|
2803
|
+
});
|
|
2804
|
+
return Promise.race([Promise.resolve().then(() => r(a)), s]).finally(() => clearTimeout(o));
|
|
2805
|
+
}
|
|
2806
|
+
function U(e, t, n) {
|
|
2734
2807
|
let r, i = new Promise((e, i) => {
|
|
2735
|
-
r = setTimeout(() => i(new
|
|
2808
|
+
r = setTimeout(() => i(new z(t, n)), t);
|
|
2736
2809
|
});
|
|
2737
2810
|
return Promise.race([e, i]).finally(() => {
|
|
2738
2811
|
r && clearTimeout(r);
|
|
@@ -2740,12 +2813,12 @@ function W(e, t, n) {
|
|
|
2740
2813
|
}
|
|
2741
2814
|
//#endregion
|
|
2742
2815
|
//#region src/data-plane/cache.ts
|
|
2743
|
-
var
|
|
2744
|
-
function
|
|
2816
|
+
var lr = 1e4, ur = 8e3;
|
|
2817
|
+
function W(e, t, n) {
|
|
2745
2818
|
let r = typeof t == "number" ? {
|
|
2746
2819
|
freshTtlMs: t,
|
|
2747
2820
|
maxEntries: n
|
|
2748
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ??
|
|
2821
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ?? lr, l = r.waitUntil, u = r.upstreamTimeoutMs ?? ur, d = u > 0 ? u : 1e4, f = /* @__PURE__ */ new Map();
|
|
2749
2822
|
function p(e) {
|
|
2750
2823
|
for (let [t, n] of f) n.stale_if_error_until <= e && n.stale_until <= e && f.delete(t);
|
|
2751
2824
|
for (; f.size >= c;) {
|
|
@@ -2766,42 +2839,41 @@ function G(e, t, n) {
|
|
|
2766
2839
|
function h(e, t) {
|
|
2767
2840
|
return e.refresh_started_at === void 0 ? !1 : t - e.refresh_started_at < d ? !0 : (e.refresh_started_at = void 0, !1);
|
|
2768
2841
|
}
|
|
2769
|
-
function g(t) {
|
|
2770
|
-
|
|
2771
|
-
return u > 0 ? W(n, u, "resolveHost") : n;
|
|
2842
|
+
function g(t, n) {
|
|
2843
|
+
return u > 0 ? H(u, "resolveHost", n, (n) => e.resolveHost(t, { signal: n })) : e.resolveHost(t, { signal: n });
|
|
2772
2844
|
}
|
|
2773
|
-
async function _(e) {
|
|
2774
|
-
let
|
|
2775
|
-
|
|
2845
|
+
async function _(e, t) {
|
|
2846
|
+
let n = f.get(e);
|
|
2847
|
+
n && (n.refresh_started_at = Date.now());
|
|
2776
2848
|
try {
|
|
2777
|
-
let
|
|
2778
|
-
return m(e,
|
|
2849
|
+
let n = await g(e, t);
|
|
2850
|
+
return m(e, n, Date.now()), n;
|
|
2779
2851
|
} catch (t) {
|
|
2780
2852
|
let n = f.get(e);
|
|
2781
2853
|
throw n && (n.refresh_started_at = void 0, n.stale_if_error_until <= Date.now() && f.delete(e)), t;
|
|
2782
2854
|
}
|
|
2783
2855
|
}
|
|
2784
|
-
return { async resolveHost(e) {
|
|
2785
|
-
let
|
|
2786
|
-
if (
|
|
2787
|
-
if (
|
|
2788
|
-
if (f.delete(e), f.set(e,
|
|
2856
|
+
return { async resolveHost(e, t) {
|
|
2857
|
+
let n = Date.now(), r = f.get(e);
|
|
2858
|
+
if (r && r.fresh_until > n) return f.delete(e), f.set(e, r), r.value;
|
|
2859
|
+
if (r && r.stale_until > n) {
|
|
2860
|
+
if (f.delete(e), f.set(e, r), !h(r, n)) {
|
|
2789
2861
|
let t = _(e).catch(() => void 0);
|
|
2790
2862
|
l && l(t);
|
|
2791
2863
|
}
|
|
2792
|
-
return
|
|
2864
|
+
return r.value;
|
|
2793
2865
|
}
|
|
2794
2866
|
try {
|
|
2795
|
-
return await _(e);
|
|
2867
|
+
return await _(e, t?.signal);
|
|
2796
2868
|
} catch (e) {
|
|
2797
|
-
if (
|
|
2869
|
+
if (r && r.stale_if_error_until > n) return r.value;
|
|
2798
2870
|
throw e;
|
|
2799
2871
|
}
|
|
2800
2872
|
} };
|
|
2801
2873
|
}
|
|
2802
2874
|
//#endregion
|
|
2803
2875
|
//#region src/data-plane/registry.ts
|
|
2804
|
-
var
|
|
2876
|
+
var dr = class {
|
|
2805
2877
|
definitions = /* @__PURE__ */ new Map();
|
|
2806
2878
|
bindings;
|
|
2807
2879
|
constructor(e = {}) {
|
|
@@ -2821,38 +2893,38 @@ var tr = class {
|
|
|
2821
2893
|
return n.build(r.data, { bindings: this.bindings });
|
|
2822
2894
|
}
|
|
2823
2895
|
};
|
|
2824
|
-
function
|
|
2896
|
+
function G(e) {
|
|
2825
2897
|
return e;
|
|
2826
2898
|
}
|
|
2827
2899
|
//#endregion
|
|
2828
2900
|
//#region src/data-plane/handlers/util.ts
|
|
2829
|
-
var
|
|
2830
|
-
function
|
|
2831
|
-
e.set(
|
|
2901
|
+
var fr = "__authhero_proxy_request__", pr = "__authhero_proxy_tenant_id__", mr = "__authhero_proxy_custom_domain_id__", hr = "__authhero_proxy_domain__", gr = "x-authhero-proxy-mutability-probe";
|
|
2902
|
+
function _r(e, t) {
|
|
2903
|
+
e.set(fr, t);
|
|
2832
2904
|
}
|
|
2833
|
-
function
|
|
2834
|
-
return e.get(
|
|
2905
|
+
function K(e) {
|
|
2906
|
+
return e.get(fr) ?? e.req.raw;
|
|
2835
2907
|
}
|
|
2836
|
-
function
|
|
2837
|
-
e.set(
|
|
2908
|
+
function vr(e, t) {
|
|
2909
|
+
e.set(pr, t.tenant_id), e.set(mr, t.custom_domain_id), e.set(hr, t.domain);
|
|
2838
2910
|
}
|
|
2839
|
-
function
|
|
2840
|
-
return e.get(
|
|
2911
|
+
function yr(e) {
|
|
2912
|
+
return e.get(pr);
|
|
2841
2913
|
}
|
|
2842
|
-
function
|
|
2843
|
-
return e.get(
|
|
2914
|
+
function br(e) {
|
|
2915
|
+
return e.get(mr);
|
|
2844
2916
|
}
|
|
2845
|
-
function
|
|
2846
|
-
return e.get(
|
|
2917
|
+
function xr(e) {
|
|
2918
|
+
return e.get(hr);
|
|
2847
2919
|
}
|
|
2848
|
-
function
|
|
2849
|
-
let n =
|
|
2850
|
-
t(r),
|
|
2920
|
+
function Sr(e, t) {
|
|
2921
|
+
let n = K(e), r = new Headers(n.headers);
|
|
2922
|
+
t(r), _r(e, new Request(n, { headers: r }));
|
|
2851
2923
|
}
|
|
2852
|
-
function
|
|
2924
|
+
function q(e) {
|
|
2853
2925
|
let t = e.res;
|
|
2854
2926
|
try {
|
|
2855
|
-
t.headers.append(
|
|
2927
|
+
t.headers.append(gr, "1"), t.headers.delete(gr);
|
|
2856
2928
|
return;
|
|
2857
2929
|
} catch {
|
|
2858
2930
|
e.res = new Response(t.body, {
|
|
@@ -2864,7 +2936,7 @@ function J(e) {
|
|
|
2864
2936
|
}
|
|
2865
2937
|
//#endregion
|
|
2866
2938
|
//#region src/data-plane/handlers/cors.ts
|
|
2867
|
-
var
|
|
2939
|
+
var Cr = e.object({
|
|
2868
2940
|
origins: e.array(e.string()).optional(),
|
|
2869
2941
|
allow_credentials: e.boolean().optional(),
|
|
2870
2942
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2872,44 +2944,44 @@ var pr = e.object({
|
|
|
2872
2944
|
expose_headers: e.array(e.string()).optional(),
|
|
2873
2945
|
max_age: e.number().int().optional()
|
|
2874
2946
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2875
|
-
function
|
|
2947
|
+
function wr(e, t) {
|
|
2876
2948
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2877
2949
|
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;
|
|
2878
2950
|
}
|
|
2879
|
-
var
|
|
2951
|
+
var Tr = G({
|
|
2880
2952
|
type: "cors",
|
|
2881
|
-
optionsSchema:
|
|
2953
|
+
optionsSchema: Cr,
|
|
2882
2954
|
build(e) {
|
|
2883
2955
|
return async (t, n) => {
|
|
2884
2956
|
let r = t.req.header("origin") ?? null;
|
|
2885
2957
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2886
|
-
let t =
|
|
2958
|
+
let t = wr(e, r);
|
|
2887
2959
|
return new Response(null, {
|
|
2888
2960
|
status: 204,
|
|
2889
2961
|
headers: t
|
|
2890
2962
|
});
|
|
2891
2963
|
}
|
|
2892
2964
|
await n();
|
|
2893
|
-
let i =
|
|
2894
|
-
|
|
2965
|
+
let i = wr(e, r);
|
|
2966
|
+
q(t), i.forEach((e, n) => {
|
|
2895
2967
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2896
2968
|
});
|
|
2897
2969
|
};
|
|
2898
2970
|
}
|
|
2899
|
-
}),
|
|
2971
|
+
}), Er = e.object({
|
|
2900
2972
|
username: e.string(),
|
|
2901
2973
|
password: e.string(),
|
|
2902
2974
|
realm: e.string().optional()
|
|
2903
2975
|
});
|
|
2904
|
-
function
|
|
2976
|
+
function Dr(e, t) {
|
|
2905
2977
|
let n = `${e}:${t}`;
|
|
2906
2978
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2907
2979
|
}
|
|
2908
|
-
var
|
|
2980
|
+
var Or = G({
|
|
2909
2981
|
type: "basic_auth",
|
|
2910
|
-
optionsSchema:
|
|
2982
|
+
optionsSchema: Er,
|
|
2911
2983
|
build(e) {
|
|
2912
|
-
let t =
|
|
2984
|
+
let t = Dr(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2913
2985
|
return async (e, r) => {
|
|
2914
2986
|
let i = e.req.header("authorization");
|
|
2915
2987
|
if (i) {
|
|
@@ -2925,7 +2997,7 @@ var vr = K({
|
|
|
2925
2997
|
});
|
|
2926
2998
|
};
|
|
2927
2999
|
}
|
|
2928
|
-
}),
|
|
3000
|
+
}), kr = G({
|
|
2929
3001
|
type: "headers",
|
|
2930
3002
|
optionsSchema: e.object({
|
|
2931
3003
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2935,23 +3007,23 @@ var vr = K({
|
|
|
2935
3007
|
}),
|
|
2936
3008
|
build(e) {
|
|
2937
3009
|
return async (t, n) => {
|
|
2938
|
-
if ((e.request || e.remove_request) &&
|
|
3010
|
+
if ((e.request || e.remove_request) && Sr(t, (t) => {
|
|
2939
3011
|
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2940
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
3012
|
+
}), await n(), (e.response || e.remove_response) && (q(t), 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);
|
|
2941
3013
|
};
|
|
2942
3014
|
}
|
|
2943
|
-
}),
|
|
3015
|
+
}), Ar = G({
|
|
2944
3016
|
type: "cache",
|
|
2945
3017
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2946
3018
|
build(e) {
|
|
2947
3019
|
return async (t, n) => {
|
|
2948
3020
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2949
3021
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2950
|
-
|
|
3022
|
+
q(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2951
3023
|
}
|
|
2952
3024
|
};
|
|
2953
3025
|
}
|
|
2954
|
-
}),
|
|
3026
|
+
}), jr = [
|
|
2955
3027
|
"173.245.48.0/20",
|
|
2956
3028
|
"103.21.244.0/22",
|
|
2957
3029
|
"103.22.200.0/22",
|
|
@@ -2975,7 +3047,7 @@ var vr = K({
|
|
|
2975
3047
|
"2a06:98c0::/29",
|
|
2976
3048
|
"2c0f:f248::/32"
|
|
2977
3049
|
];
|
|
2978
|
-
function
|
|
3050
|
+
function Mr(e) {
|
|
2979
3051
|
let t = e.split(".");
|
|
2980
3052
|
if (t.length !== 4) return null;
|
|
2981
3053
|
let n = [];
|
|
@@ -2987,14 +3059,14 @@ function Sr(e) {
|
|
|
2987
3059
|
}
|
|
2988
3060
|
return n;
|
|
2989
3061
|
}
|
|
2990
|
-
function
|
|
3062
|
+
function Nr(e) {
|
|
2991
3063
|
if (e === "") return [];
|
|
2992
3064
|
let t = e.split(":"), n = [];
|
|
2993
3065
|
for (let e = 0; e < t.length; e++) {
|
|
2994
3066
|
let r = t[e];
|
|
2995
3067
|
if (r.includes(".")) {
|
|
2996
3068
|
if (e !== t.length - 1) return null;
|
|
2997
|
-
let i =
|
|
3069
|
+
let i = Mr(r);
|
|
2998
3070
|
if (!i) return null;
|
|
2999
3071
|
n.push(i[0] << 8 | i[1], i[2] << 8 | i[3]);
|
|
3000
3072
|
continue;
|
|
@@ -3004,14 +3076,14 @@ function Cr(e) {
|
|
|
3004
3076
|
}
|
|
3005
3077
|
return n;
|
|
3006
3078
|
}
|
|
3007
|
-
function
|
|
3079
|
+
function Pr(e) {
|
|
3008
3080
|
let t = e.split("::");
|
|
3009
3081
|
if (t.length > 2) return null;
|
|
3010
|
-
let n =
|
|
3082
|
+
let n = Nr(t[0] ?? "");
|
|
3011
3083
|
if (!n) return null;
|
|
3012
3084
|
let r;
|
|
3013
3085
|
if (t.length === 2) {
|
|
3014
|
-
let e =
|
|
3086
|
+
let e = Nr(t[1] ?? "");
|
|
3015
3087
|
if (!e) return null;
|
|
3016
3088
|
let i = 8 - n.length - e.length;
|
|
3017
3089
|
if (i < 1) return null;
|
|
@@ -3026,25 +3098,25 @@ function wr(e) {
|
|
|
3026
3098
|
for (let e of r) i.push(e >> 8 & 255, e & 255);
|
|
3027
3099
|
return i;
|
|
3028
3100
|
}
|
|
3029
|
-
function
|
|
3101
|
+
function Fr(e) {
|
|
3030
3102
|
let t = e.trim();
|
|
3031
3103
|
t.startsWith("[") && t.endsWith("]") && (t = t.slice(1, -1));
|
|
3032
3104
|
let n = t.indexOf("%");
|
|
3033
3105
|
if (n !== -1 && (t = t.slice(0, n)), t === "") return null;
|
|
3034
|
-
if (!t.includes(":")) return
|
|
3035
|
-
let r =
|
|
3106
|
+
if (!t.includes(":")) return Mr(t);
|
|
3107
|
+
let r = Pr(t);
|
|
3036
3108
|
return r ? r.slice(0, 10).every((e) => e === 0) && r[10] === 255 && r[11] === 255 ? r.slice(12) : r : null;
|
|
3037
3109
|
}
|
|
3038
|
-
function
|
|
3039
|
-
let [t, n] = e.split("/"), r =
|
|
3110
|
+
function Ir(e) {
|
|
3111
|
+
let [t, n] = e.split("/"), r = Fr(t ?? ""), i = Number(n);
|
|
3040
3112
|
if (!r || !Number.isInteger(i)) throw Error(`Invalid Cloudflare CIDR: ${e}`);
|
|
3041
3113
|
return {
|
|
3042
3114
|
bytes: r,
|
|
3043
3115
|
prefixBits: i
|
|
3044
3116
|
};
|
|
3045
3117
|
}
|
|
3046
|
-
var
|
|
3047
|
-
function
|
|
3118
|
+
var Lr = jr.map(Ir);
|
|
3119
|
+
function Rr(e, t) {
|
|
3048
3120
|
if (e.length !== t.bytes.length) return !1;
|
|
3049
3121
|
let n = t.prefixBits >> 3;
|
|
3050
3122
|
for (let r = 0; r < n; r++) if (e[r] !== t.bytes[r]) return !1;
|
|
@@ -3053,11 +3125,11 @@ function Or(e, t) {
|
|
|
3053
3125
|
let i = 255 << 8 - r & 255;
|
|
3054
3126
|
return (e[n] & i) === (t.bytes[n] & i);
|
|
3055
3127
|
}
|
|
3056
|
-
function
|
|
3057
|
-
let t =
|
|
3058
|
-
return t ?
|
|
3128
|
+
function zr(e) {
|
|
3129
|
+
let t = Fr(e);
|
|
3130
|
+
return t ? Lr.some((e) => Rr(t, e)) : !1;
|
|
3059
3131
|
}
|
|
3060
|
-
var
|
|
3132
|
+
var Br = G({
|
|
3061
3133
|
type: "forwarded_headers",
|
|
3062
3134
|
optionsSchema: e.object({
|
|
3063
3135
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -3068,46 +3140,46 @@ var Ar = K({
|
|
|
3068
3140
|
build(e) {
|
|
3069
3141
|
return async (t, n) => {
|
|
3070
3142
|
let r = new URL(t.req.url);
|
|
3071
|
-
|
|
3143
|
+
Sr(t, (n) => {
|
|
3072
3144
|
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);
|
|
3073
|
-
let i = n.get(e.client_ip_header), a = i && e.skip_cloudflare_client_ip &&
|
|
3145
|
+
let i = n.get(e.client_ip_header), a = i && e.skip_cloudflare_client_ip && zr(i) ? null : i, o = (n.get("x-forwarded-for") ?? "").split(",").map((e) => e.trim()).filter(Boolean), s = a ?? o[o.length - 1] ?? "127.0.0.1", c = o.length === 0 || o[o.length - 1] !== s, l = o.length ? c ? `${o.join(", ")}, ${s}` : o.join(", ") : s;
|
|
3074
3146
|
n.set("x-forwarded-for", l), e.set_x_real_ip && n.set("x-real-ip", s);
|
|
3075
3147
|
}), await n();
|
|
3076
3148
|
};
|
|
3077
3149
|
}
|
|
3078
|
-
}),
|
|
3079
|
-
function
|
|
3150
|
+
}), Vr = e.object({ upstream_host: e.string().optional() });
|
|
3151
|
+
function Hr(e) {
|
|
3080
3152
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3081
3153
|
}
|
|
3082
|
-
function
|
|
3154
|
+
function Ur(e) {
|
|
3083
3155
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
3084
3156
|
let t = [];
|
|
3085
3157
|
return e.forEach((e, n) => {
|
|
3086
3158
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
3087
3159
|
}), t;
|
|
3088
3160
|
}
|
|
3089
|
-
var
|
|
3161
|
+
var Wr = G({
|
|
3090
3162
|
type: "rewrite_cookies",
|
|
3091
|
-
optionsSchema:
|
|
3163
|
+
optionsSchema: Vr,
|
|
3092
3164
|
build(e) {
|
|
3093
3165
|
return async (t, n) => {
|
|
3094
3166
|
await n();
|
|
3095
3167
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
3096
3168
|
if (!i) return;
|
|
3097
|
-
let a =
|
|
3169
|
+
let a = Ur(t.res.headers);
|
|
3098
3170
|
if (a.length === 0) return;
|
|
3099
|
-
let o =
|
|
3100
|
-
|
|
3171
|
+
let o = Hr(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
3172
|
+
q(t), t.res.headers.delete("set-cookie");
|
|
3101
3173
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
3102
3174
|
};
|
|
3103
3175
|
}
|
|
3104
|
-
}),
|
|
3176
|
+
}), Gr = G({
|
|
3105
3177
|
type: "rewrite_location",
|
|
3106
3178
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
3107
3179
|
build(e) {
|
|
3108
3180
|
return async (t, n) => {
|
|
3109
3181
|
if (await n(), t.res.headers.has("x-authhero-preserve-location")) {
|
|
3110
|
-
|
|
3182
|
+
q(t), t.res.headers.delete(sr);
|
|
3111
3183
|
return;
|
|
3112
3184
|
}
|
|
3113
3185
|
let r = t.res.status;
|
|
@@ -3124,10 +3196,10 @@ var Pr = K({
|
|
|
3124
3196
|
}
|
|
3125
3197
|
if (o.origin !== a) return;
|
|
3126
3198
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
3127
|
-
|
|
3199
|
+
q(t), t.res.headers.set("location", c);
|
|
3128
3200
|
};
|
|
3129
3201
|
}
|
|
3130
|
-
}),
|
|
3202
|
+
}), Kr = new Set([
|
|
3131
3203
|
"connection",
|
|
3132
3204
|
"keep-alive",
|
|
3133
3205
|
"proxy-authenticate",
|
|
@@ -3136,32 +3208,32 @@ var Pr = K({
|
|
|
3136
3208
|
"trailers",
|
|
3137
3209
|
"transfer-encoding",
|
|
3138
3210
|
"upgrade"
|
|
3139
|
-
]),
|
|
3211
|
+
]), qr = 3e4, Jr = e.object({
|
|
3140
3212
|
upstream_url: e.string(),
|
|
3141
3213
|
preserve_host: e.boolean().default(!1),
|
|
3142
3214
|
timeout_ms: e.number().int().positive().optional()
|
|
3143
3215
|
});
|
|
3144
|
-
function
|
|
3216
|
+
function Yr(e, t) {
|
|
3145
3217
|
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
3146
3218
|
}
|
|
3147
|
-
function
|
|
3219
|
+
function Xr(e) {
|
|
3148
3220
|
return e !== "GET" && e !== "HEAD";
|
|
3149
3221
|
}
|
|
3150
|
-
var
|
|
3151
|
-
function
|
|
3222
|
+
var Zr = 128 * 1024;
|
|
3223
|
+
function Qr(e) {
|
|
3152
3224
|
let t = e.headers.get("content-length");
|
|
3153
3225
|
if (t === null) return null;
|
|
3154
3226
|
let n = Number(t);
|
|
3155
3227
|
return Number.isInteger(n) && n >= 0 ? n : null;
|
|
3156
3228
|
}
|
|
3157
|
-
async function
|
|
3229
|
+
async function $r(e, t) {
|
|
3158
3230
|
let n = e.getReader(), r = !1, i = setTimeout(() => {
|
|
3159
3231
|
r = !0, n.cancel().catch(() => {});
|
|
3160
3232
|
}, t), a = [], o = 0;
|
|
3161
3233
|
try {
|
|
3162
3234
|
for (;;) {
|
|
3163
3235
|
let { done: e, value: i } = await n.read();
|
|
3164
|
-
if (r) throw new
|
|
3236
|
+
if (r) throw new z(t, "Request body read");
|
|
3165
3237
|
if (e) break;
|
|
3166
3238
|
a.push(i), o += i.byteLength;
|
|
3167
3239
|
}
|
|
@@ -3172,8 +3244,8 @@ async function Ur(e, t) {
|
|
|
3172
3244
|
for (let e of a) s.set(e, c), c += e.byteLength;
|
|
3173
3245
|
return s.buffer;
|
|
3174
3246
|
}
|
|
3175
|
-
function
|
|
3176
|
-
return
|
|
3247
|
+
function ei(e) {
|
|
3248
|
+
return B(e) ? new Response("Request body timeout", {
|
|
3177
3249
|
status: 408,
|
|
3178
3250
|
headers: { "x-authhero-proxy-error": "request_body_timeout" }
|
|
3179
3251
|
}) : new Response("Bad request", {
|
|
@@ -3181,20 +3253,20 @@ function Wr(e) {
|
|
|
3181
3253
|
headers: { "x-authhero-proxy-error": "request_body_failed" }
|
|
3182
3254
|
});
|
|
3183
3255
|
}
|
|
3184
|
-
async function
|
|
3185
|
-
if (!
|
|
3186
|
-
let r =
|
|
3187
|
-
if (r === null || r >
|
|
3188
|
-
let i = await
|
|
3256
|
+
async function ti(e, t, n) {
|
|
3257
|
+
if (!Xr(e.method) || !e.body) return;
|
|
3258
|
+
let r = Qr(e);
|
|
3259
|
+
if (r === null || r > Zr) return e.body;
|
|
3260
|
+
let i = await $r(e.body, n);
|
|
3189
3261
|
return t.set("content-length", String(i.byteLength)), i;
|
|
3190
3262
|
}
|
|
3191
|
-
async function
|
|
3263
|
+
async function ni(e, t, n) {
|
|
3192
3264
|
let r = new URL(t.url), i = new URL(e.upstream_url);
|
|
3193
|
-
i.pathname =
|
|
3265
|
+
i.pathname = Yr(i.pathname, r.pathname), i.search = r.search;
|
|
3194
3266
|
let a = new Headers(t.headers);
|
|
3195
|
-
for (let e of
|
|
3267
|
+
for (let e of Kr) a.delete(e);
|
|
3196
3268
|
e.preserve_host || a.set("host", i.host), a.has("x-forwarded-host") || a.set("x-forwarded-host", r.host), a.has("x-forwarded-proto") || a.set("x-forwarded-proto", r.protocol.replace(":", ""));
|
|
3197
|
-
let o = await
|
|
3269
|
+
let o = await ti(t, a, n), s = {
|
|
3198
3270
|
method: t.method,
|
|
3199
3271
|
headers: a,
|
|
3200
3272
|
body: o,
|
|
@@ -3205,97 +3277,97 @@ async function Kr(e, t, n) {
|
|
|
3205
3277
|
init: s
|
|
3206
3278
|
};
|
|
3207
3279
|
}
|
|
3208
|
-
var
|
|
3280
|
+
var ri = G({
|
|
3209
3281
|
type: "http",
|
|
3210
|
-
optionsSchema:
|
|
3282
|
+
optionsSchema: Jr,
|
|
3211
3283
|
build(e) {
|
|
3212
|
-
let t = e.timeout_ms ??
|
|
3284
|
+
let t = e.timeout_ms ?? qr;
|
|
3213
3285
|
return async (n) => {
|
|
3214
|
-
let r =
|
|
3286
|
+
let r = K(n), i;
|
|
3215
3287
|
try {
|
|
3216
|
-
i = await
|
|
3288
|
+
i = await ni(e, r, t);
|
|
3217
3289
|
} catch (e) {
|
|
3218
|
-
return
|
|
3290
|
+
return ei(e);
|
|
3219
3291
|
}
|
|
3220
3292
|
let { target: a, init: o } = i;
|
|
3221
3293
|
n.set("__proxy_upstream_host__", a.hostname), n.set("__proxy_upstream_origin__", `${a.protocol}//${a.host}`);
|
|
3222
3294
|
try {
|
|
3223
|
-
return await
|
|
3295
|
+
return await V(t, (e) => fetch(a.toString(), {
|
|
3224
3296
|
...o,
|
|
3225
3297
|
signal: e
|
|
3226
3298
|
}));
|
|
3227
3299
|
} catch (e) {
|
|
3228
|
-
return
|
|
3300
|
+
return B(e) ? n.text("Upstream timeout", 504, { "x-authhero-proxy-error": "http_timeout" }) : n.text("Bad gateway", 502, { "x-authhero-proxy-error": "http_failed" });
|
|
3229
3301
|
}
|
|
3230
3302
|
};
|
|
3231
3303
|
}
|
|
3232
|
-
}),
|
|
3304
|
+
}), ii = 3e4, ai = e.object({
|
|
3233
3305
|
binding: e.string(),
|
|
3234
3306
|
upstream_url: e.string().optional(),
|
|
3235
3307
|
preserve_host: e.boolean().default(!0),
|
|
3236
3308
|
timeout_ms: e.number().int().positive().optional()
|
|
3237
3309
|
});
|
|
3238
|
-
function
|
|
3310
|
+
function oi(e) {
|
|
3239
3311
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
3240
3312
|
}
|
|
3241
|
-
var
|
|
3313
|
+
var si = G({
|
|
3242
3314
|
type: "service_binding",
|
|
3243
|
-
optionsSchema:
|
|
3315
|
+
optionsSchema: ai,
|
|
3244
3316
|
build(e, t) {
|
|
3245
3317
|
let n = t.bindings[e.binding];
|
|
3246
|
-
if (!
|
|
3247
|
-
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ??
|
|
3318
|
+
if (!oi(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
3319
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ?? ii;
|
|
3248
3320
|
return async (t) => {
|
|
3249
|
-
let a =
|
|
3321
|
+
let a = K(t), o;
|
|
3250
3322
|
try {
|
|
3251
|
-
o = await
|
|
3323
|
+
o = await ni({
|
|
3252
3324
|
upstream_url: r,
|
|
3253
3325
|
preserve_host: e.preserve_host
|
|
3254
3326
|
}, a, i);
|
|
3255
3327
|
} catch (e) {
|
|
3256
|
-
return
|
|
3328
|
+
return ei(e);
|
|
3257
3329
|
}
|
|
3258
3330
|
let { target: s, init: c } = o;
|
|
3259
3331
|
t.set("__proxy_upstream_host__", s.hostname), t.set("__proxy_upstream_origin__", `${s.protocol}//${s.host}`);
|
|
3260
3332
|
try {
|
|
3261
|
-
return await
|
|
3333
|
+
return await V(i, async (e) => n.fetch(new Request(s.toString(), {
|
|
3262
3334
|
...c,
|
|
3263
3335
|
signal: e
|
|
3264
3336
|
})));
|
|
3265
3337
|
} catch (e) {
|
|
3266
|
-
return
|
|
3338
|
+
return B(e) ? t.text(`service_binding timed out after ${i}ms`, 504, { "x-authhero-proxy-error": "service_binding_timeout" }) : t.text("Bad gateway", 502, { "x-authhero-proxy-error": "service_binding_failed" });
|
|
3267
3339
|
}
|
|
3268
3340
|
};
|
|
3269
3341
|
}
|
|
3270
|
-
}),
|
|
3342
|
+
}), ci = 3e4, li = e.object({
|
|
3271
3343
|
binding: e.string(),
|
|
3272
3344
|
script_name: e.string(),
|
|
3273
3345
|
cpu_ms: e.number().int().positive().optional(),
|
|
3274
3346
|
subrequests: e.number().int().positive().optional(),
|
|
3275
3347
|
timeout_ms: e.number().int().positive().optional()
|
|
3276
3348
|
});
|
|
3277
|
-
function
|
|
3349
|
+
function ui(e) {
|
|
3278
3350
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
3279
3351
|
}
|
|
3280
|
-
var
|
|
3281
|
-
function
|
|
3282
|
-
return
|
|
3352
|
+
var J = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
3353
|
+
function di(e) {
|
|
3354
|
+
return J.lastIndex = 0, J.test(e);
|
|
3283
3355
|
}
|
|
3284
|
-
var
|
|
3356
|
+
var fi = G({
|
|
3285
3357
|
type: "dispatch_namespace",
|
|
3286
|
-
optionsSchema:
|
|
3358
|
+
optionsSchema: li,
|
|
3287
3359
|
build(e, t) {
|
|
3288
3360
|
let n = t.bindings[e.binding];
|
|
3289
|
-
if (!
|
|
3290
|
-
let r =
|
|
3361
|
+
if (!ui(n)) throw Error(`Dispatch namespace binding "${e.binding}" is not configured or does not expose .get()`);
|
|
3362
|
+
let r = di(e.script_name), i = e.timeout_ms ?? ci, a = e.cpu_ms || e.subrequests ? { limits: {
|
|
3291
3363
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
3292
3364
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
3293
3365
|
} } : void 0;
|
|
3294
3366
|
return async (t) => {
|
|
3295
3367
|
let o = e.script_name;
|
|
3296
3368
|
if (r) {
|
|
3297
|
-
let n =
|
|
3298
|
-
if (o = o.replace(
|
|
3369
|
+
let n = yr(t), r = br(t), i = xr(t), a = t.req.header("host") ?? t.req.header("x-forwarded-host") ?? "";
|
|
3370
|
+
if (o = o.replace(J, (e, t) => {
|
|
3299
3371
|
switch (t) {
|
|
3300
3372
|
case "tenant_id": return n ?? "";
|
|
3301
3373
|
case "custom_domain_id": return r ?? "";
|
|
@@ -3305,19 +3377,19 @@ var ni = K({
|
|
|
3305
3377
|
}
|
|
3306
3378
|
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
3307
3379
|
}
|
|
3308
|
-
let s =
|
|
3380
|
+
let s = K(t);
|
|
3309
3381
|
try {
|
|
3310
3382
|
let e = n.get(o, void 0, a);
|
|
3311
|
-
return await
|
|
3383
|
+
return await V(i, async (t) => {
|
|
3312
3384
|
let n = new Request(s, { signal: t });
|
|
3313
3385
|
return e.fetch(n);
|
|
3314
3386
|
});
|
|
3315
3387
|
} catch (e) {
|
|
3316
|
-
return
|
|
3388
|
+
return B(e) ? t.text(`dispatch_namespace timed out after ${i}ms`, 504, { "x-authhero-proxy-error": "dispatch_namespace_timeout" }) : t.text("Bad gateway", 502, { "x-authhero-proxy-error": "dispatch_namespace_failed" });
|
|
3317
3389
|
}
|
|
3318
3390
|
};
|
|
3319
3391
|
}
|
|
3320
|
-
}),
|
|
3392
|
+
}), pi = G({
|
|
3321
3393
|
type: "redirect",
|
|
3322
3394
|
optionsSchema: e.object({
|
|
3323
3395
|
upstream_url: e.string().refine((e) => {
|
|
@@ -3346,7 +3418,7 @@ var ni = K({
|
|
|
3346
3418
|
});
|
|
3347
3419
|
};
|
|
3348
3420
|
}
|
|
3349
|
-
}),
|
|
3421
|
+
}), mi = G({
|
|
3350
3422
|
type: "static",
|
|
3351
3423
|
optionsSchema: e.object({
|
|
3352
3424
|
status: e.number().int().default(200),
|
|
@@ -3366,15 +3438,15 @@ var ni = K({
|
|
|
3366
3438
|
});
|
|
3367
3439
|
//#endregion
|
|
3368
3440
|
//#region src/data-plane/handlers/index.ts
|
|
3369
|
-
function
|
|
3370
|
-
e.add(
|
|
3441
|
+
function hi(e) {
|
|
3442
|
+
e.add(Tr).add(Or).add(kr).add(Ar).add(Br).add(Wr).add(Gr).add(ri).add(si).add(fi).add(pi).add(mi);
|
|
3371
3443
|
}
|
|
3372
3444
|
//#endregion
|
|
3373
3445
|
//#region src/data-plane/matcher.ts
|
|
3374
|
-
function
|
|
3446
|
+
function gi(e) {
|
|
3375
3447
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
3376
3448
|
}
|
|
3377
|
-
function
|
|
3449
|
+
function _i(e, t) {
|
|
3378
3450
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
3379
3451
|
if (n === r) return !0;
|
|
3380
3452
|
if (n.startsWith("*.")) {
|
|
@@ -3383,13 +3455,13 @@ function si(e, t) {
|
|
|
3383
3455
|
}
|
|
3384
3456
|
return !1;
|
|
3385
3457
|
}
|
|
3386
|
-
function
|
|
3387
|
-
return !e || e.length === 0 ? !0 : e.some((e) =>
|
|
3458
|
+
function vi(e, t) {
|
|
3459
|
+
return !e || e.length === 0 ? !0 : e.some((e) => _i(e, t));
|
|
3388
3460
|
}
|
|
3389
|
-
function
|
|
3461
|
+
function yi(e) {
|
|
3390
3462
|
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;
|
|
3391
3463
|
return async (e, i) => {
|
|
3392
|
-
if (r && !
|
|
3464
|
+
if (r && !vi(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
3393
3465
|
for (let [n, r] of t) {
|
|
3394
3466
|
let t = e.req.header(n);
|
|
3395
3467
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -3406,17 +3478,17 @@ function li(e) {
|
|
|
3406
3478
|
}
|
|
3407
3479
|
//#endregion
|
|
3408
3480
|
//#region src/data-plane/compile.ts
|
|
3409
|
-
var
|
|
3410
|
-
function
|
|
3481
|
+
var bi = "forwarded_headers";
|
|
3482
|
+
function xi(e) {
|
|
3411
3483
|
return e.some((e) => e.type === "forwarded_headers") ? [...e] : [{
|
|
3412
|
-
type:
|
|
3484
|
+
type: bi,
|
|
3413
3485
|
options: {}
|
|
3414
3486
|
}, ...e];
|
|
3415
3487
|
}
|
|
3416
|
-
function
|
|
3417
|
-
return e.has("forwarded_headers") ?
|
|
3488
|
+
function Y(e, t) {
|
|
3489
|
+
return e.has("forwarded_headers") ? xi(t) : [...t];
|
|
3418
3490
|
}
|
|
3419
|
-
var
|
|
3491
|
+
var X = [
|
|
3420
3492
|
"GET",
|
|
3421
3493
|
"POST",
|
|
3422
3494
|
"PUT",
|
|
@@ -3428,39 +3500,39 @@ var fi = [
|
|
|
3428
3500
|
function Z(e, n, r, i) {
|
|
3429
3501
|
let a = new t();
|
|
3430
3502
|
r && a.use("*", async (e, t) => {
|
|
3431
|
-
|
|
3503
|
+
vr(e, r), await t();
|
|
3432
3504
|
});
|
|
3433
|
-
let o =
|
|
3505
|
+
let o = gi(e);
|
|
3434
3506
|
for (let e of o) {
|
|
3435
3507
|
let t = [];
|
|
3436
|
-
t.push(
|
|
3437
|
-
for (let r of
|
|
3438
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3508
|
+
t.push(yi(e.match));
|
|
3509
|
+
for (let r of Y(n, e.handlers)) t.push(n.build(r.type, r.options));
|
|
3510
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : X, i = e.match.path || "/*";
|
|
3439
3511
|
a.on(r, [i], ...t);
|
|
3440
3512
|
}
|
|
3441
|
-
return i && i.length > 0 ? a.on(
|
|
3442
|
-
let n =
|
|
3513
|
+
return i && i.length > 0 ? a.on(X, ["*"], ...i) : a.all("*", (e) => e.text("No matching route", 404)), a.onError((e, t) => {
|
|
3514
|
+
let n = B(e);
|
|
3443
3515
|
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3444
3516
|
}), a;
|
|
3445
3517
|
}
|
|
3446
3518
|
//#endregion
|
|
3447
3519
|
//#region src/data-plane/router.ts
|
|
3448
|
-
var
|
|
3449
|
-
function
|
|
3450
|
-
return e.resolver ? e.resolver : e.cache ?
|
|
3520
|
+
var Si = 1e4;
|
|
3521
|
+
function Ci(e) {
|
|
3522
|
+
return e.resolver ? e.resolver : e.cache ? W(e.data, e.cache) : W(e.data, e.cacheTtlMs ?? 3e4);
|
|
3451
3523
|
}
|
|
3452
|
-
function
|
|
3524
|
+
function wi(e) {
|
|
3453
3525
|
if (e.registry) return e.registry;
|
|
3454
|
-
let t = new
|
|
3455
|
-
return
|
|
3526
|
+
let t = new dr(e.bindings ?? {});
|
|
3527
|
+
return hi(t), t;
|
|
3456
3528
|
}
|
|
3457
3529
|
function Q(e) {
|
|
3458
|
-
let t =
|
|
3530
|
+
let t = Ci(e), n = wi(e), r = /* @__PURE__ */ new WeakMap(), i = e.resolveHostTimeoutMs ?? Si, a = e.defaultHandlers && e.defaultHandlers.length > 0 ? Y(n, e.defaultHandlers).map((e) => n.build(e.type, e.options)) : void 0, o = a ? Z([], n, void 0, a) : void 0;
|
|
3459
3531
|
return async (e) => {
|
|
3460
3532
|
let s = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3461
3533
|
if (!s) return e.text("Missing host", 400);
|
|
3462
3534
|
try {
|
|
3463
|
-
let c = await
|
|
3535
|
+
let c = await H(i, "resolveHost", void 0, (e) => t.resolveHost(s, { signal: e }));
|
|
3464
3536
|
if (!c) return o ? await o.fetch(e.req.raw) : e.text("Unknown host", 404);
|
|
3465
3537
|
let l = r.get(c);
|
|
3466
3538
|
return l || (l = Z(c.routes, n, {
|
|
@@ -3469,17 +3541,17 @@ function Q(e) {
|
|
|
3469
3541
|
domain: c.domain
|
|
3470
3542
|
}, a), r.set(c, l)), await l.fetch(e.req.raw);
|
|
3471
3543
|
} catch (t) {
|
|
3472
|
-
return o ? await o.fetch(e.req.raw) :
|
|
3544
|
+
return o ? await o.fetch(e.req.raw) : B(t) ? e.text(`Resolve host timed out after ${i}ms`, 504, { "x-authhero-proxy-error": "resolve_host_timeout" }) : e.text("Bad gateway", 502, { "x-authhero-proxy-error": "data_plane_error" });
|
|
3473
3545
|
}
|
|
3474
3546
|
};
|
|
3475
3547
|
}
|
|
3476
|
-
function
|
|
3548
|
+
function Ti(e) {
|
|
3477
3549
|
let n = new t();
|
|
3478
3550
|
return n.all("*", Q(e)), n;
|
|
3479
3551
|
}
|
|
3480
3552
|
//#endregion
|
|
3481
3553
|
//#region src/app.ts
|
|
3482
|
-
function
|
|
3554
|
+
function Ei(e) {
|
|
3483
3555
|
let n = new t();
|
|
3484
3556
|
return n.all("*", Q({
|
|
3485
3557
|
data: e.data,
|
|
@@ -3491,108 +3563,107 @@ function _i(e) {
|
|
|
3491
3563
|
resolveHostTimeoutMs: e.resolveHostTimeoutMs,
|
|
3492
3564
|
defaultHandlers: e.defaultHandlers
|
|
3493
3565
|
})), n.onError((e, t) => {
|
|
3494
|
-
let n =
|
|
3566
|
+
let n = B(e);
|
|
3495
3567
|
return t.text(n ? "Proxy timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "proxy_timeout" : "proxy_error" });
|
|
3496
3568
|
}), n;
|
|
3497
3569
|
}
|
|
3498
3570
|
//#endregion
|
|
3499
3571
|
//#region src/data-plane/cache-api-cache.ts
|
|
3500
|
-
var
|
|
3501
|
-
function
|
|
3572
|
+
var Di = 1e3, Oi = 1e3;
|
|
3573
|
+
function ki(e, t) {
|
|
3502
3574
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3503
3575
|
}
|
|
3504
|
-
function
|
|
3576
|
+
function Ai() {
|
|
3505
3577
|
return globalThis.caches?.default;
|
|
3506
3578
|
}
|
|
3507
|
-
function
|
|
3508
|
-
let t = e.cache ??
|
|
3579
|
+
function ji(e) {
|
|
3580
|
+
let t = e.cache ?? Ai();
|
|
3509
3581
|
if (!t) return e.upstream;
|
|
3510
|
-
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ??
|
|
3582
|
+
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ?? Di, c = e.cacheWriteTimeoutMs ?? Oi;
|
|
3511
3583
|
async function l(e) {
|
|
3512
3584
|
try {
|
|
3513
|
-
return await
|
|
3585
|
+
return await U(Promise.resolve(n.match(e)), s, "cache.match");
|
|
3514
3586
|
} catch {
|
|
3515
3587
|
return;
|
|
3516
3588
|
}
|
|
3517
3589
|
}
|
|
3518
|
-
return { async resolveHost(t) {
|
|
3519
|
-
let
|
|
3520
|
-
if (
|
|
3521
|
-
return (await
|
|
3590
|
+
return { async resolveHost(t, s) {
|
|
3591
|
+
let u = ki(r, t), d = await l(u);
|
|
3592
|
+
if (d) try {
|
|
3593
|
+
return (await d.json()).value;
|
|
3522
3594
|
} catch {}
|
|
3523
|
-
let
|
|
3595
|
+
let f = await e.upstream.resolveHost(t, s), p = f === null ? a : i, m = new Response(JSON.stringify({ value: f }), { headers: {
|
|
3524
3596
|
"content-type": "application/json",
|
|
3525
|
-
"cache-control": `public, max-age=${
|
|
3526
|
-
} }),
|
|
3527
|
-
return o ? o(
|
|
3597
|
+
"cache-control": `public, max-age=${p}`
|
|
3598
|
+
} }), h = U(Promise.resolve(n.put(u, m)), c, "cache.put").catch(() => void 0);
|
|
3599
|
+
return o ? o(h) : await h, f;
|
|
3528
3600
|
} };
|
|
3529
3601
|
}
|
|
3530
|
-
function
|
|
3531
|
-
return
|
|
3602
|
+
function Mi(e, t) {
|
|
3603
|
+
return ki(e, t);
|
|
3532
3604
|
}
|
|
3533
3605
|
//#endregion
|
|
3534
3606
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3535
|
-
var
|
|
3536
|
-
function
|
|
3537
|
-
let { upstream: t, cache: n, freshTtlMs: r, staleTtlMs: i = 0, staleIfErrorTtlMs: a = 0, negativeTtlMs: o = r, keyPrefix: s = "authhero-proxy-host", waitUntil: c, cacheReadTimeoutMs: l =
|
|
3607
|
+
var Ni = 1e3, Pi = 1e3, Fi = 5e3;
|
|
3608
|
+
function Ii(e) {
|
|
3609
|
+
let { upstream: t, cache: n, freshTtlMs: r, staleTtlMs: i = 0, staleIfErrorTtlMs: a = 0, negativeTtlMs: o = r, keyPrefix: s = "authhero-proxy-host", waitUntil: c, cacheReadTimeoutMs: l = Ni, cacheWriteTimeoutMs: u = Pi, upstreamTimeoutMs: d = Fi } = e, f = d > 0 ? d : 1e4, p = /* @__PURE__ */ new Map();
|
|
3538
3610
|
function m(e) {
|
|
3539
3611
|
return `${s}:${e.toLowerCase()}`;
|
|
3540
3612
|
}
|
|
3541
3613
|
async function h(e) {
|
|
3542
3614
|
try {
|
|
3543
|
-
return await
|
|
3615
|
+
return await U(n.get(e), l, "cache.get") ?? null;
|
|
3544
3616
|
} catch {
|
|
3545
3617
|
return null;
|
|
3546
3618
|
}
|
|
3547
3619
|
}
|
|
3548
3620
|
function g(e, t, r) {
|
|
3549
|
-
let i =
|
|
3621
|
+
let i = U(Promise.resolve().then(() => n.set(e, t, r)), u, "cache.set").catch(() => void 0);
|
|
3550
3622
|
return c ? (c(i), Promise.resolve()) : i;
|
|
3551
3623
|
}
|
|
3552
3624
|
function _(e, t) {
|
|
3553
3625
|
let n = p.get(e);
|
|
3554
3626
|
return n === void 0 ? !1 : t - n < f ? !0 : (p.delete(e), !1);
|
|
3555
3627
|
}
|
|
3556
|
-
function
|
|
3557
|
-
|
|
3558
|
-
return d > 0 ? W(n, d, "resolveHost") : n;
|
|
3628
|
+
function ee(e, n) {
|
|
3629
|
+
return d > 0 ? H(d, "resolveHost", n, (n) => t.resolveHost(e, { signal: n })) : t.resolveHost(e, { signal: n });
|
|
3559
3630
|
}
|
|
3560
|
-
async function
|
|
3631
|
+
async function v(e, t) {
|
|
3561
3632
|
return p.set(e, Date.now()), (async () => {
|
|
3562
3633
|
try {
|
|
3563
|
-
let
|
|
3564
|
-
value:
|
|
3565
|
-
freshUntilMs:
|
|
3566
|
-
staleUntilMs:
|
|
3567
|
-
staleIfErrorUntilMs:
|
|
3568
|
-
},
|
|
3569
|
-
return await g(m(e),
|
|
3634
|
+
let n = await ee(e, t), s = Date.now(), c = n === null ? o : r, l = n === null ? 0 : i, u = n === null ? 0 : a, d = {
|
|
3635
|
+
value: n,
|
|
3636
|
+
freshUntilMs: s + c,
|
|
3637
|
+
staleUntilMs: s + c + l,
|
|
3638
|
+
staleIfErrorUntilMs: s + c + l + u
|
|
3639
|
+
}, f = Math.max(1, Math.ceil((c + l + u) / 1e3));
|
|
3640
|
+
return await g(m(e), d, f), n;
|
|
3570
3641
|
} finally {
|
|
3571
3642
|
p.delete(e);
|
|
3572
3643
|
}
|
|
3573
3644
|
})();
|
|
3574
3645
|
}
|
|
3575
|
-
return { async resolveHost(e) {
|
|
3576
|
-
let
|
|
3577
|
-
if (
|
|
3578
|
-
if (
|
|
3579
|
-
if (
|
|
3580
|
-
if (!_(e,
|
|
3581
|
-
let t =
|
|
3646
|
+
return { async resolveHost(e, t) {
|
|
3647
|
+
let n = await h(m(e)), r = Date.now();
|
|
3648
|
+
if (n && typeof n.freshUntilMs == "number") {
|
|
3649
|
+
if (n.freshUntilMs > r) return n.value;
|
|
3650
|
+
if (n.staleUntilMs > r) {
|
|
3651
|
+
if (!_(e, r)) {
|
|
3652
|
+
let t = v(e).catch(() => void 0);
|
|
3582
3653
|
c && c(t);
|
|
3583
3654
|
}
|
|
3584
|
-
return
|
|
3655
|
+
return n.value;
|
|
3585
3656
|
}
|
|
3586
3657
|
}
|
|
3587
3658
|
try {
|
|
3588
|
-
return await
|
|
3659
|
+
return await v(e, t?.signal);
|
|
3589
3660
|
} catch (e) {
|
|
3590
|
-
if (
|
|
3661
|
+
if (n && (n.staleIfErrorUntilMs ?? n.staleUntilMs) > r) return n.value;
|
|
3591
3662
|
throw e;
|
|
3592
3663
|
}
|
|
3593
3664
|
} };
|
|
3594
3665
|
}
|
|
3595
|
-
function
|
|
3666
|
+
function Li(e, t) {
|
|
3596
3667
|
return `${e}:${t.toLowerCase()}`;
|
|
3597
3668
|
}
|
|
3598
3669
|
//#endregion
|
|
@@ -3600,7 +3671,7 @@ function Oi(e, t) {
|
|
|
3600
3671
|
function $() {
|
|
3601
3672
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3602
3673
|
}
|
|
3603
|
-
function
|
|
3674
|
+
function Ri(e, t, n, r, i, a) {
|
|
3604
3675
|
return {
|
|
3605
3676
|
id: e.id ?? `${n}:${t}`,
|
|
3606
3677
|
tenant_id: r,
|
|
@@ -3615,10 +3686,10 @@ function ki(e, t, n, r, i, a) {
|
|
|
3615
3686
|
updated_at: e.updated_at ?? a
|
|
3616
3687
|
};
|
|
3617
3688
|
}
|
|
3618
|
-
function
|
|
3689
|
+
function zi(e) {
|
|
3619
3690
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3620
3691
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
3621
|
-
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) =>
|
|
3692
|
+
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) => Ri(n, r, e, s, c, t)).sort((e, t) => e.priority - t.priority);
|
|
3622
3693
|
r.set(e, {
|
|
3623
3694
|
tenant_id: s,
|
|
3624
3695
|
custom_domain_id: c,
|
|
@@ -3662,7 +3733,7 @@ function Ai(e) {
|
|
|
3662
3733
|
}
|
|
3663
3734
|
};
|
|
3664
3735
|
}
|
|
3665
|
-
function
|
|
3736
|
+
function Bi(e, t = {}) {
|
|
3666
3737
|
return {
|
|
3667
3738
|
priority: t.priority,
|
|
3668
3739
|
match: { path: t.path ?? "/*" },
|
|
@@ -3677,10 +3748,10 @@ function ji(e, t = {}) {
|
|
|
3677
3748
|
}
|
|
3678
3749
|
//#endregion
|
|
3679
3750
|
//#region src/constants.ts
|
|
3680
|
-
var
|
|
3751
|
+
var Vi = "proxy:resolve_host";
|
|
3681
3752
|
//#endregion
|
|
3682
3753
|
//#region src/http-adapter/index.ts
|
|
3683
|
-
function
|
|
3754
|
+
function Hi() {
|
|
3684
3755
|
let e = () => {
|
|
3685
3756
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3686
3757
|
};
|
|
@@ -3702,19 +3773,19 @@ function Ni() {
|
|
|
3702
3773
|
}
|
|
3703
3774
|
};
|
|
3704
3775
|
}
|
|
3705
|
-
function
|
|
3776
|
+
function Ui(e) {
|
|
3706
3777
|
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.scope ?? "proxy:resolve_host", o = e.tokenRefreshSkewSeconds ?? 60, s = e.timeoutMs ?? 2500;
|
|
3707
|
-
function c(e) {
|
|
3708
|
-
let
|
|
3709
|
-
|
|
3710
|
-
|
|
3778
|
+
function c(e, t) {
|
|
3779
|
+
let n = new AbortController(), r = cr([e, n.signal]) ?? n.signal, i, a = new Promise((e, t) => {
|
|
3780
|
+
i = setTimeout(() => {
|
|
3781
|
+
n.abort(), t(new z(s, "control plane"));
|
|
3711
3782
|
}, s);
|
|
3712
3783
|
});
|
|
3713
|
-
return Promise.race([
|
|
3784
|
+
return Promise.race([t(r), a]).finally(() => clearTimeout(i));
|
|
3714
3785
|
}
|
|
3715
3786
|
let l = null;
|
|
3716
|
-
async function u() {
|
|
3717
|
-
let
|
|
3787
|
+
async function u(r) {
|
|
3788
|
+
let s = await c(r, async (r) => {
|
|
3718
3789
|
let o = await t(`${n}/oauth/token`, {
|
|
3719
3790
|
method: "POST",
|
|
3720
3791
|
headers: { "content-type": "application/json" },
|
|
@@ -3729,22 +3800,22 @@ function Pi(e) {
|
|
|
3729
3800
|
});
|
|
3730
3801
|
if (!o.ok) throw Error(`Proxy adapter token request failed: ${o.status} ${await o.text().catch(() => "")}`);
|
|
3731
3802
|
return await o.json();
|
|
3732
|
-
}),
|
|
3803
|
+
}), u = s.expires_in ?? 3600;
|
|
3733
3804
|
return l = {
|
|
3734
|
-
value:
|
|
3735
|
-
expires_at: Date.now() + (
|
|
3736
|
-
},
|
|
3805
|
+
value: s.access_token,
|
|
3806
|
+
expires_at: Date.now() + (u - o) * 1e3
|
|
3807
|
+
}, s.access_token;
|
|
3737
3808
|
}
|
|
3738
|
-
async function d() {
|
|
3739
|
-
return l && l.expires_at > Date.now() ? l.value : u();
|
|
3809
|
+
async function d(e) {
|
|
3810
|
+
return l && l.expires_at > Date.now() ? l.value : u(e);
|
|
3740
3811
|
}
|
|
3741
3812
|
return {
|
|
3742
|
-
proxyRoutes:
|
|
3743
|
-
async resolveHost(e) {
|
|
3744
|
-
let i = await d(),
|
|
3745
|
-
return c(async (e) => {
|
|
3746
|
-
let n = await t(
|
|
3747
|
-
headers: { authorization: `Bearer ${
|
|
3813
|
+
proxyRoutes: Hi(),
|
|
3814
|
+
async resolveHost(e, i) {
|
|
3815
|
+
let a = i?.signal, o = await d(a), s = `${n}${r}${encodeURIComponent(e.toLowerCase())}`;
|
|
3816
|
+
return c(a, async (e) => {
|
|
3817
|
+
let n = await t(s, {
|
|
3818
|
+
headers: { authorization: `Bearer ${o}` },
|
|
3748
3819
|
signal: e
|
|
3749
3820
|
});
|
|
3750
3821
|
if (n.status === 404) return null;
|
|
@@ -3756,7 +3827,7 @@ function Pi(e) {
|
|
|
3756
3827
|
}
|
|
3757
3828
|
//#endregion
|
|
3758
3829
|
//#region src/http-adapter/service-binding-fetch.ts
|
|
3759
|
-
function
|
|
3830
|
+
function Wi(e) {
|
|
3760
3831
|
return (t, n) => {
|
|
3761
3832
|
let r = t instanceof Request && n === void 0 ? t : new Request(t, n);
|
|
3762
3833
|
return e.fetch(r);
|
|
@@ -3764,11 +3835,11 @@ function Fi(e) {
|
|
|
3764
3835
|
}
|
|
3765
3836
|
//#endregion
|
|
3766
3837
|
//#region src/kv-adapter/index.ts
|
|
3767
|
-
var
|
|
3768
|
-
function
|
|
3838
|
+
var Gi = "authhero-proxy-host:";
|
|
3839
|
+
function Ki(e, t) {
|
|
3769
3840
|
return `${e}${t.toLowerCase()}`;
|
|
3770
3841
|
}
|
|
3771
|
-
function
|
|
3842
|
+
function qi() {
|
|
3772
3843
|
let e = () => {
|
|
3773
3844
|
throw Error("KV proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3774
3845
|
};
|
|
@@ -3790,15 +3861,15 @@ function Ri() {
|
|
|
3790
3861
|
}
|
|
3791
3862
|
};
|
|
3792
3863
|
}
|
|
3793
|
-
function
|
|
3794
|
-
let { kv: t, keyPrefix: n =
|
|
3864
|
+
function Ji(e) {
|
|
3865
|
+
let { kv: t, keyPrefix: n = Gi, timeoutMs: r } = e;
|
|
3795
3866
|
return {
|
|
3796
|
-
proxyRoutes:
|
|
3867
|
+
proxyRoutes: qi(),
|
|
3797
3868
|
async resolveHost(e) {
|
|
3798
|
-
let i =
|
|
3799
|
-
return (r && r > 0 ? await
|
|
3869
|
+
let i = Ki(n, e), a = t.get(i, "json");
|
|
3870
|
+
return (r && r > 0 ? await U(a, r, "kv.get") : await a) ?? null;
|
|
3800
3871
|
}
|
|
3801
3872
|
};
|
|
3802
3873
|
}
|
|
3803
3874
|
//#endregion
|
|
3804
|
-
export {
|
|
3875
|
+
export { Gi as DEFAULT_KV_HOST_KEY_PREFIX, bi as FORWARDED_HEADERS_HANDLER_TYPE, dr as HandlerRegistry, Vi as PROXY_RESOLVE_HOST_SCOPE, Or as basicAuthHandler, Li as buildCacheAdapterKey, Mi as buildCacheApiKey, Ki as buildKvHostKey, yi as buildMatchFilter, Ar as cacheHandler, Z as compileHostApp, Tr as corsHandler, Ii as createCacheAdapterHostCache, ji as createCacheApiHostCache, Ui as createHttpProxyAdapter, W as createInMemoryHostCache, Ji as createKvProxyAdapter, Ei as createProxyApp, Q as createProxyDataPlaneHandler, Ti as createProxyDataPlaneRouter, Wi as createServiceBindingFetch, zi as createStaticProxyAdapter, G as defineHandler, fi as dispatchNamespaceHandler, Br as forwardedHeadersHandler, Dn as handlerConfigSchema, kr as headersHandler, ri as httpHandler, Bi as httpRoute, zr as isCloudflareIp, En as matchSchema, vi as matchesAnyHost, _i as matchesHost, L as proxyRouteInsertSchema, On as proxyRouteSchema, kn as proxyRouteUpdateSchema, pi as redirectHandler, hi as registerBuiltinHandlers, Wr as rewriteCookiesHandler, Gr as rewriteLocationHandler, si as serviceBindingHandler, gi as sortRoutes, mi as staticHandler, xi as withForwardedHeaders, Y as withForwardedHeadersFor };
|