@authhero/proxy 0.11.0 → 0.11.2
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.mjs +557 -504
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- 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
|
-
}({}), Fe = /* @__PURE__ */ function(e) {
|
|
623
|
-
return e.QUERY = "query", e.FRAGMENT = "fragment", e.FORM_POST = "form_post", e.WEB_MESSAGE = "web_message", e.SAML_POST = "saml_post", e;
|
|
624
623
|
}({}), Ie = /* @__PURE__ */ function(e) {
|
|
624
|
+
return e.QUERY = "query", e.FRAGMENT = "fragment", e.FORM_POST = "form_post", e.WEB_MESSAGE = "web_message", e.SAML_POST = "saml_post", e;
|
|
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
631
|
})]).nullable(), Re = e.object({
|
|
631
|
-
userinfo: e.record(e.string(),
|
|
632
|
-
id_token: e.record(e.string(),
|
|
632
|
+
userinfo: e.record(e.string(), x).optional(),
|
|
633
|
+
id_token: e.record(e.string(), x).optional()
|
|
633
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,7 +643,7 @@ var Pe = /* @__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(),
|
|
@@ -679,7 +680,8 @@ var Be = 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" }),
|
|
@@ -835,8 +837,8 @@ var He = e.object({
|
|
|
835
837
|
strategy: e.string(),
|
|
836
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(),
|
|
@@ -922,7 +924,11 @@ var C = e.object({
|
|
|
922
924
|
})
|
|
923
925
|
}), Ze = w.extend({
|
|
924
926
|
type: e.literal("NEXT_BUTTON"),
|
|
925
|
-
config: e.object({
|
|
927
|
+
config: e.object({
|
|
928
|
+
text: e.string().optional(),
|
|
929
|
+
variant: e.enum(["primary", "secondary"]).optional(),
|
|
930
|
+
skip_validation: e.boolean().optional()
|
|
931
|
+
})
|
|
926
932
|
}), Qe = w.extend({
|
|
927
933
|
type: e.literal("PREVIOUS_BUTTON"),
|
|
928
934
|
config: e.object({ text: e.string().optional() })
|
|
@@ -1083,6 +1089,7 @@ var C = e.object({
|
|
|
1083
1089
|
name: e.string(),
|
|
1084
1090
|
strategy: e.string().optional(),
|
|
1085
1091
|
display_name: e.string().optional(),
|
|
1092
|
+
short_name: e.string().optional(),
|
|
1086
1093
|
icon_url: e.string().optional(),
|
|
1087
1094
|
href: e.string().optional(),
|
|
1088
1095
|
last_used: e.boolean().optional(),
|
|
@@ -1151,7 +1158,7 @@ var C = e.object({
|
|
|
1151
1158
|
_t,
|
|
1152
1159
|
vt,
|
|
1153
1160
|
bt
|
|
1154
|
-
]),
|
|
1161
|
+
]), wt = e.union([
|
|
1155
1162
|
xt,
|
|
1156
1163
|
St,
|
|
1157
1164
|
Ct
|
|
@@ -1181,22 +1188,22 @@ new Set([
|
|
|
1181
1188
|
visible: e.boolean().optional().default(!0),
|
|
1182
1189
|
customizations: e.record(e.string(), e.any()).optional()
|
|
1183
1190
|
});
|
|
1184
|
-
var
|
|
1191
|
+
var D = e.object({
|
|
1185
1192
|
x: e.number(),
|
|
1186
1193
|
y: e.number()
|
|
1187
|
-
}),
|
|
1194
|
+
}), Tt = e.object({
|
|
1188
1195
|
id: e.string(),
|
|
1189
1196
|
type: e.literal("FLOW"),
|
|
1190
|
-
coordinates:
|
|
1197
|
+
coordinates: D,
|
|
1191
1198
|
alias: e.string().min(1).max(150).optional(),
|
|
1192
1199
|
config: e.object({
|
|
1193
1200
|
flow_id: e.string().max(30),
|
|
1194
1201
|
next_node: e.string().optional()
|
|
1195
1202
|
})
|
|
1196
|
-
}),
|
|
1203
|
+
}), Et = e.object({
|
|
1197
1204
|
id: e.string(),
|
|
1198
1205
|
type: e.literal("ROUTER"),
|
|
1199
|
-
coordinates:
|
|
1206
|
+
coordinates: D,
|
|
1200
1207
|
alias: e.string().min(1).max(150),
|
|
1201
1208
|
config: e.object({
|
|
1202
1209
|
rules: e.array(e.object({
|
|
@@ -1207,20 +1214,20 @@ var O = e.object({
|
|
|
1207
1214
|
})),
|
|
1208
1215
|
fallback: e.string()
|
|
1209
1216
|
})
|
|
1210
|
-
}),
|
|
1217
|
+
}), Dt = e.object({
|
|
1211
1218
|
id: e.string(),
|
|
1212
1219
|
type: e.literal("STEP"),
|
|
1213
|
-
coordinates:
|
|
1220
|
+
coordinates: D,
|
|
1214
1221
|
alias: e.string().min(1).max(150).optional(),
|
|
1215
1222
|
config: e.object({
|
|
1216
|
-
components: e.array(
|
|
1223
|
+
components: e.array(wt),
|
|
1217
1224
|
next_node: e.string().optional()
|
|
1218
1225
|
})
|
|
1219
|
-
}),
|
|
1220
|
-
wt,
|
|
1226
|
+
}), Ot = e.discriminatedUnion("type", [
|
|
1221
1227
|
Tt,
|
|
1222
|
-
Et
|
|
1223
|
-
|
|
1228
|
+
Et,
|
|
1229
|
+
Dt
|
|
1230
|
+
]), kt = e.object({
|
|
1224
1231
|
name: e.string().openapi({ description: "The name of the form" }),
|
|
1225
1232
|
messages: e.object({
|
|
1226
1233
|
errors: e.record(e.string(), e.any()).optional(),
|
|
@@ -1231,14 +1238,14 @@ var O = e.object({
|
|
|
1231
1238
|
default: e.string().optional()
|
|
1232
1239
|
}).optional(),
|
|
1233
1240
|
translations: e.record(e.string(), e.any()).optional(),
|
|
1234
|
-
nodes: e.array(
|
|
1241
|
+
nodes: e.array(Ot).optional(),
|
|
1235
1242
|
start: e.object({
|
|
1236
1243
|
hidden_fields: e.array(e.object({
|
|
1237
1244
|
key: e.string(),
|
|
1238
1245
|
value: e.string()
|
|
1239
1246
|
})).optional(),
|
|
1240
1247
|
next_node: e.string().optional(),
|
|
1241
|
-
coordinates:
|
|
1248
|
+
coordinates: D.optional()
|
|
1242
1249
|
}).optional(),
|
|
1243
1250
|
ending: e.object({
|
|
1244
1251
|
redirection: e.object({
|
|
@@ -1246,7 +1253,7 @@ var O = e.object({
|
|
|
1246
1253
|
target: e.string().optional()
|
|
1247
1254
|
}).optional(),
|
|
1248
1255
|
after_submit: e.object({ flow_id: e.string().optional() }).optional(),
|
|
1249
|
-
coordinates:
|
|
1256
|
+
coordinates: D.optional(),
|
|
1250
1257
|
resume_flow: e.boolean().optional()
|
|
1251
1258
|
}).optional(),
|
|
1252
1259
|
style: e.object({ css: e.string().optional() }).optional(),
|
|
@@ -1255,8 +1262,8 @@ var O = e.object({
|
|
|
1255
1262
|
sdk_src: e.string().optional()
|
|
1256
1263
|
}).optional()
|
|
1257
1264
|
}).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
|
|
1258
|
-
n.extend(
|
|
1259
|
-
var
|
|
1265
|
+
n.extend(kt.shape).extend({ id: e.string() });
|
|
1266
|
+
var At = e.object({
|
|
1260
1267
|
id: e.number().optional(),
|
|
1261
1268
|
text: e.string(),
|
|
1262
1269
|
type: e.enum([
|
|
@@ -1265,7 +1272,7 @@ var kt = e.object({
|
|
|
1265
1272
|
"success",
|
|
1266
1273
|
"warning"
|
|
1267
1274
|
])
|
|
1268
|
-
}),
|
|
1275
|
+
}), jt = e.object({
|
|
1269
1276
|
id: e.string().optional(),
|
|
1270
1277
|
text: e.string(),
|
|
1271
1278
|
href: e.string(),
|
|
@@ -1277,12 +1284,12 @@ e.object({
|
|
|
1277
1284
|
method: e.enum(["POST", "GET"]),
|
|
1278
1285
|
title: e.string().optional(),
|
|
1279
1286
|
description: e.string().optional(),
|
|
1280
|
-
components: e.array(
|
|
1281
|
-
messages: e.array(
|
|
1282
|
-
links: e.array(
|
|
1287
|
+
components: e.array(wt),
|
|
1288
|
+
messages: e.array(At).optional(),
|
|
1289
|
+
links: e.array(jt).optional(),
|
|
1283
1290
|
footer: e.string().optional()
|
|
1284
1291
|
});
|
|
1285
|
-
var
|
|
1292
|
+
var O = e.enum([
|
|
1286
1293
|
"pre-user-registration",
|
|
1287
1294
|
"post-user-registration",
|
|
1288
1295
|
"post-user-login",
|
|
@@ -1290,95 +1297,95 @@ var k = e.enum([
|
|
|
1290
1297
|
"validate-registration-username",
|
|
1291
1298
|
"pre-user-deletion",
|
|
1292
1299
|
"post-user-deletion"
|
|
1293
|
-
]),
|
|
1300
|
+
]), k = e.enum(["post-user-login"]), A = e.enum([
|
|
1294
1301
|
"post-user-login",
|
|
1295
1302
|
"post-user-registration",
|
|
1296
1303
|
"post-user-update",
|
|
1297
1304
|
"credentials-exchange"
|
|
1298
|
-
]),
|
|
1305
|
+
]), j = e.enum([
|
|
1299
1306
|
"post-user-login",
|
|
1300
1307
|
"credentials-exchange",
|
|
1301
1308
|
"pre-user-registration",
|
|
1302
1309
|
"post-user-registration"
|
|
1303
|
-
]),
|
|
1304
|
-
k.options, A.options, j.options, M.options
|
|
1305
|
-
var
|
|
1310
|
+
]), M = e.enum(["post-user-login"]);
|
|
1311
|
+
O.options, k.options, A.options, j.options, M.options;
|
|
1312
|
+
var Mt = e.enum(["impersonate"]), Nt = e.enum([
|
|
1306
1313
|
"ensure-username",
|
|
1307
1314
|
"set-preferred-username",
|
|
1308
1315
|
"account-linking"
|
|
1309
|
-
]),
|
|
1316
|
+
]), N = {
|
|
1310
1317
|
enabled: e.boolean().default(!1),
|
|
1311
1318
|
synchronous: e.boolean().default(!1),
|
|
1312
1319
|
priority: e.number().optional(),
|
|
1313
1320
|
hook_id: e.string().optional(),
|
|
1314
1321
|
metadata: e.record(e.string(), e.unknown()).optional()
|
|
1315
|
-
},
|
|
1316
|
-
...
|
|
1317
|
-
trigger_id:
|
|
1322
|
+
}, Pt = e.object({
|
|
1323
|
+
...N,
|
|
1324
|
+
trigger_id: O,
|
|
1318
1325
|
url: e.string()
|
|
1319
|
-
}), Pt = e.object({
|
|
1320
|
-
...P,
|
|
1321
|
-
trigger_id: A,
|
|
1322
|
-
form_id: e.string()
|
|
1323
1326
|
}), Ft = e.object({
|
|
1324
|
-
...
|
|
1325
|
-
trigger_id:
|
|
1326
|
-
|
|
1327
|
+
...N,
|
|
1328
|
+
trigger_id: k,
|
|
1329
|
+
form_id: e.string()
|
|
1327
1330
|
}), It = e.object({
|
|
1328
|
-
...
|
|
1329
|
-
trigger_id:
|
|
1330
|
-
|
|
1331
|
+
...N,
|
|
1332
|
+
trigger_id: A,
|
|
1333
|
+
template_id: Nt
|
|
1331
1334
|
}), Lt = e.object({
|
|
1332
|
-
...
|
|
1333
|
-
trigger_id:
|
|
1334
|
-
|
|
1335
|
+
...N,
|
|
1336
|
+
trigger_id: j,
|
|
1337
|
+
code_id: e.string()
|
|
1338
|
+
}), Rt = e.object({
|
|
1339
|
+
...N,
|
|
1340
|
+
trigger_id: M,
|
|
1341
|
+
page_id: Mt,
|
|
1335
1342
|
permission_required: e.string().optional()
|
|
1336
1343
|
});
|
|
1337
1344
|
e.union([
|
|
1338
|
-
Nt,
|
|
1339
1345
|
Pt,
|
|
1340
1346
|
Ft,
|
|
1341
1347
|
It,
|
|
1342
|
-
Lt
|
|
1348
|
+
Lt,
|
|
1349
|
+
Rt
|
|
1343
1350
|
]);
|
|
1344
|
-
var
|
|
1345
|
-
...
|
|
1346
|
-
trigger_id:
|
|
1351
|
+
var zt = e.object({
|
|
1352
|
+
...N,
|
|
1353
|
+
trigger_id: O
|
|
1347
1354
|
}).extend(n.shape).extend({
|
|
1348
1355
|
hook_id: e.string(),
|
|
1349
1356
|
url: e.string()
|
|
1350
|
-
}),
|
|
1351
|
-
...
|
|
1352
|
-
trigger_id:
|
|
1357
|
+
}), Bt = e.object({
|
|
1358
|
+
...N,
|
|
1359
|
+
trigger_id: k
|
|
1353
1360
|
}).extend(n.shape).extend({
|
|
1354
1361
|
hook_id: e.string(),
|
|
1355
1362
|
form_id: e.string()
|
|
1356
|
-
}),
|
|
1357
|
-
...
|
|
1358
|
-
trigger_id:
|
|
1363
|
+
}), Vt = e.object({
|
|
1364
|
+
...N,
|
|
1365
|
+
trigger_id: A
|
|
1359
1366
|
}).extend(n.shape).extend({
|
|
1360
1367
|
hook_id: e.string(),
|
|
1361
|
-
template_id:
|
|
1362
|
-
}),
|
|
1363
|
-
...
|
|
1364
|
-
trigger_id:
|
|
1368
|
+
template_id: Nt
|
|
1369
|
+
}), Ht = e.object({
|
|
1370
|
+
...N,
|
|
1371
|
+
trigger_id: j
|
|
1365
1372
|
}).extend(n.shape).extend({
|
|
1366
1373
|
hook_id: e.string(),
|
|
1367
1374
|
code_id: e.string()
|
|
1368
|
-
}),
|
|
1369
|
-
...
|
|
1370
|
-
trigger_id:
|
|
1375
|
+
}), Ut = e.object({
|
|
1376
|
+
...N,
|
|
1377
|
+
trigger_id: M
|
|
1371
1378
|
}).extend(n.shape).extend({
|
|
1372
1379
|
hook_id: e.string(),
|
|
1373
|
-
page_id:
|
|
1380
|
+
page_id: Mt,
|
|
1374
1381
|
permission_required: e.string().optional()
|
|
1375
1382
|
});
|
|
1376
1383
|
e.union([
|
|
1377
|
-
Rt,
|
|
1378
1384
|
zt,
|
|
1379
1385
|
Bt,
|
|
1380
1386
|
Vt,
|
|
1381
|
-
Ht
|
|
1387
|
+
Ht,
|
|
1388
|
+
Ut
|
|
1382
1389
|
]), e.object({
|
|
1383
1390
|
code: e.string().max(1e5),
|
|
1384
1391
|
secrets: e.record(e.string(), e.string()).optional()
|
|
@@ -1386,11 +1393,11 @@ e.union([
|
|
|
1386
1393
|
id: e.string(),
|
|
1387
1394
|
tenant_id: e.string()
|
|
1388
1395
|
}).extend(n.shape);
|
|
1389
|
-
var
|
|
1396
|
+
var Wt = e.object({ name: e.string().optional() }), Gt = e.object({ email: e.string().optional() }), Kt = e.object({
|
|
1390
1397
|
id: e.string().optional(),
|
|
1391
1398
|
organization_id: e.string().max(50),
|
|
1392
|
-
inviter:
|
|
1393
|
-
invitee:
|
|
1399
|
+
inviter: Wt,
|
|
1400
|
+
invitee: Gt,
|
|
1394
1401
|
invitation_url: e.string().url(),
|
|
1395
1402
|
client_id: e.string(),
|
|
1396
1403
|
connection_id: e.string().optional(),
|
|
@@ -1406,8 +1413,8 @@ e.object({
|
|
|
1406
1413
|
created_at: e.string().datetime(),
|
|
1407
1414
|
expires_at: e.string().datetime(),
|
|
1408
1415
|
ticket_id: e.string().optional()
|
|
1409
|
-
}).extend(
|
|
1410
|
-
var
|
|
1416
|
+
}).extend(Kt.omit({ id: !0 }).shape);
|
|
1417
|
+
var qt = e.object({
|
|
1411
1418
|
alg: e.enum([
|
|
1412
1419
|
"RS256",
|
|
1413
1420
|
"RS384",
|
|
@@ -1418,7 +1425,7 @@ var Kt = e.object({
|
|
|
1418
1425
|
"HS256",
|
|
1419
1426
|
"HS384",
|
|
1420
1427
|
"HS512"
|
|
1421
|
-
]),
|
|
1428
|
+
]).optional(),
|
|
1422
1429
|
kid: e.string().optional(),
|
|
1423
1430
|
kty: e.enum([
|
|
1424
1431
|
"RSA",
|
|
@@ -1432,6 +1439,7 @@ var Kt = e.object({
|
|
|
1432
1439
|
x: e.string().optional(),
|
|
1433
1440
|
y: e.string().optional(),
|
|
1434
1441
|
x5t: e.string().optional(),
|
|
1442
|
+
"x5t#S256": e.string().optional(),
|
|
1435
1443
|
x5c: e.array(e.string()).optional()
|
|
1436
1444
|
}).superRefine((t, n) => {
|
|
1437
1445
|
if (t.kty === "RSA") for (let r of ["n", "e"]) t[r] || n.addIssue({
|
|
@@ -1448,8 +1456,8 @@ var Kt = e.object({
|
|
|
1448
1456
|
path: [r],
|
|
1449
1457
|
message: `EC JWK is missing required member '${r}'`
|
|
1450
1458
|
});
|
|
1451
|
-
});
|
|
1452
|
-
e.object({
|
|
1459
|
+
}), Jt = e.object({ keys: e.array(qt) });
|
|
1460
|
+
e.object({
|
|
1453
1461
|
issuer: e.string(),
|
|
1454
1462
|
authorization_endpoint: e.string(),
|
|
1455
1463
|
token_endpoint: e.string(),
|
|
@@ -1476,9 +1484,9 @@ e.object({ keys: e.array(Kt) }), e.object({
|
|
|
1476
1484
|
backchannel_logout_supported: e.boolean().optional(),
|
|
1477
1485
|
backchannel_logout_session_supported: e.boolean().optional()
|
|
1478
1486
|
});
|
|
1479
|
-
var
|
|
1487
|
+
var Yt = /* @__PURE__ */ function(e) {
|
|
1480
1488
|
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
|
-
}({}),
|
|
1489
|
+
}({}), Xt = e.nativeEnum(Yt), Zt = e.object({
|
|
1482
1490
|
strategy: e.string(),
|
|
1483
1491
|
strategy_type: e.string()
|
|
1484
1492
|
});
|
|
@@ -1492,19 +1500,19 @@ e.object({
|
|
|
1492
1500
|
useragent: e.string().optional(),
|
|
1493
1501
|
session_id: e.string().optional(),
|
|
1494
1502
|
authorization_url: e.string().optional(),
|
|
1495
|
-
state:
|
|
1503
|
+
state: Xt.optional().default("pending"),
|
|
1496
1504
|
state_data: e.string().optional(),
|
|
1497
1505
|
failure_reason: e.string().optional(),
|
|
1498
1506
|
user_id: e.string().optional(),
|
|
1499
1507
|
auth_connection: e.string().optional(),
|
|
1500
|
-
auth_strategy:
|
|
1508
|
+
auth_strategy: Zt.optional(),
|
|
1501
1509
|
authenticated_at: e.string().optional()
|
|
1502
1510
|
}).openapi({ description: "This represents a login sesion" }).extend({
|
|
1503
1511
|
id: e.string().openapi({ description: "This is is used as the state in the universal login" }),
|
|
1504
1512
|
created_at: e.string(),
|
|
1505
1513
|
updated_at: e.string()
|
|
1506
1514
|
});
|
|
1507
|
-
var
|
|
1515
|
+
var P = {
|
|
1508
1516
|
ACLS_SUMMARY: "acls_summary",
|
|
1509
1517
|
ACTIONS_EXECUTION_FAILED: "actions_execution_failed",
|
|
1510
1518
|
API_LIMIT: "api_limit",
|
|
@@ -1664,17 +1672,17 @@ var I = {
|
|
|
1664
1672
|
WARNING_DURING_LOGIN: "w",
|
|
1665
1673
|
WARNING_SENDING_NOTIFICATION: "wn",
|
|
1666
1674
|
WARNING_USER_MANAGEMENT: "wum"
|
|
1667
|
-
},
|
|
1668
|
-
|
|
1675
|
+
}, Qt = e.string().refine((e) => Object.values(P).includes(e), { message: "Invalid log type" });
|
|
1676
|
+
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
1677
|
let e = {};
|
|
1670
|
-
for (let [t, n] of Object.entries(
|
|
1678
|
+
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
1679
|
return e;
|
|
1672
1680
|
})();
|
|
1673
|
-
var
|
|
1681
|
+
var $t = e.object({
|
|
1674
1682
|
name: e.string(),
|
|
1675
1683
|
version: e.string(),
|
|
1676
1684
|
env: e.object({ node: e.string().optional() }).optional()
|
|
1677
|
-
}),
|
|
1685
|
+
}), en = e.object({
|
|
1678
1686
|
country_code: e.string().length(2),
|
|
1679
1687
|
city_name: e.string(),
|
|
1680
1688
|
latitude: e.string(),
|
|
@@ -1683,7 +1691,7 @@ var Xt = e.object({
|
|
|
1683
1691
|
continent_code: e.string()
|
|
1684
1692
|
});
|
|
1685
1693
|
e.object({
|
|
1686
|
-
type:
|
|
1694
|
+
type: Qt,
|
|
1687
1695
|
date: e.string(),
|
|
1688
1696
|
description: e.string().optional(),
|
|
1689
1697
|
ip: e.string().optional(),
|
|
@@ -1701,63 +1709,63 @@ e.object({
|
|
|
1701
1709
|
strategy: e.string().optional(),
|
|
1702
1710
|
strategy_type: e.string().optional(),
|
|
1703
1711
|
hostname: e.string().optional(),
|
|
1704
|
-
auth0_client:
|
|
1712
|
+
auth0_client: $t.optional(),
|
|
1705
1713
|
log_id: e.string().optional(),
|
|
1706
|
-
location_info:
|
|
1714
|
+
location_info: en.optional()
|
|
1707
1715
|
}).extend({ log_id: e.string() });
|
|
1708
|
-
var
|
|
1716
|
+
var tn = e.enum([
|
|
1709
1717
|
"http",
|
|
1710
1718
|
"eventbridge",
|
|
1711
1719
|
"eventgrid",
|
|
1712
1720
|
"splunk",
|
|
1713
1721
|
"datadog",
|
|
1714
1722
|
"sumo"
|
|
1715
|
-
]),
|
|
1723
|
+
]), nn = e.enum([
|
|
1716
1724
|
"active",
|
|
1717
1725
|
"paused",
|
|
1718
1726
|
"suspended"
|
|
1719
|
-
]),
|
|
1727
|
+
]), rn = e.object({
|
|
1720
1728
|
type: e.string(),
|
|
1721
1729
|
name: e.string()
|
|
1722
1730
|
});
|
|
1723
1731
|
e.object({
|
|
1724
1732
|
name: e.string(),
|
|
1725
|
-
type:
|
|
1726
|
-
status:
|
|
1733
|
+
type: tn,
|
|
1734
|
+
status: nn.optional(),
|
|
1727
1735
|
sink: e.record(e.string(), e.unknown()),
|
|
1728
|
-
filters: e.array(
|
|
1736
|
+
filters: e.array(rn).optional(),
|
|
1729
1737
|
isPriority: e.boolean().optional()
|
|
1730
1738
|
}).extend({
|
|
1731
1739
|
id: e.string(),
|
|
1732
|
-
status:
|
|
1740
|
+
status: nn,
|
|
1733
1741
|
created_at: e.string().optional(),
|
|
1734
1742
|
updated_at: e.string().optional()
|
|
1735
1743
|
});
|
|
1736
|
-
var
|
|
1744
|
+
var an = e.enum([
|
|
1737
1745
|
"auth0",
|
|
1738
1746
|
"cognito",
|
|
1739
1747
|
"okta",
|
|
1740
1748
|
"oidc"
|
|
1741
|
-
]),
|
|
1749
|
+
]), on = e.object({
|
|
1742
1750
|
domain: e.string(),
|
|
1743
1751
|
client_id: e.string(),
|
|
1744
1752
|
client_secret: e.string(),
|
|
1745
1753
|
audience: e.string().optional(),
|
|
1746
1754
|
scope: e.string().optional()
|
|
1747
|
-
}),
|
|
1755
|
+
}), sn = e.object({
|
|
1748
1756
|
id: e.string().optional(),
|
|
1749
1757
|
name: e.string(),
|
|
1750
|
-
provider:
|
|
1758
|
+
provider: an,
|
|
1751
1759
|
connection: e.string(),
|
|
1752
1760
|
enabled: e.boolean().default(!0),
|
|
1753
|
-
credentials:
|
|
1761
|
+
credentials: on
|
|
1754
1762
|
});
|
|
1755
1763
|
e.object({
|
|
1756
1764
|
id: e.string(),
|
|
1757
1765
|
created_at: e.string(),
|
|
1758
1766
|
updated_at: e.string()
|
|
1759
|
-
}).extend(
|
|
1760
|
-
var
|
|
1767
|
+
}).extend(sn.shape);
|
|
1768
|
+
var cn = e.object({
|
|
1761
1769
|
enabled: e.boolean().optional(),
|
|
1762
1770
|
shields: e.array(e.string()).optional(),
|
|
1763
1771
|
admin_notification_frequency: e.array(e.string()).optional(),
|
|
@@ -1766,13 +1774,13 @@ var an = e.object({
|
|
|
1766
1774
|
"pre-user-registration": e.object({ shields: e.array(e.string()).optional() }).optional(),
|
|
1767
1775
|
"pre-change-password": e.object({ shields: e.array(e.string()).optional() }).optional()
|
|
1768
1776
|
}).optional()
|
|
1769
|
-
}),
|
|
1777
|
+
}), ln = e.object({
|
|
1770
1778
|
enabled: e.boolean().optional(),
|
|
1771
1779
|
shields: e.array(e.string()).optional(),
|
|
1772
1780
|
allowlist: e.array(e.string()).optional(),
|
|
1773
1781
|
mode: e.string().optional(),
|
|
1774
1782
|
max_attempts: e.number().optional()
|
|
1775
|
-
}),
|
|
1783
|
+
}), un = e.object({
|
|
1776
1784
|
enabled: e.boolean().optional(),
|
|
1777
1785
|
shields: e.array(e.string()).optional(),
|
|
1778
1786
|
allowlist: e.array(e.string()).optional(),
|
|
@@ -1786,10 +1794,10 @@ var an = e.object({
|
|
|
1786
1794
|
rate: e.number().optional()
|
|
1787
1795
|
}).optional()
|
|
1788
1796
|
}).optional()
|
|
1789
|
-
}),
|
|
1790
|
-
breached_password_detection:
|
|
1791
|
-
brute_force_protection:
|
|
1792
|
-
suspicious_ip_throttling:
|
|
1797
|
+
}), dn = e.object({
|
|
1798
|
+
breached_password_detection: cn.optional(),
|
|
1799
|
+
brute_force_protection: ln.optional(),
|
|
1800
|
+
suspicious_ip_throttling: un.optional()
|
|
1793
1801
|
});
|
|
1794
1802
|
e.object({
|
|
1795
1803
|
id: e.string().optional(),
|
|
@@ -1802,14 +1810,14 @@ e.object({
|
|
|
1802
1810
|
created_at: e.string(),
|
|
1803
1811
|
updated_at: e.string()
|
|
1804
1812
|
});
|
|
1805
|
-
var
|
|
1813
|
+
var fn = e.object({
|
|
1806
1814
|
initial_user_agent: e.string().describe("First user agent of the device from which this user logged in"),
|
|
1807
1815
|
initial_ip: e.string().describe("First IP address associated with this session"),
|
|
1808
1816
|
initial_asn: e.string().describe("First autonomous system number associated with this session"),
|
|
1809
1817
|
last_user_agent: e.string().describe("Last user agent of the device from which this user logged in"),
|
|
1810
1818
|
last_ip: e.string().describe("Last IP address from which this user logged in"),
|
|
1811
1819
|
last_asn: e.string().describe("Last autonomous system number from which this user logged in")
|
|
1812
|
-
}),
|
|
1820
|
+
}), pn = e.object({
|
|
1813
1821
|
id: e.string(),
|
|
1814
1822
|
revoked_at: e.string().optional(),
|
|
1815
1823
|
used_at: e.string().optional(),
|
|
@@ -1817,7 +1825,7 @@ var ln = e.object({
|
|
|
1817
1825
|
expires_at: e.string().optional(),
|
|
1818
1826
|
login_session_id: e.string(),
|
|
1819
1827
|
idle_expires_at: e.string().optional(),
|
|
1820
|
-
device:
|
|
1828
|
+
device: fn.describe("Metadata related to the device used in the session"),
|
|
1821
1829
|
clients: e.array(e.string()).describe("List of client details for the session")
|
|
1822
1830
|
});
|
|
1823
1831
|
e.object({
|
|
@@ -1825,7 +1833,7 @@ e.object({
|
|
|
1825
1833
|
updated_at: e.string(),
|
|
1826
1834
|
authenticated_at: e.string(),
|
|
1827
1835
|
last_interaction_at: e.string()
|
|
1828
|
-
}).extend(
|
|
1836
|
+
}).extend(pn.shape), e.object({
|
|
1829
1837
|
kid: e.string().openapi({ description: "The key id of the signing key" }),
|
|
1830
1838
|
tenant_id: e.string().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
|
|
1831
1839
|
cert: e.string().openapi({ description: "The public certificate of the signing key" }),
|
|
@@ -1842,7 +1850,7 @@ e.object({
|
|
|
1842
1850
|
connection: e.string().optional().openapi({ description: "The connection identifier associated with the key" }),
|
|
1843
1851
|
type: e.enum(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
|
|
1844
1852
|
});
|
|
1845
|
-
var
|
|
1853
|
+
var mn = e.object({
|
|
1846
1854
|
id: e.string().optional(),
|
|
1847
1855
|
audience: e.string().optional(),
|
|
1848
1856
|
friendly_name: e.string(),
|
|
@@ -1960,7 +1968,7 @@ var dn = e.object({
|
|
|
1960
1968
|
"shared_planetscale"
|
|
1961
1969
|
]).optional(),
|
|
1962
1970
|
d1_database_id: e.string().max(64).optional(),
|
|
1963
|
-
attack_protection:
|
|
1971
|
+
attack_protection: dn.optional(),
|
|
1964
1972
|
mfa: e.object({
|
|
1965
1973
|
policy: e.enum(["never", "always"]).default("never").optional(),
|
|
1966
1974
|
factors: e.object({
|
|
@@ -1991,29 +1999,29 @@ var dn = e.object({
|
|
|
1991
1999
|
e.object({
|
|
1992
2000
|
created_at: e.string().nullable().transform((e) => e ?? ""),
|
|
1993
2001
|
updated_at: e.string().nullable().transform((e) => e ?? "")
|
|
1994
|
-
}).extend(
|
|
2002
|
+
}).extend(mn.shape).extend({
|
|
1995
2003
|
id: e.string(),
|
|
1996
2004
|
is_control_plane: e.boolean().optional()
|
|
1997
2005
|
});
|
|
1998
|
-
var
|
|
2006
|
+
var hn = e.enum([
|
|
1999
2007
|
"provision",
|
|
2000
2008
|
"seed",
|
|
2001
2009
|
"upgrade",
|
|
2002
2010
|
"backup",
|
|
2003
2011
|
"deprovision",
|
|
2004
2012
|
"users_import"
|
|
2005
|
-
]),
|
|
2013
|
+
]), gn = e.enum([
|
|
2006
2014
|
"pending",
|
|
2007
2015
|
"running",
|
|
2008
2016
|
"succeeded",
|
|
2009
2017
|
"failed",
|
|
2010
2018
|
"cancelled"
|
|
2011
|
-
]),
|
|
2019
|
+
]), _n = e.string().max(64);
|
|
2012
2020
|
e.object({
|
|
2013
2021
|
tenant_id: e.string().max(255).nullable().default(null),
|
|
2014
2022
|
rollout_id: e.string().max(255).nullable().optional(),
|
|
2015
|
-
kind:
|
|
2016
|
-
engine:
|
|
2023
|
+
kind: hn,
|
|
2024
|
+
engine: _n,
|
|
2017
2025
|
engine_instance_id: e.string().max(100).nullable().optional(),
|
|
2018
2026
|
target_worker_version: e.string().max(255).nullable().optional(),
|
|
2019
2027
|
target_database_version: e.string().max(255).nullable().optional(),
|
|
@@ -2021,7 +2029,7 @@ e.object({
|
|
|
2021
2029
|
input: e.record(e.string(), e.unknown()).nullable().optional()
|
|
2022
2030
|
}).extend({
|
|
2023
2031
|
id: e.string(),
|
|
2024
|
-
status:
|
|
2032
|
+
status: gn,
|
|
2025
2033
|
current_step: e.string().max(255).nullable().optional(),
|
|
2026
2034
|
error: e.string().nullable().optional(),
|
|
2027
2035
|
result: e.record(e.string(), e.unknown()).nullable().optional(),
|
|
@@ -2042,7 +2050,7 @@ e.object({
|
|
|
2042
2050
|
claim_expires_at: !0,
|
|
2043
2051
|
finished_at: !0
|
|
2044
2052
|
}).partial();
|
|
2045
|
-
var
|
|
2053
|
+
var vn = e.enum([
|
|
2046
2054
|
"started",
|
|
2047
2055
|
"succeeded",
|
|
2048
2056
|
"failed",
|
|
@@ -2053,14 +2061,14 @@ var hn = e.enum([
|
|
|
2053
2061
|
e.object({
|
|
2054
2062
|
operation_id: e.string().max(255),
|
|
2055
2063
|
step: e.string().max(255),
|
|
2056
|
-
outcome:
|
|
2064
|
+
outcome: vn,
|
|
2057
2065
|
detail: e.record(e.string(), e.unknown()).nullable().optional(),
|
|
2058
2066
|
attempt: e.number().int().min(1).default(1)
|
|
2059
2067
|
}).extend({
|
|
2060
2068
|
id: e.string(),
|
|
2061
2069
|
created_at: e.string()
|
|
2062
2070
|
});
|
|
2063
|
-
var
|
|
2071
|
+
var F = e.enum([
|
|
2064
2072
|
"pending",
|
|
2065
2073
|
"inserted",
|
|
2066
2074
|
"updated",
|
|
@@ -2071,28 +2079,28 @@ e.object({
|
|
|
2071
2079
|
operation_id: e.string().max(255),
|
|
2072
2080
|
seq: e.number().int().min(0),
|
|
2073
2081
|
payload: e.record(e.string(), e.unknown()),
|
|
2074
|
-
status:
|
|
2082
|
+
status: F.default("pending"),
|
|
2075
2083
|
error_code: e.string().max(64).nullable().optional(),
|
|
2076
2084
|
error_message: e.string().nullable().optional(),
|
|
2077
2085
|
error_path: e.string().max(255).nullable().optional(),
|
|
2078
2086
|
entity_id: e.string().max(255).nullable().optional()
|
|
2079
2087
|
}).extend({
|
|
2080
|
-
status:
|
|
2088
|
+
status: F,
|
|
2081
2089
|
created_at: e.string(),
|
|
2082
2090
|
updated_at: e.string()
|
|
2083
2091
|
}), e.object({
|
|
2084
2092
|
seq: e.number().int().min(0),
|
|
2085
|
-
status:
|
|
2093
|
+
status: F,
|
|
2086
2094
|
error_code: e.string().max(64).nullable().optional(),
|
|
2087
2095
|
error_message: e.string().nullable().optional(),
|
|
2088
2096
|
error_path: e.string().max(255).nullable().optional(),
|
|
2089
2097
|
entity_id: e.string().max(255).nullable().optional()
|
|
2090
2098
|
});
|
|
2091
|
-
var
|
|
2099
|
+
var yn = e.enum([
|
|
2092
2100
|
"upgrade",
|
|
2093
2101
|
"reseed",
|
|
2094
2102
|
"backup"
|
|
2095
|
-
]),
|
|
2103
|
+
]), bn = e.enum([
|
|
2096
2104
|
"pending",
|
|
2097
2105
|
"canary",
|
|
2098
2106
|
"rolling",
|
|
@@ -2101,7 +2109,7 @@ var gn = e.enum([
|
|
|
2101
2109
|
"failed"
|
|
2102
2110
|
]);
|
|
2103
2111
|
e.object({
|
|
2104
|
-
kind:
|
|
2112
|
+
kind: yn,
|
|
2105
2113
|
target_worker_version: e.string().max(255).nullable().optional(),
|
|
2106
2114
|
target_database_version: e.string().max(255).nullable().optional(),
|
|
2107
2115
|
wave_size: e.number().int().min(1).default(10),
|
|
@@ -2110,7 +2118,7 @@ e.object({
|
|
|
2110
2118
|
initiated_by: e.string().max(255).nullable().optional()
|
|
2111
2119
|
}).extend({
|
|
2112
2120
|
id: e.string(),
|
|
2113
|
-
status:
|
|
2121
|
+
status: bn,
|
|
2114
2122
|
created_at: e.string(),
|
|
2115
2123
|
updated_at: e.string(),
|
|
2116
2124
|
finished_at: e.string().nullable().optional()
|
|
@@ -2132,7 +2140,7 @@ e.object({
|
|
|
2132
2140
|
code: e.string(),
|
|
2133
2141
|
state: e.string().optional()
|
|
2134
2142
|
});
|
|
2135
|
-
var
|
|
2143
|
+
var xn = e.object({
|
|
2136
2144
|
button_border_radius: e.number(),
|
|
2137
2145
|
button_border_weight: e.number(),
|
|
2138
2146
|
buttons_style: e.enum([
|
|
@@ -2150,7 +2158,7 @@ var vn = e.object({
|
|
|
2150
2158
|
show_widget_shadow: e.boolean(),
|
|
2151
2159
|
widget_border_weight: e.number(),
|
|
2152
2160
|
widget_corner_radius: e.number()
|
|
2153
|
-
}),
|
|
2161
|
+
}), Sn = e.object({
|
|
2154
2162
|
base_focus_color: e.string(),
|
|
2155
2163
|
base_hover_color: e.string(),
|
|
2156
2164
|
body_text: e.string(),
|
|
@@ -2174,20 +2182,20 @@ var vn = e.object({
|
|
|
2174
2182
|
success: e.string(),
|
|
2175
2183
|
widget_background: e.string(),
|
|
2176
2184
|
widget_border: e.string()
|
|
2177
|
-
}),
|
|
2185
|
+
}), I = e.object({
|
|
2178
2186
|
bold: e.boolean(),
|
|
2179
2187
|
size: e.number()
|
|
2180
|
-
}),
|
|
2181
|
-
body_text:
|
|
2182
|
-
buttons_text:
|
|
2188
|
+
}), Cn = e.object({
|
|
2189
|
+
body_text: I,
|
|
2190
|
+
buttons_text: I,
|
|
2183
2191
|
font_url: e.string(),
|
|
2184
|
-
input_labels:
|
|
2185
|
-
links:
|
|
2192
|
+
input_labels: I,
|
|
2193
|
+
links: I,
|
|
2186
2194
|
links_style: e.enum(["normal", "underlined"]),
|
|
2187
2195
|
reference_text_size: e.number(),
|
|
2188
|
-
subtitle:
|
|
2189
|
-
title:
|
|
2190
|
-
}),
|
|
2196
|
+
subtitle: I,
|
|
2197
|
+
title: I
|
|
2198
|
+
}), wn = e.object({
|
|
2191
2199
|
background_color: e.string(),
|
|
2192
2200
|
background_image_url: e.string(),
|
|
2193
2201
|
page_layout: e.enum([
|
|
@@ -2200,7 +2208,7 @@ var vn = e.object({
|
|
|
2200
2208
|
"chip",
|
|
2201
2209
|
"none"
|
|
2202
2210
|
]).optional()
|
|
2203
|
-
}),
|
|
2211
|
+
}), Tn = e.object({
|
|
2204
2212
|
header_text_alignment: e.enum([
|
|
2205
2213
|
"center",
|
|
2206
2214
|
"left",
|
|
@@ -2217,12 +2225,12 @@ var vn = e.object({
|
|
|
2217
2225
|
social_buttons_layout: e.enum(["bottom", "top"])
|
|
2218
2226
|
});
|
|
2219
2227
|
e.object({
|
|
2220
|
-
borders:
|
|
2221
|
-
colors:
|
|
2228
|
+
borders: xn,
|
|
2229
|
+
colors: Sn,
|
|
2222
2230
|
displayName: e.string(),
|
|
2223
|
-
fonts:
|
|
2224
|
-
page_background:
|
|
2225
|
-
widget:
|
|
2231
|
+
fonts: Cn,
|
|
2232
|
+
page_background: wn,
|
|
2233
|
+
widget: Tn
|
|
2226
2234
|
}).extend({ themeId: e.string() }), e.object({
|
|
2227
2235
|
universal_login_experience: e.enum(["new", "classic"]).default("new"),
|
|
2228
2236
|
identifier_first: e.boolean().default(!0),
|
|
@@ -2230,42 +2238,87 @@ e.object({
|
|
|
2230
2238
|
show_last_used_connection: e.boolean().default(!1),
|
|
2231
2239
|
webauthn_platform_first_factor: e.boolean()
|
|
2232
2240
|
});
|
|
2233
|
-
var
|
|
2241
|
+
var En = e.object({
|
|
2234
2242
|
hosts: e.array(e.string()).optional(),
|
|
2235
2243
|
methods: e.array(e.string()).optional(),
|
|
2236
2244
|
path: e.string().default("/*"),
|
|
2237
2245
|
headers: e.record(e.string(), e.string()).optional(),
|
|
2238
2246
|
query: e.record(e.string(), e.string()).optional()
|
|
2239
|
-
}),
|
|
2247
|
+
}), Dn = e.object({
|
|
2240
2248
|
type: e.string(),
|
|
2241
2249
|
options: e.record(e.string(), e.unknown()).default({})
|
|
2242
|
-
}),
|
|
2250
|
+
}), L = e.object({
|
|
2243
2251
|
id: e.string().optional(),
|
|
2244
2252
|
custom_domain_id: e.string(),
|
|
2245
2253
|
priority: e.number().int().default(100),
|
|
2246
|
-
match:
|
|
2247
|
-
handlers: e.array(
|
|
2248
|
-
}),
|
|
2254
|
+
match: En,
|
|
2255
|
+
handlers: e.array(Dn).min(1)
|
|
2256
|
+
}), On = L.extend({
|
|
2249
2257
|
id: e.string(),
|
|
2250
2258
|
tenant_id: e.string(),
|
|
2251
2259
|
created_at: e.string(),
|
|
2252
2260
|
updated_at: e.string()
|
|
2253
|
-
}),
|
|
2261
|
+
}), kn = L.partial().omit({
|
|
2254
2262
|
id: !0,
|
|
2255
2263
|
custom_domain_id: !0
|
|
2256
|
-
}),
|
|
2264
|
+
}), An = "custom_authentication", jn = [
|
|
2265
|
+
"urn:ietf:params:oauth:",
|
|
2266
|
+
"urn:auth0",
|
|
2267
|
+
"urn:okta",
|
|
2268
|
+
"http://auth0.com",
|
|
2269
|
+
"https://auth0.com",
|
|
2270
|
+
"http://okta.com",
|
|
2271
|
+
"https://okta.com"
|
|
2272
|
+
], 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([
|
|
2273
|
+
"RS256",
|
|
2274
|
+
"RS384",
|
|
2275
|
+
"RS512",
|
|
2276
|
+
"ES256",
|
|
2277
|
+
"ES384",
|
|
2278
|
+
"ES512"
|
|
2279
|
+
]), Pn = e.discriminatedUnion("type", [e.object({
|
|
2280
|
+
type: e.literal("connection"),
|
|
2281
|
+
connection: e.string().min(1),
|
|
2282
|
+
create_if_not_exists: e.boolean().default(!0),
|
|
2283
|
+
trust_email_verified: e.boolean().default(!1)
|
|
2284
|
+
}), e.object({ type: e.literal("user_id") })]), Fn = e.object({
|
|
2285
|
+
issuer: e.string().min(1).max(2048),
|
|
2286
|
+
jwks: Jt.optional(),
|
|
2287
|
+
jwks_uri: e.string().url().optional(),
|
|
2288
|
+
audience: e.array(e.string().min(1)).min(1).optional(),
|
|
2289
|
+
algorithms: e.array(Nn).min(1).optional(),
|
|
2290
|
+
max_lifetime_seconds: e.number().int().min(1).max(3600).default(300),
|
|
2291
|
+
require_jti: e.boolean().default(!0),
|
|
2292
|
+
user_mapping: Pn
|
|
2293
|
+
});
|
|
2294
|
+
e.object({
|
|
2295
|
+
name: e.string().min(1).max(255),
|
|
2296
|
+
subject_token_type: Mn,
|
|
2297
|
+
action_id: e.string().min(1).optional(),
|
|
2298
|
+
type: e.literal(An),
|
|
2299
|
+
jwt_verification: Fn.optional()
|
|
2300
|
+
}).extend({
|
|
2301
|
+
id: e.string(),
|
|
2302
|
+
created_at: e.string(),
|
|
2303
|
+
updated_at: e.string()
|
|
2304
|
+
}), e.object({
|
|
2305
|
+
name: e.string().min(1).max(255).optional(),
|
|
2306
|
+
subject_token_type: Mn.optional(),
|
|
2307
|
+
jwt_verification: Fn.optional()
|
|
2308
|
+
});
|
|
2309
|
+
var In = e.object({
|
|
2257
2310
|
scim: e.string(),
|
|
2258
2311
|
auth0: e.string()
|
|
2259
|
-
}),
|
|
2312
|
+
}), Ln = e.object({
|
|
2260
2313
|
connection_id: e.string(),
|
|
2261
2314
|
user_id_attribute: e.string().default("externalId"),
|
|
2262
|
-
mapping: e.array(
|
|
2315
|
+
mapping: e.array(In).default([])
|
|
2263
2316
|
});
|
|
2264
2317
|
e.object({
|
|
2265
2318
|
created_at: e.string(),
|
|
2266
2319
|
updated_at: e.string()
|
|
2267
|
-
}).extend(
|
|
2268
|
-
var
|
|
2320
|
+
}).extend(Ln.shape);
|
|
2321
|
+
var Rn = e.object({
|
|
2269
2322
|
token_id: e.string(),
|
|
2270
2323
|
connection_id: e.string(),
|
|
2271
2324
|
token_hash: e.string(),
|
|
@@ -2275,20 +2328,20 @@ var kn = e.object({
|
|
|
2275
2328
|
e.object({
|
|
2276
2329
|
created_at: e.string(),
|
|
2277
2330
|
last_used_at: e.string().optional()
|
|
2278
|
-
}).extend(
|
|
2279
|
-
var
|
|
2331
|
+
}).extend(Rn.shape);
|
|
2332
|
+
var zn = e.object({
|
|
2280
2333
|
connection_id: e.string(),
|
|
2281
2334
|
external_id: e.string(),
|
|
2282
2335
|
user_id: e.string()
|
|
2283
2336
|
});
|
|
2284
|
-
e.object({ created_at: e.string() }).extend(
|
|
2337
|
+
e.object({ created_at: e.string() }).extend(zn.shape), e.object({
|
|
2285
2338
|
name: e.string(),
|
|
2286
2339
|
enabled: e.boolean().optional().default(!0),
|
|
2287
2340
|
default_from_address: e.string().optional(),
|
|
2288
2341
|
credentials: e.record(e.string(), e.unknown()),
|
|
2289
2342
|
settings: e.object({}).optional()
|
|
2290
2343
|
});
|
|
2291
|
-
var
|
|
2344
|
+
var Bn = e.enum([
|
|
2292
2345
|
"verify_email",
|
|
2293
2346
|
"verify_email_by_code",
|
|
2294
2347
|
"reset_email",
|
|
@@ -2303,7 +2356,7 @@ var jn = e.enum([
|
|
|
2303
2356
|
"user_invitation"
|
|
2304
2357
|
]);
|
|
2305
2358
|
e.object({
|
|
2306
|
-
template:
|
|
2359
|
+
template: Bn,
|
|
2307
2360
|
body: e.string(),
|
|
2308
2361
|
from: e.string(),
|
|
2309
2362
|
subject: e.string(),
|
|
@@ -2318,13 +2371,13 @@ e.object({
|
|
|
2318
2371
|
session_id: e.string().optional(),
|
|
2319
2372
|
organization: e.string().optional(),
|
|
2320
2373
|
auth_connection: e.string().optional(),
|
|
2321
|
-
auth_strategy:
|
|
2374
|
+
auth_strategy: Zt.optional(),
|
|
2322
2375
|
user_id: e.string(),
|
|
2323
2376
|
client_id: e.string(),
|
|
2324
2377
|
expires_at: e.string().optional(),
|
|
2325
2378
|
idle_expires_at: e.string().optional(),
|
|
2326
2379
|
last_exchanged_at: e.string().optional(),
|
|
2327
|
-
device:
|
|
2380
|
+
device: fn,
|
|
2328
2381
|
resource_servers: e.array(e.object({
|
|
2329
2382
|
audience: e.string(),
|
|
2330
2383
|
scopes: e.string()
|
|
@@ -2345,10 +2398,10 @@ e.object({
|
|
|
2345
2398
|
name: e.string(),
|
|
2346
2399
|
options: e.object({})
|
|
2347
2400
|
});
|
|
2348
|
-
var
|
|
2401
|
+
var Vn = e.object({
|
|
2349
2402
|
value: e.string(),
|
|
2350
2403
|
description: e.string().optional()
|
|
2351
|
-
}),
|
|
2404
|
+
}), Hn = e.object({
|
|
2352
2405
|
token_dialect: e.enum(["access_token", "access_token_authz"]).optional(),
|
|
2353
2406
|
enforce_policies: e.boolean().optional(),
|
|
2354
2407
|
allow_skipping_userinfo: e.boolean().optional(),
|
|
@@ -2356,11 +2409,11 @@ var Mn = e.object({
|
|
|
2356
2409
|
persist_client_authorization: e.boolean().optional(),
|
|
2357
2410
|
enable_introspection_endpoint: e.boolean().optional(),
|
|
2358
2411
|
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2359
|
-
}),
|
|
2412
|
+
}), Un = e.object({
|
|
2360
2413
|
id: e.string().optional(),
|
|
2361
2414
|
name: e.string(),
|
|
2362
2415
|
identifier: e.string(),
|
|
2363
|
-
scopes: e.array(
|
|
2416
|
+
scopes: e.array(Vn).optional(),
|
|
2364
2417
|
signing_alg: e.string().optional(),
|
|
2365
2418
|
signing_secret: e.string().optional(),
|
|
2366
2419
|
token_lifetime: e.number().default(86400),
|
|
@@ -2368,20 +2421,20 @@ var Mn = e.object({
|
|
|
2368
2421
|
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2369
2422
|
allow_offline_access: e.boolean().optional(),
|
|
2370
2423
|
verificationKey: e.string().optional(),
|
|
2371
|
-
options:
|
|
2424
|
+
options: Hn.optional(),
|
|
2372
2425
|
is_system: e.boolean().optional(),
|
|
2373
2426
|
metadata: e.record(e.string(), e.any()).optional()
|
|
2374
2427
|
}).extend({
|
|
2375
2428
|
created_at: e.string().optional(),
|
|
2376
2429
|
updated_at: e.string().optional()
|
|
2377
2430
|
});
|
|
2378
|
-
e.array(
|
|
2379
|
-
var
|
|
2431
|
+
e.array(Un);
|
|
2432
|
+
var Wn = e.object({
|
|
2380
2433
|
role_id: e.string(),
|
|
2381
2434
|
resource_server_identifier: e.string(),
|
|
2382
2435
|
permission_name: e.string()
|
|
2383
2436
|
}).extend({ created_at: e.string() });
|
|
2384
|
-
e.array(
|
|
2437
|
+
e.array(Wn), e.object({
|
|
2385
2438
|
user_id: e.string().openapi({ description: "The id of the user that granted the consent" }),
|
|
2386
2439
|
clientID: e.string().openapi({ description: "The id of the client the grant was issued to" }),
|
|
2387
2440
|
audience: e.string().optional().openapi({ description: "The audience the grant applies to" }),
|
|
@@ -2394,7 +2447,7 @@ e.array(Fn), e.object({
|
|
|
2394
2447
|
failed_logins: e.array(e.string()).optional(),
|
|
2395
2448
|
last_password_reset: e.string().optional()
|
|
2396
2449
|
});
|
|
2397
|
-
var
|
|
2450
|
+
var Gn = e.object({
|
|
2398
2451
|
user_id: e.string(),
|
|
2399
2452
|
resource_server_identifier: e.string(),
|
|
2400
2453
|
permission_name: e.string(),
|
|
@@ -2403,8 +2456,8 @@ var In = e.object({
|
|
|
2403
2456
|
tenant_id: e.string(),
|
|
2404
2457
|
created_at: e.string().optional()
|
|
2405
2458
|
});
|
|
2406
|
-
e.array(
|
|
2407
|
-
var
|
|
2459
|
+
e.array(Gn);
|
|
2460
|
+
var Kn = e.object({
|
|
2408
2461
|
user_id: e.string(),
|
|
2409
2462
|
resource_server_identifier: e.string(),
|
|
2410
2463
|
resource_server_name: e.string(),
|
|
@@ -2413,8 +2466,8 @@ var Ln = e.object({
|
|
|
2413
2466
|
created_at: e.string().optional(),
|
|
2414
2467
|
organization_id: e.string().optional()
|
|
2415
2468
|
});
|
|
2416
|
-
e.array(
|
|
2417
|
-
var
|
|
2469
|
+
e.array(Kn);
|
|
2470
|
+
var qn = e.object({
|
|
2418
2471
|
user_id: e.string(),
|
|
2419
2472
|
role_id: e.string(),
|
|
2420
2473
|
organization_id: e.string().optional()
|
|
@@ -2422,8 +2475,8 @@ var Rn = e.object({
|
|
|
2422
2475
|
tenant_id: e.string(),
|
|
2423
2476
|
created_at: e.string().optional()
|
|
2424
2477
|
});
|
|
2425
|
-
e.array(
|
|
2426
|
-
var
|
|
2478
|
+
e.array(qn);
|
|
2479
|
+
var Jn = e.object({
|
|
2427
2480
|
id: e.string().optional().openapi({ description: "The unique identifier of the role. If not provided, one will be generated." }),
|
|
2428
2481
|
name: e.string().min(1).max(50).openapi({ description: "The name of the role. Cannot include '<' or '>'" }),
|
|
2429
2482
|
description: e.string().max(255).optional().openapi({ description: "The description of the role" }),
|
|
@@ -2434,19 +2487,19 @@ var zn = e.object({
|
|
|
2434
2487
|
created_at: e.string().optional(),
|
|
2435
2488
|
updated_at: e.string().optional()
|
|
2436
2489
|
});
|
|
2437
|
-
e.array(
|
|
2438
|
-
var
|
|
2490
|
+
e.array(Jn);
|
|
2491
|
+
var Yn = e.object({
|
|
2439
2492
|
logo_url: e.string().optional().openapi({ description: "URL of the organization's logo" }),
|
|
2440
2493
|
colors: e.object({
|
|
2441
2494
|
primary: e.string().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
2442
2495
|
page_background: e.string().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
2443
2496
|
}).optional()
|
|
2444
|
-
}).optional(),
|
|
2497
|
+
}).optional(), Xn = e.object({
|
|
2445
2498
|
connection_id: e.string().openapi({ description: "ID of the connection" }),
|
|
2446
2499
|
assign_membership_on_login: e.boolean().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
2447
2500
|
show_as_button: e.boolean().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
2448
2501
|
is_signup_enabled: e.boolean().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
2449
|
-
}),
|
|
2502
|
+
}), Zn = e.object({ client_credentials: e.object({
|
|
2450
2503
|
enforce: e.boolean().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
2451
2504
|
per_day: e.number().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
2452
2505
|
per_hour: e.number().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
@@ -2455,15 +2508,15 @@ e.object({
|
|
|
2455
2508
|
id: e.string().optional(),
|
|
2456
2509
|
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
2510
|
display_name: e.string().optional().openapi({ description: "The display name of the organization" }),
|
|
2458
|
-
branding:
|
|
2511
|
+
branding: Yn,
|
|
2459
2512
|
metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
2460
|
-
enabled_connections: e.array(
|
|
2461
|
-
token_quota:
|
|
2513
|
+
enabled_connections: e.array(Xn).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2514
|
+
token_quota: Zn
|
|
2462
2515
|
}).extend(n.shape).extend({
|
|
2463
2516
|
id: e.string(),
|
|
2464
2517
|
name: e.string().min(1).openapi({ description: "The name of the organization" })
|
|
2465
2518
|
});
|
|
2466
|
-
var
|
|
2519
|
+
var Qn = e.object({
|
|
2467
2520
|
connection_id: e.string().openapi({ description: "ID of the tenant-level connection to enable for the org." }),
|
|
2468
2521
|
assign_membership_on_login: e.boolean().optional().default(!1),
|
|
2469
2522
|
show_as_button: e.boolean().optional().default(!0),
|
|
@@ -2476,7 +2529,7 @@ var Un = e.object({
|
|
|
2476
2529
|
created_at: e.string().optional(),
|
|
2477
2530
|
updated_at: e.string().optional()
|
|
2478
2531
|
});
|
|
2479
|
-
e.array(
|
|
2532
|
+
e.array(Qn), e.object({
|
|
2480
2533
|
user_id: e.string().openapi({ description: "ID of the user" }),
|
|
2481
2534
|
organization_id: e.string().openapi({ description: "ID of the organization" })
|
|
2482
2535
|
}).extend(n.shape).extend({ id: e.string() }), e.object({
|
|
@@ -2615,7 +2668,7 @@ e.array(Un), e.object({
|
|
|
2615
2668
|
"passwordless",
|
|
2616
2669
|
"enterprise"
|
|
2617
2670
|
]);
|
|
2618
|
-
var
|
|
2671
|
+
var $n = e.object({
|
|
2619
2672
|
cohort: e.string(),
|
|
2620
2673
|
sessions: e.number(),
|
|
2621
2674
|
active: e.array(e.number())
|
|
@@ -2624,9 +2677,9 @@ e.object({
|
|
|
2624
2677
|
interval: e.literal("week"),
|
|
2625
2678
|
from: e.string(),
|
|
2626
2679
|
to: e.string(),
|
|
2627
|
-
cohorts: e.array(
|
|
2680
|
+
cohorts: e.array($n)
|
|
2628
2681
|
});
|
|
2629
|
-
var
|
|
2682
|
+
var er = e.object({
|
|
2630
2683
|
cohort: e.string(),
|
|
2631
2684
|
tokens: e.number(),
|
|
2632
2685
|
active: e.array(e.number())
|
|
@@ -2635,24 +2688,24 @@ e.object({
|
|
|
2635
2688
|
interval: e.literal("week"),
|
|
2636
2689
|
from: e.string(),
|
|
2637
2690
|
to: e.string(),
|
|
2638
|
-
cohorts: e.array(
|
|
2691
|
+
cohorts: e.array(er)
|
|
2639
2692
|
});
|
|
2640
|
-
var
|
|
2693
|
+
var tr = e.object({
|
|
2641
2694
|
name: e.string(),
|
|
2642
2695
|
type: e.string()
|
|
2643
|
-
}),
|
|
2696
|
+
}), nr = e.object({
|
|
2644
2697
|
elapsed: e.number(),
|
|
2645
2698
|
rows_read: e.number().optional(),
|
|
2646
2699
|
bytes_read: e.number().optional()
|
|
2647
2700
|
});
|
|
2648
2701
|
e.object({
|
|
2649
|
-
meta: e.array(
|
|
2702
|
+
meta: e.array(tr),
|
|
2650
2703
|
data: e.array(e.record(e.string(), e.any())),
|
|
2651
2704
|
rows: e.number(),
|
|
2652
2705
|
rows_before_limit_at_least: e.number().optional(),
|
|
2653
|
-
statistics:
|
|
2706
|
+
statistics: nr.optional()
|
|
2654
2707
|
});
|
|
2655
|
-
var
|
|
2708
|
+
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
2709
|
type: "object",
|
|
2657
2710
|
additionalProperties: {
|
|
2658
2711
|
type: "object",
|
|
@@ -2660,11 +2713,11 @@ var Jn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.
|
|
|
2660
2713
|
}
|
|
2661
2714
|
});
|
|
2662
2715
|
e.object({
|
|
2663
|
-
prompt:
|
|
2716
|
+
prompt: rr,
|
|
2664
2717
|
language: e.string(),
|
|
2665
|
-
custom_text:
|
|
2718
|
+
custom_text: ir
|
|
2666
2719
|
});
|
|
2667
|
-
var
|
|
2720
|
+
var ar = e.enum([
|
|
2668
2721
|
"phone",
|
|
2669
2722
|
"totp",
|
|
2670
2723
|
"email",
|
|
@@ -2672,9 +2725,9 @@ var Xn = e.enum([
|
|
|
2672
2725
|
"webauthn-roaming",
|
|
2673
2726
|
"webauthn-platform",
|
|
2674
2727
|
"passkey"
|
|
2675
|
-
]),
|
|
2728
|
+
]), or = e.object({
|
|
2676
2729
|
user_id: e.string(),
|
|
2677
|
-
type:
|
|
2730
|
+
type: ar,
|
|
2678
2731
|
phone_number: e.string().optional(),
|
|
2679
2732
|
totp_secret: e.string().optional(),
|
|
2680
2733
|
credential_id: e.string().optional(),
|
|
@@ -2685,7 +2738,7 @@ var Xn = e.enum([
|
|
|
2685
2738
|
friendly_name: e.string().optional(),
|
|
2686
2739
|
confirmed: e.boolean().default(!1)
|
|
2687
2740
|
});
|
|
2688
|
-
function
|
|
2741
|
+
function R(t, n) {
|
|
2689
2742
|
t.type === "phone" && !t.phone_number && n.addIssue({
|
|
2690
2743
|
code: e.ZodIssueCode.custom,
|
|
2691
2744
|
message: "phone_number is required when type is 'phone'",
|
|
@@ -2708,29 +2761,29 @@ function Qn(t, n) {
|
|
|
2708
2761
|
path: ["public_key"]
|
|
2709
2762
|
}));
|
|
2710
2763
|
}
|
|
2711
|
-
|
|
2764
|
+
or.superRefine(R), or.extend({
|
|
2712
2765
|
id: e.string(),
|
|
2713
2766
|
created_at: e.string(),
|
|
2714
2767
|
updated_at: e.string()
|
|
2715
|
-
}).superRefine(
|
|
2768
|
+
}).superRefine(R), e.object({
|
|
2716
2769
|
id: e.string().optional(),
|
|
2717
2770
|
created_at: e.string().datetime({ offset: !0 }).optional(),
|
|
2718
2771
|
updated_at: e.string().datetime({ offset: !0 }).optional()
|
|
2719
2772
|
});
|
|
2720
|
-
var
|
|
2773
|
+
var sr = "x-authhero-preserve-location", z = class extends Error {
|
|
2721
2774
|
ms;
|
|
2722
2775
|
constructor(e, t) {
|
|
2723
2776
|
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2724
2777
|
}
|
|
2725
2778
|
};
|
|
2726
|
-
function
|
|
2727
|
-
return e instanceof
|
|
2779
|
+
function B(e) {
|
|
2780
|
+
return e instanceof z ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2728
2781
|
}
|
|
2729
|
-
function
|
|
2782
|
+
function V(e, t) {
|
|
2730
2783
|
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
2731
2784
|
return t(n.signal).finally(() => clearTimeout(r));
|
|
2732
2785
|
}
|
|
2733
|
-
function
|
|
2786
|
+
function cr(e) {
|
|
2734
2787
|
let t = e.filter((e) => e !== void 0);
|
|
2735
2788
|
if (t.length <= 1) return t[0];
|
|
2736
2789
|
if (typeof AbortSignal.any == "function") return AbortSignal.any(t);
|
|
@@ -2743,18 +2796,18 @@ function er(e) {
|
|
|
2743
2796
|
for (let e of t) e.addEventListener("abort", i);
|
|
2744
2797
|
return n.signal;
|
|
2745
2798
|
}
|
|
2746
|
-
function
|
|
2747
|
-
let i = new AbortController(), a =
|
|
2799
|
+
function H(e, t, n, r) {
|
|
2800
|
+
let i = new AbortController(), a = cr([n, i.signal]) ?? i.signal, o, s = new Promise((n, r) => {
|
|
2748
2801
|
o = setTimeout(() => {
|
|
2749
|
-
let n = new
|
|
2802
|
+
let n = new z(e, t);
|
|
2750
2803
|
i.abort(n), r(n);
|
|
2751
2804
|
}, e);
|
|
2752
2805
|
});
|
|
2753
2806
|
return Promise.race([Promise.resolve().then(() => r(a)), s]).finally(() => clearTimeout(o));
|
|
2754
2807
|
}
|
|
2755
|
-
function
|
|
2808
|
+
function U(e, t, n) {
|
|
2756
2809
|
let r, i = new Promise((e, i) => {
|
|
2757
|
-
r = setTimeout(() => i(new
|
|
2810
|
+
r = setTimeout(() => i(new z(t, n)), t);
|
|
2758
2811
|
});
|
|
2759
2812
|
return Promise.race([e, i]).finally(() => {
|
|
2760
2813
|
r && clearTimeout(r);
|
|
@@ -2762,12 +2815,12 @@ function W(e, t, n) {
|
|
|
2762
2815
|
}
|
|
2763
2816
|
//#endregion
|
|
2764
2817
|
//#region src/data-plane/cache.ts
|
|
2765
|
-
var
|
|
2766
|
-
function
|
|
2818
|
+
var lr = 1e4, ur = 8e3;
|
|
2819
|
+
function W(e, t, n) {
|
|
2767
2820
|
let r = typeof t == "number" ? {
|
|
2768
2821
|
freshTtlMs: t,
|
|
2769
2822
|
maxEntries: n
|
|
2770
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ??
|
|
2823
|
+
} : 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();
|
|
2771
2824
|
function p(e) {
|
|
2772
2825
|
for (let [t, n] of f) n.stale_if_error_until <= e && n.stale_until <= e && f.delete(t);
|
|
2773
2826
|
for (; f.size >= c;) {
|
|
@@ -2789,7 +2842,7 @@ function G(e, t, n) {
|
|
|
2789
2842
|
return e.refresh_started_at === void 0 ? !1 : t - e.refresh_started_at < d ? !0 : (e.refresh_started_at = void 0, !1);
|
|
2790
2843
|
}
|
|
2791
2844
|
function g(t, n) {
|
|
2792
|
-
return u > 0 ?
|
|
2845
|
+
return u > 0 ? H(u, "resolveHost", n, (n) => e.resolveHost(t, { signal: n })) : e.resolveHost(t, { signal: n });
|
|
2793
2846
|
}
|
|
2794
2847
|
async function _(e, t) {
|
|
2795
2848
|
let n = f.get(e);
|
|
@@ -2822,7 +2875,7 @@ function G(e, t, n) {
|
|
|
2822
2875
|
}
|
|
2823
2876
|
//#endregion
|
|
2824
2877
|
//#region src/data-plane/registry.ts
|
|
2825
|
-
var
|
|
2878
|
+
var dr = class {
|
|
2826
2879
|
definitions = /* @__PURE__ */ new Map();
|
|
2827
2880
|
bindings;
|
|
2828
2881
|
constructor(e = {}) {
|
|
@@ -2842,38 +2895,38 @@ var rr = class {
|
|
|
2842
2895
|
return n.build(r.data, { bindings: this.bindings });
|
|
2843
2896
|
}
|
|
2844
2897
|
};
|
|
2845
|
-
function
|
|
2898
|
+
function G(e) {
|
|
2846
2899
|
return e;
|
|
2847
2900
|
}
|
|
2848
2901
|
//#endregion
|
|
2849
2902
|
//#region src/data-plane/handlers/util.ts
|
|
2850
|
-
var
|
|
2851
|
-
function
|
|
2852
|
-
e.set(
|
|
2903
|
+
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";
|
|
2904
|
+
function _r(e, t) {
|
|
2905
|
+
e.set(fr, t);
|
|
2853
2906
|
}
|
|
2854
|
-
function
|
|
2855
|
-
return e.get(
|
|
2907
|
+
function K(e) {
|
|
2908
|
+
return e.get(fr) ?? e.req.raw;
|
|
2856
2909
|
}
|
|
2857
|
-
function
|
|
2858
|
-
e.set(
|
|
2910
|
+
function vr(e, t) {
|
|
2911
|
+
e.set(pr, t.tenant_id), e.set(mr, t.custom_domain_id), e.set(hr, t.domain);
|
|
2859
2912
|
}
|
|
2860
|
-
function
|
|
2861
|
-
return e.get(
|
|
2913
|
+
function yr(e) {
|
|
2914
|
+
return e.get(pr);
|
|
2862
2915
|
}
|
|
2863
|
-
function
|
|
2864
|
-
return e.get(
|
|
2916
|
+
function br(e) {
|
|
2917
|
+
return e.get(mr);
|
|
2865
2918
|
}
|
|
2866
|
-
function
|
|
2867
|
-
return e.get(
|
|
2919
|
+
function xr(e) {
|
|
2920
|
+
return e.get(hr);
|
|
2868
2921
|
}
|
|
2869
|
-
function
|
|
2870
|
-
let n =
|
|
2871
|
-
t(r),
|
|
2922
|
+
function Sr(e, t) {
|
|
2923
|
+
let n = K(e), r = new Headers(n.headers);
|
|
2924
|
+
t(r), _r(e, new Request(n, { headers: r }));
|
|
2872
2925
|
}
|
|
2873
|
-
function
|
|
2926
|
+
function q(e) {
|
|
2874
2927
|
let t = e.res;
|
|
2875
2928
|
try {
|
|
2876
|
-
t.headers.append(
|
|
2929
|
+
t.headers.append(gr, "1"), t.headers.delete(gr);
|
|
2877
2930
|
return;
|
|
2878
2931
|
} catch {
|
|
2879
2932
|
e.res = new Response(t.body, {
|
|
@@ -2885,7 +2938,7 @@ function J(e) {
|
|
|
2885
2938
|
}
|
|
2886
2939
|
//#endregion
|
|
2887
2940
|
//#region src/data-plane/handlers/cors.ts
|
|
2888
|
-
var
|
|
2941
|
+
var Cr = e.object({
|
|
2889
2942
|
origins: e.array(e.string()).optional(),
|
|
2890
2943
|
allow_credentials: e.boolean().optional(),
|
|
2891
2944
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2893,44 +2946,44 @@ var hr = e.object({
|
|
|
2893
2946
|
expose_headers: e.array(e.string()).optional(),
|
|
2894
2947
|
max_age: e.number().int().optional()
|
|
2895
2948
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2896
|
-
function
|
|
2949
|
+
function wr(e, t) {
|
|
2897
2950
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2898
2951
|
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;
|
|
2899
2952
|
}
|
|
2900
|
-
var
|
|
2953
|
+
var Tr = G({
|
|
2901
2954
|
type: "cors",
|
|
2902
|
-
optionsSchema:
|
|
2955
|
+
optionsSchema: Cr,
|
|
2903
2956
|
build(e) {
|
|
2904
2957
|
return async (t, n) => {
|
|
2905
2958
|
let r = t.req.header("origin") ?? null;
|
|
2906
2959
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2907
|
-
let t =
|
|
2960
|
+
let t = wr(e, r);
|
|
2908
2961
|
return new Response(null, {
|
|
2909
2962
|
status: 204,
|
|
2910
2963
|
headers: t
|
|
2911
2964
|
});
|
|
2912
2965
|
}
|
|
2913
2966
|
await n();
|
|
2914
|
-
let i =
|
|
2915
|
-
|
|
2967
|
+
let i = wr(e, r);
|
|
2968
|
+
q(t), i.forEach((e, n) => {
|
|
2916
2969
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2917
2970
|
});
|
|
2918
2971
|
};
|
|
2919
2972
|
}
|
|
2920
|
-
}),
|
|
2973
|
+
}), Er = e.object({
|
|
2921
2974
|
username: e.string(),
|
|
2922
2975
|
password: e.string(),
|
|
2923
2976
|
realm: e.string().optional()
|
|
2924
2977
|
});
|
|
2925
|
-
function
|
|
2978
|
+
function Dr(e, t) {
|
|
2926
2979
|
let n = `${e}:${t}`;
|
|
2927
2980
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2928
2981
|
}
|
|
2929
|
-
var
|
|
2982
|
+
var Or = G({
|
|
2930
2983
|
type: "basic_auth",
|
|
2931
|
-
optionsSchema:
|
|
2984
|
+
optionsSchema: Er,
|
|
2932
2985
|
build(e) {
|
|
2933
|
-
let t =
|
|
2986
|
+
let t = Dr(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2934
2987
|
return async (e, r) => {
|
|
2935
2988
|
let i = e.req.header("authorization");
|
|
2936
2989
|
if (i) {
|
|
@@ -2946,7 +2999,7 @@ var br = K({
|
|
|
2946
2999
|
});
|
|
2947
3000
|
};
|
|
2948
3001
|
}
|
|
2949
|
-
}),
|
|
3002
|
+
}), kr = G({
|
|
2950
3003
|
type: "headers",
|
|
2951
3004
|
optionsSchema: e.object({
|
|
2952
3005
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2956,23 +3009,23 @@ var br = K({
|
|
|
2956
3009
|
}),
|
|
2957
3010
|
build(e) {
|
|
2958
3011
|
return async (t, n) => {
|
|
2959
|
-
if ((e.request || e.remove_request) &&
|
|
3012
|
+
if ((e.request || e.remove_request) && Sr(t, (t) => {
|
|
2960
3013
|
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2961
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
3014
|
+
}), 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);
|
|
2962
3015
|
};
|
|
2963
3016
|
}
|
|
2964
|
-
}),
|
|
3017
|
+
}), Ar = G({
|
|
2965
3018
|
type: "cache",
|
|
2966
3019
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2967
3020
|
build(e) {
|
|
2968
3021
|
return async (t, n) => {
|
|
2969
3022
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2970
3023
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2971
|
-
|
|
3024
|
+
q(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2972
3025
|
}
|
|
2973
3026
|
};
|
|
2974
3027
|
}
|
|
2975
|
-
}),
|
|
3028
|
+
}), jr = [
|
|
2976
3029
|
"173.245.48.0/20",
|
|
2977
3030
|
"103.21.244.0/22",
|
|
2978
3031
|
"103.22.200.0/22",
|
|
@@ -2996,7 +3049,7 @@ var br = K({
|
|
|
2996
3049
|
"2a06:98c0::/29",
|
|
2997
3050
|
"2c0f:f248::/32"
|
|
2998
3051
|
];
|
|
2999
|
-
function
|
|
3052
|
+
function Mr(e) {
|
|
3000
3053
|
let t = e.split(".");
|
|
3001
3054
|
if (t.length !== 4) return null;
|
|
3002
3055
|
let n = [];
|
|
@@ -3008,14 +3061,14 @@ function wr(e) {
|
|
|
3008
3061
|
}
|
|
3009
3062
|
return n;
|
|
3010
3063
|
}
|
|
3011
|
-
function
|
|
3064
|
+
function Nr(e) {
|
|
3012
3065
|
if (e === "") return [];
|
|
3013
3066
|
let t = e.split(":"), n = [];
|
|
3014
3067
|
for (let e = 0; e < t.length; e++) {
|
|
3015
3068
|
let r = t[e];
|
|
3016
3069
|
if (r.includes(".")) {
|
|
3017
3070
|
if (e !== t.length - 1) return null;
|
|
3018
|
-
let i =
|
|
3071
|
+
let i = Mr(r);
|
|
3019
3072
|
if (!i) return null;
|
|
3020
3073
|
n.push(i[0] << 8 | i[1], i[2] << 8 | i[3]);
|
|
3021
3074
|
continue;
|
|
@@ -3025,14 +3078,14 @@ function Tr(e) {
|
|
|
3025
3078
|
}
|
|
3026
3079
|
return n;
|
|
3027
3080
|
}
|
|
3028
|
-
function
|
|
3081
|
+
function Pr(e) {
|
|
3029
3082
|
let t = e.split("::");
|
|
3030
3083
|
if (t.length > 2) return null;
|
|
3031
|
-
let n =
|
|
3084
|
+
let n = Nr(t[0] ?? "");
|
|
3032
3085
|
if (!n) return null;
|
|
3033
3086
|
let r;
|
|
3034
3087
|
if (t.length === 2) {
|
|
3035
|
-
let e =
|
|
3088
|
+
let e = Nr(t[1] ?? "");
|
|
3036
3089
|
if (!e) return null;
|
|
3037
3090
|
let i = 8 - n.length - e.length;
|
|
3038
3091
|
if (i < 1) return null;
|
|
@@ -3047,25 +3100,25 @@ function Er(e) {
|
|
|
3047
3100
|
for (let e of r) i.push(e >> 8 & 255, e & 255);
|
|
3048
3101
|
return i;
|
|
3049
3102
|
}
|
|
3050
|
-
function
|
|
3103
|
+
function Fr(e) {
|
|
3051
3104
|
let t = e.trim();
|
|
3052
3105
|
t.startsWith("[") && t.endsWith("]") && (t = t.slice(1, -1));
|
|
3053
3106
|
let n = t.indexOf("%");
|
|
3054
3107
|
if (n !== -1 && (t = t.slice(0, n)), t === "") return null;
|
|
3055
|
-
if (!t.includes(":")) return
|
|
3056
|
-
let r =
|
|
3108
|
+
if (!t.includes(":")) return Mr(t);
|
|
3109
|
+
let r = Pr(t);
|
|
3057
3110
|
return r ? r.slice(0, 10).every((e) => e === 0) && r[10] === 255 && r[11] === 255 ? r.slice(12) : r : null;
|
|
3058
3111
|
}
|
|
3059
|
-
function
|
|
3060
|
-
let [t, n] = e.split("/"), r =
|
|
3112
|
+
function Ir(e) {
|
|
3113
|
+
let [t, n] = e.split("/"), r = Fr(t ?? ""), i = Number(n);
|
|
3061
3114
|
if (!r || !Number.isInteger(i)) throw Error(`Invalid Cloudflare CIDR: ${e}`);
|
|
3062
3115
|
return {
|
|
3063
3116
|
bytes: r,
|
|
3064
3117
|
prefixBits: i
|
|
3065
3118
|
};
|
|
3066
3119
|
}
|
|
3067
|
-
var
|
|
3068
|
-
function
|
|
3120
|
+
var Lr = jr.map(Ir);
|
|
3121
|
+
function Rr(e, t) {
|
|
3069
3122
|
if (e.length !== t.bytes.length) return !1;
|
|
3070
3123
|
let n = t.prefixBits >> 3;
|
|
3071
3124
|
for (let r = 0; r < n; r++) if (e[r] !== t.bytes[r]) return !1;
|
|
@@ -3074,11 +3127,11 @@ function Ar(e, t) {
|
|
|
3074
3127
|
let i = 255 << 8 - r & 255;
|
|
3075
3128
|
return (e[n] & i) === (t.bytes[n] & i);
|
|
3076
3129
|
}
|
|
3077
|
-
function
|
|
3078
|
-
let t =
|
|
3079
|
-
return t ?
|
|
3130
|
+
function zr(e) {
|
|
3131
|
+
let t = Fr(e);
|
|
3132
|
+
return t ? Lr.some((e) => Rr(t, e)) : !1;
|
|
3080
3133
|
}
|
|
3081
|
-
var
|
|
3134
|
+
var Br = G({
|
|
3082
3135
|
type: "forwarded_headers",
|
|
3083
3136
|
optionsSchema: e.object({
|
|
3084
3137
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -3089,46 +3142,46 @@ var Mr = K({
|
|
|
3089
3142
|
build(e) {
|
|
3090
3143
|
return async (t, n) => {
|
|
3091
3144
|
let r = new URL(t.req.url);
|
|
3092
|
-
|
|
3145
|
+
Sr(t, (n) => {
|
|
3093
3146
|
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);
|
|
3094
|
-
let i = n.get(e.client_ip_header), a = i && e.skip_cloudflare_client_ip &&
|
|
3147
|
+
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;
|
|
3095
3148
|
n.set("x-forwarded-for", l), e.set_x_real_ip && n.set("x-real-ip", s);
|
|
3096
3149
|
}), await n();
|
|
3097
3150
|
};
|
|
3098
3151
|
}
|
|
3099
|
-
}),
|
|
3100
|
-
function
|
|
3152
|
+
}), Vr = e.object({ upstream_host: e.string().optional() });
|
|
3153
|
+
function Hr(e) {
|
|
3101
3154
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3102
3155
|
}
|
|
3103
|
-
function
|
|
3156
|
+
function Ur(e) {
|
|
3104
3157
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
3105
3158
|
let t = [];
|
|
3106
3159
|
return e.forEach((e, n) => {
|
|
3107
3160
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
3108
3161
|
}), t;
|
|
3109
3162
|
}
|
|
3110
|
-
var
|
|
3163
|
+
var Wr = G({
|
|
3111
3164
|
type: "rewrite_cookies",
|
|
3112
|
-
optionsSchema:
|
|
3165
|
+
optionsSchema: Vr,
|
|
3113
3166
|
build(e) {
|
|
3114
3167
|
return async (t, n) => {
|
|
3115
3168
|
await n();
|
|
3116
3169
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
3117
3170
|
if (!i) return;
|
|
3118
|
-
let a =
|
|
3171
|
+
let a = Ur(t.res.headers);
|
|
3119
3172
|
if (a.length === 0) return;
|
|
3120
|
-
let o =
|
|
3121
|
-
|
|
3173
|
+
let o = Hr(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
3174
|
+
q(t), t.res.headers.delete("set-cookie");
|
|
3122
3175
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
3123
3176
|
};
|
|
3124
3177
|
}
|
|
3125
|
-
}),
|
|
3178
|
+
}), Gr = G({
|
|
3126
3179
|
type: "rewrite_location",
|
|
3127
3180
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
3128
3181
|
build(e) {
|
|
3129
3182
|
return async (t, n) => {
|
|
3130
3183
|
if (await n(), t.res.headers.has("x-authhero-preserve-location")) {
|
|
3131
|
-
|
|
3184
|
+
q(t), t.res.headers.delete(sr);
|
|
3132
3185
|
return;
|
|
3133
3186
|
}
|
|
3134
3187
|
let r = t.res.status;
|
|
@@ -3145,10 +3198,10 @@ var Ir = K({
|
|
|
3145
3198
|
}
|
|
3146
3199
|
if (o.origin !== a) return;
|
|
3147
3200
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
3148
|
-
|
|
3201
|
+
q(t), t.res.headers.set("location", c);
|
|
3149
3202
|
};
|
|
3150
3203
|
}
|
|
3151
|
-
}),
|
|
3204
|
+
}), Kr = new Set([
|
|
3152
3205
|
"connection",
|
|
3153
3206
|
"keep-alive",
|
|
3154
3207
|
"proxy-authenticate",
|
|
@@ -3157,32 +3210,32 @@ var Ir = K({
|
|
|
3157
3210
|
"trailers",
|
|
3158
3211
|
"transfer-encoding",
|
|
3159
3212
|
"upgrade"
|
|
3160
|
-
]),
|
|
3213
|
+
]), qr = 3e4, Jr = e.object({
|
|
3161
3214
|
upstream_url: e.string(),
|
|
3162
3215
|
preserve_host: e.boolean().default(!1),
|
|
3163
3216
|
timeout_ms: e.number().int().positive().optional()
|
|
3164
3217
|
});
|
|
3165
|
-
function
|
|
3218
|
+
function Yr(e, t) {
|
|
3166
3219
|
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
3167
3220
|
}
|
|
3168
|
-
function
|
|
3221
|
+
function Xr(e) {
|
|
3169
3222
|
return e !== "GET" && e !== "HEAD";
|
|
3170
3223
|
}
|
|
3171
|
-
var
|
|
3172
|
-
function
|
|
3224
|
+
var Zr = 128 * 1024;
|
|
3225
|
+
function Qr(e) {
|
|
3173
3226
|
let t = e.headers.get("content-length");
|
|
3174
3227
|
if (t === null) return null;
|
|
3175
3228
|
let n = Number(t);
|
|
3176
3229
|
return Number.isInteger(n) && n >= 0 ? n : null;
|
|
3177
3230
|
}
|
|
3178
|
-
async function
|
|
3231
|
+
async function $r(e, t) {
|
|
3179
3232
|
let n = e.getReader(), r = !1, i = setTimeout(() => {
|
|
3180
3233
|
r = !0, n.cancel().catch(() => {});
|
|
3181
3234
|
}, t), a = [], o = 0;
|
|
3182
3235
|
try {
|
|
3183
3236
|
for (;;) {
|
|
3184
3237
|
let { done: e, value: i } = await n.read();
|
|
3185
|
-
if (r) throw new
|
|
3238
|
+
if (r) throw new z(t, "Request body read");
|
|
3186
3239
|
if (e) break;
|
|
3187
3240
|
a.push(i), o += i.byteLength;
|
|
3188
3241
|
}
|
|
@@ -3193,8 +3246,8 @@ async function Gr(e, t) {
|
|
|
3193
3246
|
for (let e of a) s.set(e, c), c += e.byteLength;
|
|
3194
3247
|
return s.buffer;
|
|
3195
3248
|
}
|
|
3196
|
-
function
|
|
3197
|
-
return
|
|
3249
|
+
function ei(e) {
|
|
3250
|
+
return B(e) ? new Response("Request body timeout", {
|
|
3198
3251
|
status: 408,
|
|
3199
3252
|
headers: { "x-authhero-proxy-error": "request_body_timeout" }
|
|
3200
3253
|
}) : new Response("Bad request", {
|
|
@@ -3202,20 +3255,20 @@ function Kr(e) {
|
|
|
3202
3255
|
headers: { "x-authhero-proxy-error": "request_body_failed" }
|
|
3203
3256
|
});
|
|
3204
3257
|
}
|
|
3205
|
-
async function
|
|
3206
|
-
if (!
|
|
3207
|
-
let r =
|
|
3208
|
-
if (r === null || r >
|
|
3209
|
-
let i = await
|
|
3258
|
+
async function ti(e, t, n) {
|
|
3259
|
+
if (!Xr(e.method) || !e.body) return;
|
|
3260
|
+
let r = Qr(e);
|
|
3261
|
+
if (r === null || r > Zr) return e.body;
|
|
3262
|
+
let i = await $r(e.body, n);
|
|
3210
3263
|
return t.set("content-length", String(i.byteLength)), i;
|
|
3211
3264
|
}
|
|
3212
|
-
async function
|
|
3265
|
+
async function ni(e, t, n) {
|
|
3213
3266
|
let r = new URL(t.url), i = new URL(e.upstream_url);
|
|
3214
|
-
i.pathname =
|
|
3267
|
+
i.pathname = Yr(i.pathname, r.pathname), i.search = r.search;
|
|
3215
3268
|
let a = new Headers(t.headers);
|
|
3216
|
-
for (let e of
|
|
3269
|
+
for (let e of Kr) a.delete(e);
|
|
3217
3270
|
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(":", ""));
|
|
3218
|
-
let o = await
|
|
3271
|
+
let o = await ti(t, a, n), s = {
|
|
3219
3272
|
method: t.method,
|
|
3220
3273
|
headers: a,
|
|
3221
3274
|
body: o,
|
|
@@ -3226,97 +3279,97 @@ async function Jr(e, t, n) {
|
|
|
3226
3279
|
init: s
|
|
3227
3280
|
};
|
|
3228
3281
|
}
|
|
3229
|
-
var
|
|
3282
|
+
var ri = G({
|
|
3230
3283
|
type: "http",
|
|
3231
|
-
optionsSchema:
|
|
3284
|
+
optionsSchema: Jr,
|
|
3232
3285
|
build(e) {
|
|
3233
|
-
let t = e.timeout_ms ??
|
|
3286
|
+
let t = e.timeout_ms ?? qr;
|
|
3234
3287
|
return async (n) => {
|
|
3235
|
-
let r =
|
|
3288
|
+
let r = K(n), i;
|
|
3236
3289
|
try {
|
|
3237
|
-
i = await
|
|
3290
|
+
i = await ni(e, r, t);
|
|
3238
3291
|
} catch (e) {
|
|
3239
|
-
return
|
|
3292
|
+
return ei(e);
|
|
3240
3293
|
}
|
|
3241
3294
|
let { target: a, init: o } = i;
|
|
3242
3295
|
n.set("__proxy_upstream_host__", a.hostname), n.set("__proxy_upstream_origin__", `${a.protocol}//${a.host}`);
|
|
3243
3296
|
try {
|
|
3244
|
-
return await
|
|
3297
|
+
return await V(t, (e) => fetch(a.toString(), {
|
|
3245
3298
|
...o,
|
|
3246
3299
|
signal: e
|
|
3247
3300
|
}));
|
|
3248
3301
|
} catch (e) {
|
|
3249
|
-
return
|
|
3302
|
+
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" });
|
|
3250
3303
|
}
|
|
3251
3304
|
};
|
|
3252
3305
|
}
|
|
3253
|
-
}),
|
|
3306
|
+
}), ii = 3e4, ai = e.object({
|
|
3254
3307
|
binding: e.string(),
|
|
3255
3308
|
upstream_url: e.string().optional(),
|
|
3256
3309
|
preserve_host: e.boolean().default(!0),
|
|
3257
3310
|
timeout_ms: e.number().int().positive().optional()
|
|
3258
3311
|
});
|
|
3259
|
-
function
|
|
3312
|
+
function oi(e) {
|
|
3260
3313
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
3261
3314
|
}
|
|
3262
|
-
var
|
|
3315
|
+
var si = G({
|
|
3263
3316
|
type: "service_binding",
|
|
3264
|
-
optionsSchema:
|
|
3317
|
+
optionsSchema: ai,
|
|
3265
3318
|
build(e, t) {
|
|
3266
3319
|
let n = t.bindings[e.binding];
|
|
3267
|
-
if (!
|
|
3268
|
-
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ??
|
|
3320
|
+
if (!oi(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
3321
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ?? ii;
|
|
3269
3322
|
return async (t) => {
|
|
3270
|
-
let a =
|
|
3323
|
+
let a = K(t), o;
|
|
3271
3324
|
try {
|
|
3272
|
-
o = await
|
|
3325
|
+
o = await ni({
|
|
3273
3326
|
upstream_url: r,
|
|
3274
3327
|
preserve_host: e.preserve_host
|
|
3275
3328
|
}, a, i);
|
|
3276
3329
|
} catch (e) {
|
|
3277
|
-
return
|
|
3330
|
+
return ei(e);
|
|
3278
3331
|
}
|
|
3279
3332
|
let { target: s, init: c } = o;
|
|
3280
3333
|
t.set("__proxy_upstream_host__", s.hostname), t.set("__proxy_upstream_origin__", `${s.protocol}//${s.host}`);
|
|
3281
3334
|
try {
|
|
3282
|
-
return await
|
|
3335
|
+
return await V(i, async (e) => n.fetch(new Request(s.toString(), {
|
|
3283
3336
|
...c,
|
|
3284
3337
|
signal: e
|
|
3285
3338
|
})));
|
|
3286
3339
|
} catch (e) {
|
|
3287
|
-
return
|
|
3340
|
+
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" });
|
|
3288
3341
|
}
|
|
3289
3342
|
};
|
|
3290
3343
|
}
|
|
3291
|
-
}),
|
|
3344
|
+
}), ci = 3e4, li = e.object({
|
|
3292
3345
|
binding: e.string(),
|
|
3293
3346
|
script_name: e.string(),
|
|
3294
3347
|
cpu_ms: e.number().int().positive().optional(),
|
|
3295
3348
|
subrequests: e.number().int().positive().optional(),
|
|
3296
3349
|
timeout_ms: e.number().int().positive().optional()
|
|
3297
3350
|
});
|
|
3298
|
-
function
|
|
3351
|
+
function ui(e) {
|
|
3299
3352
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
3300
3353
|
}
|
|
3301
|
-
var
|
|
3302
|
-
function
|
|
3303
|
-
return
|
|
3354
|
+
var J = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
3355
|
+
function di(e) {
|
|
3356
|
+
return J.lastIndex = 0, J.test(e);
|
|
3304
3357
|
}
|
|
3305
|
-
var
|
|
3358
|
+
var fi = G({
|
|
3306
3359
|
type: "dispatch_namespace",
|
|
3307
|
-
optionsSchema:
|
|
3360
|
+
optionsSchema: li,
|
|
3308
3361
|
build(e, t) {
|
|
3309
3362
|
let n = t.bindings[e.binding];
|
|
3310
|
-
if (!
|
|
3311
|
-
let r =
|
|
3363
|
+
if (!ui(n)) throw Error(`Dispatch namespace binding "${e.binding}" is not configured or does not expose .get()`);
|
|
3364
|
+
let r = di(e.script_name), i = e.timeout_ms ?? ci, a = e.cpu_ms || e.subrequests ? { limits: {
|
|
3312
3365
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
3313
3366
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
3314
3367
|
} } : void 0;
|
|
3315
3368
|
return async (t) => {
|
|
3316
3369
|
let o = e.script_name;
|
|
3317
3370
|
if (r) {
|
|
3318
|
-
let n =
|
|
3319
|
-
if (o = o.replace(
|
|
3371
|
+
let n = yr(t), r = br(t), i = xr(t), a = t.req.header("host") ?? t.req.header("x-forwarded-host") ?? "";
|
|
3372
|
+
if (o = o.replace(J, (e, t) => {
|
|
3320
3373
|
switch (t) {
|
|
3321
3374
|
case "tenant_id": return n ?? "";
|
|
3322
3375
|
case "custom_domain_id": return r ?? "";
|
|
@@ -3326,19 +3379,19 @@ var ii = K({
|
|
|
3326
3379
|
}
|
|
3327
3380
|
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
3328
3381
|
}
|
|
3329
|
-
let s =
|
|
3382
|
+
let s = K(t);
|
|
3330
3383
|
try {
|
|
3331
3384
|
let e = n.get(o, void 0, a);
|
|
3332
|
-
return await
|
|
3385
|
+
return await V(i, async (t) => {
|
|
3333
3386
|
let n = new Request(s, { signal: t });
|
|
3334
3387
|
return e.fetch(n);
|
|
3335
3388
|
});
|
|
3336
3389
|
} catch (e) {
|
|
3337
|
-
return
|
|
3390
|
+
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" });
|
|
3338
3391
|
}
|
|
3339
3392
|
};
|
|
3340
3393
|
}
|
|
3341
|
-
}),
|
|
3394
|
+
}), pi = G({
|
|
3342
3395
|
type: "redirect",
|
|
3343
3396
|
optionsSchema: e.object({
|
|
3344
3397
|
upstream_url: e.string().refine((e) => {
|
|
@@ -3367,7 +3420,7 @@ var ii = K({
|
|
|
3367
3420
|
});
|
|
3368
3421
|
};
|
|
3369
3422
|
}
|
|
3370
|
-
}),
|
|
3423
|
+
}), mi = G({
|
|
3371
3424
|
type: "static",
|
|
3372
3425
|
optionsSchema: e.object({
|
|
3373
3426
|
status: e.number().int().default(200),
|
|
@@ -3387,15 +3440,15 @@ var ii = K({
|
|
|
3387
3440
|
});
|
|
3388
3441
|
//#endregion
|
|
3389
3442
|
//#region src/data-plane/handlers/index.ts
|
|
3390
|
-
function
|
|
3391
|
-
e.add(
|
|
3443
|
+
function hi(e) {
|
|
3444
|
+
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);
|
|
3392
3445
|
}
|
|
3393
3446
|
//#endregion
|
|
3394
3447
|
//#region src/data-plane/matcher.ts
|
|
3395
|
-
function
|
|
3448
|
+
function gi(e) {
|
|
3396
3449
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
3397
3450
|
}
|
|
3398
|
-
function
|
|
3451
|
+
function _i(e, t) {
|
|
3399
3452
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
3400
3453
|
if (n === r) return !0;
|
|
3401
3454
|
if (n.startsWith("*.")) {
|
|
@@ -3404,13 +3457,13 @@ function li(e, t) {
|
|
|
3404
3457
|
}
|
|
3405
3458
|
return !1;
|
|
3406
3459
|
}
|
|
3407
|
-
function
|
|
3408
|
-
return !e || e.length === 0 ? !0 : e.some((e) =>
|
|
3460
|
+
function vi(e, t) {
|
|
3461
|
+
return !e || e.length === 0 ? !0 : e.some((e) => _i(e, t));
|
|
3409
3462
|
}
|
|
3410
|
-
function
|
|
3463
|
+
function yi(e) {
|
|
3411
3464
|
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;
|
|
3412
3465
|
return async (e, i) => {
|
|
3413
|
-
if (r && !
|
|
3466
|
+
if (r && !vi(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
3414
3467
|
for (let [n, r] of t) {
|
|
3415
3468
|
let t = e.req.header(n);
|
|
3416
3469
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -3427,17 +3480,17 @@ function di(e) {
|
|
|
3427
3480
|
}
|
|
3428
3481
|
//#endregion
|
|
3429
3482
|
//#region src/data-plane/compile.ts
|
|
3430
|
-
var
|
|
3431
|
-
function
|
|
3483
|
+
var bi = "forwarded_headers";
|
|
3484
|
+
function xi(e) {
|
|
3432
3485
|
return e.some((e) => e.type === "forwarded_headers") ? [...e] : [{
|
|
3433
|
-
type:
|
|
3486
|
+
type: bi,
|
|
3434
3487
|
options: {}
|
|
3435
3488
|
}, ...e];
|
|
3436
3489
|
}
|
|
3437
|
-
function
|
|
3438
|
-
return e.has("forwarded_headers") ?
|
|
3490
|
+
function Y(e, t) {
|
|
3491
|
+
return e.has("forwarded_headers") ? xi(t) : [...t];
|
|
3439
3492
|
}
|
|
3440
|
-
var
|
|
3493
|
+
var X = [
|
|
3441
3494
|
"GET",
|
|
3442
3495
|
"POST",
|
|
3443
3496
|
"PUT",
|
|
@@ -3449,39 +3502,39 @@ var mi = [
|
|
|
3449
3502
|
function Z(e, n, r, i) {
|
|
3450
3503
|
let a = new t();
|
|
3451
3504
|
r && a.use("*", async (e, t) => {
|
|
3452
|
-
|
|
3505
|
+
vr(e, r), await t();
|
|
3453
3506
|
});
|
|
3454
|
-
let o =
|
|
3507
|
+
let o = gi(e);
|
|
3455
3508
|
for (let e of o) {
|
|
3456
3509
|
let t = [];
|
|
3457
|
-
t.push(
|
|
3458
|
-
for (let r of
|
|
3459
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3510
|
+
t.push(yi(e.match));
|
|
3511
|
+
for (let r of Y(n, e.handlers)) t.push(n.build(r.type, r.options));
|
|
3512
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : X, i = e.match.path || "/*";
|
|
3460
3513
|
a.on(r, [i], ...t);
|
|
3461
3514
|
}
|
|
3462
|
-
return i && i.length > 0 ? a.on(
|
|
3463
|
-
let n =
|
|
3515
|
+
return i && i.length > 0 ? a.on(X, ["*"], ...i) : a.all("*", (e) => e.text("No matching route", 404)), a.onError((e, t) => {
|
|
3516
|
+
let n = B(e);
|
|
3464
3517
|
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3465
3518
|
}), a;
|
|
3466
3519
|
}
|
|
3467
3520
|
//#endregion
|
|
3468
3521
|
//#region src/data-plane/router.ts
|
|
3469
|
-
var
|
|
3470
|
-
function
|
|
3471
|
-
return e.resolver ? e.resolver : e.cache ?
|
|
3522
|
+
var Si = 1e4;
|
|
3523
|
+
function Ci(e) {
|
|
3524
|
+
return e.resolver ? e.resolver : e.cache ? W(e.data, e.cache) : W(e.data, e.cacheTtlMs ?? 3e4);
|
|
3472
3525
|
}
|
|
3473
|
-
function
|
|
3526
|
+
function wi(e) {
|
|
3474
3527
|
if (e.registry) return e.registry;
|
|
3475
|
-
let t = new
|
|
3476
|
-
return
|
|
3528
|
+
let t = new dr(e.bindings ?? {});
|
|
3529
|
+
return hi(t), t;
|
|
3477
3530
|
}
|
|
3478
3531
|
function Q(e) {
|
|
3479
|
-
let t =
|
|
3532
|
+
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;
|
|
3480
3533
|
return async (e) => {
|
|
3481
3534
|
let s = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3482
3535
|
if (!s) return e.text("Missing host", 400);
|
|
3483
3536
|
try {
|
|
3484
|
-
let c = await
|
|
3537
|
+
let c = await H(i, "resolveHost", void 0, (e) => t.resolveHost(s, { signal: e }));
|
|
3485
3538
|
if (!c) return o ? await o.fetch(e.req.raw) : e.text("Unknown host", 404);
|
|
3486
3539
|
let l = r.get(c);
|
|
3487
3540
|
return l || (l = Z(c.routes, n, {
|
|
@@ -3490,17 +3543,17 @@ function Q(e) {
|
|
|
3490
3543
|
domain: c.domain
|
|
3491
3544
|
}, a), r.set(c, l)), await l.fetch(e.req.raw);
|
|
3492
3545
|
} catch (t) {
|
|
3493
|
-
return o ? await o.fetch(e.req.raw) :
|
|
3546
|
+
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" });
|
|
3494
3547
|
}
|
|
3495
3548
|
};
|
|
3496
3549
|
}
|
|
3497
|
-
function
|
|
3550
|
+
function Ti(e) {
|
|
3498
3551
|
let n = new t();
|
|
3499
3552
|
return n.all("*", Q(e)), n;
|
|
3500
3553
|
}
|
|
3501
3554
|
//#endregion
|
|
3502
3555
|
//#region src/app.ts
|
|
3503
|
-
function
|
|
3556
|
+
function Ei(e) {
|
|
3504
3557
|
let n = new t();
|
|
3505
3558
|
return n.all("*", Q({
|
|
3506
3559
|
data: e.data,
|
|
@@ -3512,75 +3565,75 @@ function yi(e) {
|
|
|
3512
3565
|
resolveHostTimeoutMs: e.resolveHostTimeoutMs,
|
|
3513
3566
|
defaultHandlers: e.defaultHandlers
|
|
3514
3567
|
})), n.onError((e, t) => {
|
|
3515
|
-
let n =
|
|
3568
|
+
let n = B(e);
|
|
3516
3569
|
return t.text(n ? "Proxy timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "proxy_timeout" : "proxy_error" });
|
|
3517
3570
|
}), n;
|
|
3518
3571
|
}
|
|
3519
3572
|
//#endregion
|
|
3520
3573
|
//#region src/data-plane/cache-api-cache.ts
|
|
3521
|
-
var
|
|
3522
|
-
function
|
|
3574
|
+
var Di = 1e3, Oi = 1e3;
|
|
3575
|
+
function ki(e, t) {
|
|
3523
3576
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3524
3577
|
}
|
|
3525
|
-
function
|
|
3578
|
+
function Ai() {
|
|
3526
3579
|
return globalThis.caches?.default;
|
|
3527
3580
|
}
|
|
3528
|
-
function
|
|
3529
|
-
let t = e.cache ??
|
|
3581
|
+
function ji(e) {
|
|
3582
|
+
let t = e.cache ?? Ai();
|
|
3530
3583
|
if (!t) return e.upstream;
|
|
3531
|
-
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ??
|
|
3584
|
+
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;
|
|
3532
3585
|
async function l(e) {
|
|
3533
3586
|
try {
|
|
3534
|
-
return await
|
|
3587
|
+
return await U(Promise.resolve(n.match(e)), s, "cache.match");
|
|
3535
3588
|
} catch {
|
|
3536
3589
|
return;
|
|
3537
3590
|
}
|
|
3538
3591
|
}
|
|
3539
3592
|
return { async resolveHost(t, s) {
|
|
3540
|
-
let u =
|
|
3593
|
+
let u = ki(r, t), d = await l(u);
|
|
3541
3594
|
if (d) try {
|
|
3542
3595
|
return (await d.json()).value;
|
|
3543
3596
|
} catch {}
|
|
3544
3597
|
let f = await e.upstream.resolveHost(t, s), p = f === null ? a : i, m = new Response(JSON.stringify({ value: f }), { headers: {
|
|
3545
3598
|
"content-type": "application/json",
|
|
3546
3599
|
"cache-control": `public, max-age=${p}`
|
|
3547
|
-
} }), h =
|
|
3600
|
+
} }), h = U(Promise.resolve(n.put(u, m)), c, "cache.put").catch(() => void 0);
|
|
3548
3601
|
return o ? o(h) : await h, f;
|
|
3549
3602
|
} };
|
|
3550
3603
|
}
|
|
3551
|
-
function
|
|
3552
|
-
return
|
|
3604
|
+
function Mi(e, t) {
|
|
3605
|
+
return ki(e, t);
|
|
3553
3606
|
}
|
|
3554
3607
|
//#endregion
|
|
3555
3608
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3556
|
-
var
|
|
3557
|
-
function
|
|
3558
|
-
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 =
|
|
3609
|
+
var Ni = 1e3, Pi = 1e3, Fi = 5e3;
|
|
3610
|
+
function Ii(e) {
|
|
3611
|
+
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();
|
|
3559
3612
|
function m(e) {
|
|
3560
3613
|
return `${s}:${e.toLowerCase()}`;
|
|
3561
3614
|
}
|
|
3562
3615
|
async function h(e) {
|
|
3563
3616
|
try {
|
|
3564
|
-
return await
|
|
3617
|
+
return await U(n.get(e), l, "cache.get") ?? null;
|
|
3565
3618
|
} catch {
|
|
3566
3619
|
return null;
|
|
3567
3620
|
}
|
|
3568
3621
|
}
|
|
3569
3622
|
function g(e, t, r) {
|
|
3570
|
-
let i =
|
|
3623
|
+
let i = U(Promise.resolve().then(() => n.set(e, t, r)), u, "cache.set").catch(() => void 0);
|
|
3571
3624
|
return c ? (c(i), Promise.resolve()) : i;
|
|
3572
3625
|
}
|
|
3573
3626
|
function _(e, t) {
|
|
3574
3627
|
let n = p.get(e);
|
|
3575
3628
|
return n === void 0 ? !1 : t - n < f ? !0 : (p.delete(e), !1);
|
|
3576
3629
|
}
|
|
3577
|
-
function
|
|
3578
|
-
return d > 0 ?
|
|
3630
|
+
function ee(e, n) {
|
|
3631
|
+
return d > 0 ? H(d, "resolveHost", n, (n) => t.resolveHost(e, { signal: n })) : t.resolveHost(e, { signal: n });
|
|
3579
3632
|
}
|
|
3580
|
-
async function
|
|
3633
|
+
async function v(e, t) {
|
|
3581
3634
|
return p.set(e, Date.now()), (async () => {
|
|
3582
3635
|
try {
|
|
3583
|
-
let n = await
|
|
3636
|
+
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 = {
|
|
3584
3637
|
value: n,
|
|
3585
3638
|
freshUntilMs: s + c,
|
|
3586
3639
|
staleUntilMs: s + c + l,
|
|
@@ -3598,21 +3651,21 @@ function ki(e) {
|
|
|
3598
3651
|
if (n.freshUntilMs > r) return n.value;
|
|
3599
3652
|
if (n.staleUntilMs > r) {
|
|
3600
3653
|
if (!_(e, r)) {
|
|
3601
|
-
let t =
|
|
3654
|
+
let t = v(e).catch(() => void 0);
|
|
3602
3655
|
c && c(t);
|
|
3603
3656
|
}
|
|
3604
3657
|
return n.value;
|
|
3605
3658
|
}
|
|
3606
3659
|
}
|
|
3607
3660
|
try {
|
|
3608
|
-
return await
|
|
3661
|
+
return await v(e, t?.signal);
|
|
3609
3662
|
} catch (e) {
|
|
3610
3663
|
if (n && (n.staleIfErrorUntilMs ?? n.staleUntilMs) > r) return n.value;
|
|
3611
3664
|
throw e;
|
|
3612
3665
|
}
|
|
3613
3666
|
} };
|
|
3614
3667
|
}
|
|
3615
|
-
function
|
|
3668
|
+
function Li(e, t) {
|
|
3616
3669
|
return `${e}:${t.toLowerCase()}`;
|
|
3617
3670
|
}
|
|
3618
3671
|
//#endregion
|
|
@@ -3620,7 +3673,7 @@ function Ai(e, t) {
|
|
|
3620
3673
|
function $() {
|
|
3621
3674
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3622
3675
|
}
|
|
3623
|
-
function
|
|
3676
|
+
function Ri(e, t, n, r, i, a) {
|
|
3624
3677
|
return {
|
|
3625
3678
|
id: e.id ?? `${n}:${t}`,
|
|
3626
3679
|
tenant_id: r,
|
|
@@ -3635,10 +3688,10 @@ function ji(e, t, n, r, i, a) {
|
|
|
3635
3688
|
updated_at: e.updated_at ?? a
|
|
3636
3689
|
};
|
|
3637
3690
|
}
|
|
3638
|
-
function
|
|
3691
|
+
function zi(e) {
|
|
3639
3692
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3640
3693
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
3641
|
-
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) =>
|
|
3694
|
+
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);
|
|
3642
3695
|
r.set(e, {
|
|
3643
3696
|
tenant_id: s,
|
|
3644
3697
|
custom_domain_id: c,
|
|
@@ -3682,7 +3735,7 @@ function Mi(e) {
|
|
|
3682
3735
|
}
|
|
3683
3736
|
};
|
|
3684
3737
|
}
|
|
3685
|
-
function
|
|
3738
|
+
function Bi(e, t = {}) {
|
|
3686
3739
|
return {
|
|
3687
3740
|
priority: t.priority,
|
|
3688
3741
|
match: { path: t.path ?? "/*" },
|
|
@@ -3697,10 +3750,10 @@ function Ni(e, t = {}) {
|
|
|
3697
3750
|
}
|
|
3698
3751
|
//#endregion
|
|
3699
3752
|
//#region src/constants.ts
|
|
3700
|
-
var
|
|
3753
|
+
var Vi = "proxy:resolve_host";
|
|
3701
3754
|
//#endregion
|
|
3702
3755
|
//#region src/http-adapter/index.ts
|
|
3703
|
-
function
|
|
3756
|
+
function Hi() {
|
|
3704
3757
|
let e = () => {
|
|
3705
3758
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3706
3759
|
};
|
|
@@ -3722,12 +3775,12 @@ function Fi() {
|
|
|
3722
3775
|
}
|
|
3723
3776
|
};
|
|
3724
3777
|
}
|
|
3725
|
-
function
|
|
3778
|
+
function Ui(e) {
|
|
3726
3779
|
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;
|
|
3727
3780
|
function c(e, t) {
|
|
3728
|
-
let n = new AbortController(), r =
|
|
3781
|
+
let n = new AbortController(), r = cr([e, n.signal]) ?? n.signal, i, a = new Promise((e, t) => {
|
|
3729
3782
|
i = setTimeout(() => {
|
|
3730
|
-
n.abort(), t(new
|
|
3783
|
+
n.abort(), t(new z(s, "control plane"));
|
|
3731
3784
|
}, s);
|
|
3732
3785
|
});
|
|
3733
3786
|
return Promise.race([t(r), a]).finally(() => clearTimeout(i));
|
|
@@ -3759,7 +3812,7 @@ function Ii(e) {
|
|
|
3759
3812
|
return l && l.expires_at > Date.now() ? l.value : u(e);
|
|
3760
3813
|
}
|
|
3761
3814
|
return {
|
|
3762
|
-
proxyRoutes:
|
|
3815
|
+
proxyRoutes: Hi(),
|
|
3763
3816
|
async resolveHost(e, i) {
|
|
3764
3817
|
let a = i?.signal, o = await d(a), s = `${n}${r}${encodeURIComponent(e.toLowerCase())}`;
|
|
3765
3818
|
return c(a, async (e) => {
|
|
@@ -3776,7 +3829,7 @@ function Ii(e) {
|
|
|
3776
3829
|
}
|
|
3777
3830
|
//#endregion
|
|
3778
3831
|
//#region src/http-adapter/service-binding-fetch.ts
|
|
3779
|
-
function
|
|
3832
|
+
function Wi(e) {
|
|
3780
3833
|
return (t, n) => {
|
|
3781
3834
|
let r = t instanceof Request && n === void 0 ? t : new Request(t, n);
|
|
3782
3835
|
return e.fetch(r);
|
|
@@ -3784,11 +3837,11 @@ function Li(e) {
|
|
|
3784
3837
|
}
|
|
3785
3838
|
//#endregion
|
|
3786
3839
|
//#region src/kv-adapter/index.ts
|
|
3787
|
-
var
|
|
3788
|
-
function
|
|
3840
|
+
var Gi = "authhero-proxy-host:";
|
|
3841
|
+
function Ki(e, t) {
|
|
3789
3842
|
return `${e}${t.toLowerCase()}`;
|
|
3790
3843
|
}
|
|
3791
|
-
function
|
|
3844
|
+
function qi() {
|
|
3792
3845
|
let e = () => {
|
|
3793
3846
|
throw Error("KV proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3794
3847
|
};
|
|
@@ -3810,15 +3863,15 @@ function Bi() {
|
|
|
3810
3863
|
}
|
|
3811
3864
|
};
|
|
3812
3865
|
}
|
|
3813
|
-
function
|
|
3814
|
-
let { kv: t, keyPrefix: n =
|
|
3866
|
+
function Ji(e) {
|
|
3867
|
+
let { kv: t, keyPrefix: n = Gi, timeoutMs: r } = e;
|
|
3815
3868
|
return {
|
|
3816
|
-
proxyRoutes:
|
|
3869
|
+
proxyRoutes: qi(),
|
|
3817
3870
|
async resolveHost(e) {
|
|
3818
|
-
let i =
|
|
3819
|
-
return (r && r > 0 ? await
|
|
3871
|
+
let i = Ki(n, e), a = t.get(i, "json");
|
|
3872
|
+
return (r && r > 0 ? await U(a, r, "kv.get") : await a) ?? null;
|
|
3820
3873
|
}
|
|
3821
3874
|
};
|
|
3822
3875
|
}
|
|
3823
3876
|
//#endregion
|
|
3824
|
-
export {
|
|
3877
|
+
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 };
|