@authhero/proxy 0.10.13 → 0.10.14
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.mjs
CHANGED
|
@@ -98,7 +98,7 @@ var h = e.enum([
|
|
|
98
98
|
"admin_action",
|
|
99
99
|
"system",
|
|
100
100
|
"api"
|
|
101
|
-
]),
|
|
101
|
+
]), g = e.object({
|
|
102
102
|
type: e.enum([
|
|
103
103
|
"user",
|
|
104
104
|
"admin",
|
|
@@ -112,7 +112,7 @@ var h = e.enum([
|
|
|
112
112
|
org_name: e.string().optional(),
|
|
113
113
|
scopes: e.array(e.string()).optional(),
|
|
114
114
|
client_id: e.string().optional()
|
|
115
|
-
}),
|
|
115
|
+
}), _ = e.object({
|
|
116
116
|
type: e.string(),
|
|
117
117
|
id: e.string(),
|
|
118
118
|
before: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -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()
|
|
@@ -151,10 +151,10 @@ e.object({
|
|
|
151
151
|
log_type: e.string(),
|
|
152
152
|
description: e.string().optional(),
|
|
153
153
|
category: h,
|
|
154
|
-
actor:
|
|
155
|
-
target:
|
|
156
|
-
request:
|
|
157
|
-
response:
|
|
154
|
+
actor: g,
|
|
155
|
+
target: _,
|
|
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 oe = 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 oe = 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 oe = 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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
}), ce = e.union([
|
|
227
|
+
ie,
|
|
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 fe = 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 fe = 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 fe = 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 @@ he.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",
|
|
@@ -457,8 +457,8 @@ var ge = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", _e
|
|
|
457
457
|
e.object({
|
|
458
458
|
created_at: e.string(),
|
|
459
459
|
updated_at: e.string()
|
|
460
|
-
}).extend(
|
|
461
|
-
var
|
|
460
|
+
}).extend(he.shape).extend({ client_id: e.string() });
|
|
461
|
+
var ge = e.object({
|
|
462
462
|
client_id: e.string().min(1).openapi({ description: "ID of the client." }),
|
|
463
463
|
audience: e.string().min(1).openapi({ description: "The audience (API identifier) of this client grant." }),
|
|
464
464
|
scope: e.array(e.string()).optional().openapi({ description: "Scopes allowed for this client grant." }),
|
|
@@ -471,15 +471,15 @@ var ye = e.object({
|
|
|
471
471
|
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
472
|
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
473
|
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
|
-
}),
|
|
474
|
+
}), _e = e.object({ id: e.string().openapi({ description: "ID of the client grant." }) }).extend(ge.shape).extend({
|
|
475
475
|
created_at: e.string().optional(),
|
|
476
476
|
updated_at: e.string().optional()
|
|
477
477
|
});
|
|
478
|
-
e.array(
|
|
479
|
-
var
|
|
478
|
+
e.array(_e);
|
|
479
|
+
var ve = e.enum(["iat", "rat"]), ye = e.object({
|
|
480
480
|
id: e.string(),
|
|
481
481
|
token_hash: e.string(),
|
|
482
|
-
type:
|
|
482
|
+
type: ve,
|
|
483
483
|
client_id: e.string().optional(),
|
|
484
484
|
sub: e.string().optional(),
|
|
485
485
|
constraints: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -490,23 +490,23 @@ e.object({
|
|
|
490
490
|
created_at: e.string(),
|
|
491
491
|
used_at: e.string().optional(),
|
|
492
492
|
revoked_at: e.string().optional()
|
|
493
|
-
}).extend(
|
|
494
|
-
var
|
|
493
|
+
}).extend(ye.shape);
|
|
494
|
+
var y = e.object({
|
|
495
495
|
x: e.number(),
|
|
496
496
|
y: e.number()
|
|
497
|
-
}),
|
|
497
|
+
}), be = /* @__PURE__ */ function(e) {
|
|
498
498
|
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
|
-
}({}),
|
|
499
|
+
}({}), xe = /* @__PURE__ */ function(e) {
|
|
500
500
|
return e.BLOCK = "BLOCK", e.FIELD = "FIELD", e;
|
|
501
|
-
}({}),
|
|
501
|
+
}({}), b = e.object({
|
|
502
502
|
id: e.string(),
|
|
503
|
-
category: e.nativeEnum(
|
|
504
|
-
type: e.nativeEnum(
|
|
505
|
-
}),
|
|
503
|
+
category: e.nativeEnum(xe),
|
|
504
|
+
type: e.nativeEnum(be)
|
|
505
|
+
}), Se = b.extend({
|
|
506
506
|
category: e.literal("BLOCK"),
|
|
507
507
|
type: e.literal("RICH_TEXT"),
|
|
508
508
|
config: e.object({ content: e.string() }).passthrough()
|
|
509
|
-
}),
|
|
509
|
+
}), Ce = b.extend({
|
|
510
510
|
category: e.literal("BLOCK"),
|
|
511
511
|
type: e.union([
|
|
512
512
|
e.literal("NEXT_BUTTON"),
|
|
@@ -514,13 +514,13 @@ var g = e.object({
|
|
|
514
514
|
e.literal("SUBMIT_BUTTON")
|
|
515
515
|
]),
|
|
516
516
|
config: e.object({ text: e.string() }).passthrough()
|
|
517
|
-
}),
|
|
517
|
+
}), we = b.extend({
|
|
518
518
|
category: e.literal("FIELD"),
|
|
519
519
|
type: e.literal("LEGAL"),
|
|
520
520
|
required: e.boolean().optional(),
|
|
521
521
|
sensitive: e.boolean().optional(),
|
|
522
522
|
config: e.object({ text: e.string() }).passthrough()
|
|
523
|
-
}),
|
|
523
|
+
}), Te = b.extend({
|
|
524
524
|
category: e.literal("FIELD"),
|
|
525
525
|
type: e.union([
|
|
526
526
|
e.literal("TEXT"),
|
|
@@ -540,38 +540,38 @@ var g = e.object({
|
|
|
540
540
|
label: e.string().optional(),
|
|
541
541
|
placeholder: e.string().optional()
|
|
542
542
|
}).passthrough()
|
|
543
|
-
}),
|
|
543
|
+
}), Ee = e.object({
|
|
544
544
|
id: e.string(),
|
|
545
545
|
category: e.string(),
|
|
546
546
|
type: e.string()
|
|
547
|
-
}).passthrough(),
|
|
547
|
+
}).passthrough(), De = e.union([
|
|
548
|
+
Se,
|
|
549
|
+
Ce,
|
|
550
|
+
we,
|
|
548
551
|
Te,
|
|
549
|
-
Ee
|
|
550
|
-
|
|
551
|
-
Oe,
|
|
552
|
-
ke
|
|
553
|
-
]), je = e.object({
|
|
552
|
+
Ee
|
|
553
|
+
]), Oe = e.object({
|
|
554
554
|
id: e.string(),
|
|
555
555
|
type: e.literal("STEP"),
|
|
556
|
-
coordinates:
|
|
556
|
+
coordinates: y,
|
|
557
557
|
alias: e.string().optional(),
|
|
558
558
|
config: e.object({
|
|
559
|
-
components: e.array(
|
|
559
|
+
components: e.array(De),
|
|
560
560
|
next_node: e.string()
|
|
561
561
|
}).passthrough()
|
|
562
|
-
}),
|
|
562
|
+
}), ke = e.object({
|
|
563
563
|
id: e.string(),
|
|
564
564
|
type: e.literal("FLOW"),
|
|
565
|
-
coordinates:
|
|
565
|
+
coordinates: y,
|
|
566
566
|
alias: e.string().optional(),
|
|
567
567
|
config: e.object({
|
|
568
568
|
flow_id: e.string(),
|
|
569
569
|
next_node: e.string()
|
|
570
570
|
})
|
|
571
|
-
}),
|
|
571
|
+
}), Ae = e.object({
|
|
572
572
|
id: e.string(),
|
|
573
573
|
type: e.literal("ACTION"),
|
|
574
|
-
coordinates:
|
|
574
|
+
coordinates: y,
|
|
575
575
|
alias: e.string().optional(),
|
|
576
576
|
config: e.object({
|
|
577
577
|
action_type: e.enum(["REDIRECT"]).openapi({ description: "The type of action to perform" }),
|
|
@@ -583,29 +583,29 @@ var g = e.object({
|
|
|
583
583
|
custom_url: e.string().optional().openapi({ description: "Custom URL when target is 'custom'" }),
|
|
584
584
|
next_node: e.string().openapi({ description: "The next node to navigate to after action (for non-redirect actions)" })
|
|
585
585
|
}).passthrough()
|
|
586
|
-
}),
|
|
586
|
+
}), je = e.object({
|
|
587
587
|
id: e.string(),
|
|
588
588
|
type: e.string(),
|
|
589
|
-
coordinates:
|
|
590
|
-
}).passthrough(),
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
]),
|
|
589
|
+
coordinates: y
|
|
590
|
+
}).passthrough(), Me = e.union([
|
|
591
|
+
Oe,
|
|
592
|
+
ke,
|
|
593
|
+
Ae,
|
|
594
|
+
je
|
|
595
|
+
]), Ne = e.object({
|
|
596
596
|
next_node: e.string(),
|
|
597
|
-
coordinates:
|
|
598
|
-
}).passthrough(),
|
|
597
|
+
coordinates: y
|
|
598
|
+
}).passthrough(), Pe = e.object({
|
|
599
599
|
resume_flow: e.boolean().optional(),
|
|
600
|
-
coordinates:
|
|
600
|
+
coordinates: y
|
|
601
601
|
}).passthrough();
|
|
602
602
|
e.object({
|
|
603
603
|
id: e.string(),
|
|
604
604
|
name: e.string(),
|
|
605
605
|
languages: e.object({ primary: e.string() }).passthrough(),
|
|
606
|
-
nodes: e.array(
|
|
607
|
-
start:
|
|
608
|
-
ending:
|
|
606
|
+
nodes: e.array(Me),
|
|
607
|
+
start: Ne,
|
|
608
|
+
ending: Pe,
|
|
609
609
|
created_at: e.string(),
|
|
610
610
|
updated_at: e.string(),
|
|
611
611
|
links: e.object({
|
|
@@ -617,24 +617,24 @@ e.object({
|
|
|
617
617
|
created_at: !0,
|
|
618
618
|
updated_at: !0
|
|
619
619
|
});
|
|
620
|
-
var
|
|
620
|
+
var Fe = /* @__PURE__ */ function(e) {
|
|
621
621
|
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
|
-
}({}),
|
|
622
|
+
}({}), x = /* @__PURE__ */ function(e) {
|
|
623
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
|
-
}({}),
|
|
624
|
+
}({}), Ie = /* @__PURE__ */ function(e) {
|
|
625
625
|
return e.S256 = "S256", e.Plain = "plain", e;
|
|
626
|
-
}({}),
|
|
626
|
+
}({}), S = e.union([e.null(), e.object({
|
|
627
627
|
essential: e.boolean().optional(),
|
|
628
628
|
value: e.unknown().optional(),
|
|
629
629
|
values: e.array(e.unknown()).optional()
|
|
630
|
-
})]).nullable(),
|
|
631
|
-
userinfo: e.record(e.string(),
|
|
632
|
-
id_token: e.record(e.string(),
|
|
633
|
-
}),
|
|
630
|
+
})]).nullable(), Le = e.object({
|
|
631
|
+
userinfo: e.record(e.string(), S).optional(),
|
|
632
|
+
id_token: e.record(e.string(), S).optional()
|
|
633
|
+
}), Re = e.object({
|
|
634
634
|
client_id: e.string(),
|
|
635
635
|
act_as: e.string().optional(),
|
|
636
|
-
response_type: e.nativeEnum(
|
|
637
|
-
response_mode: e.nativeEnum(
|
|
636
|
+
response_type: e.nativeEnum(Fe).optional(),
|
|
637
|
+
response_mode: e.nativeEnum(x).optional(),
|
|
638
638
|
redirect_uri: e.string().optional(),
|
|
639
639
|
audience: e.string().optional(),
|
|
640
640
|
organization: e.string().optional(),
|
|
@@ -642,13 +642,13 @@ var Re = /* @__PURE__ */ function(e) {
|
|
|
642
642
|
nonce: e.string().optional(),
|
|
643
643
|
scope: e.string().optional(),
|
|
644
644
|
prompt: e.string().optional(),
|
|
645
|
-
code_challenge_method: e.nativeEnum(
|
|
645
|
+
code_challenge_method: e.nativeEnum(Ie).optional(),
|
|
646
646
|
code_challenge: e.string().optional(),
|
|
647
647
|
username: e.string().optional(),
|
|
648
648
|
ui_locales: e.string().optional(),
|
|
649
649
|
max_age: e.number().optional(),
|
|
650
650
|
acr_values: e.string().optional(),
|
|
651
|
-
claims:
|
|
651
|
+
claims: Le.optional(),
|
|
652
652
|
vendor_id: e.string().optional()
|
|
653
653
|
});
|
|
654
654
|
e.object({
|
|
@@ -671,7 +671,7 @@ e.object({
|
|
|
671
671
|
"auto"
|
|
672
672
|
]).optional()
|
|
673
673
|
});
|
|
674
|
-
var
|
|
674
|
+
var ze = e.enum([
|
|
675
675
|
"password_reset",
|
|
676
676
|
"email_verification",
|
|
677
677
|
"otp",
|
|
@@ -685,7 +685,7 @@ e.object({
|
|
|
685
685
|
code_id: e.string().openapi({ description: "The code that will be used in for instance an email verification flow" }),
|
|
686
686
|
login_id: e.string().optional().openapi({ description: "The id of the login session that the code is connected to" }),
|
|
687
687
|
connection_id: e.string().optional().openapi({ description: "The connection that the code is connected to" }),
|
|
688
|
-
code_type:
|
|
688
|
+
code_type: ze,
|
|
689
689
|
code_verifier: e.string().optional().openapi({ description: "The code verifier used in PKCE in outbound flows" }),
|
|
690
690
|
code_challenge: e.string().optional().openapi({ description: "The code challenge used in PKCE in outbound flows" }),
|
|
691
691
|
code_challenge_method: e.enum(["plain", "S256"]).optional().openapi({ description: "The code challenge method used in PKCE in outbound flows" }),
|
|
@@ -697,7 +697,7 @@ e.object({
|
|
|
697
697
|
used_at: e.string().optional(),
|
|
698
698
|
user_id: e.string().optional()
|
|
699
699
|
}).extend({ created_at: e.string() });
|
|
700
|
-
var
|
|
700
|
+
var Be = e.object({
|
|
701
701
|
kid: e.string().optional(),
|
|
702
702
|
team_id: e.string().optional(),
|
|
703
703
|
realms: e.string().optional(),
|
|
@@ -817,26 +817,26 @@ var Ge = e.object({
|
|
|
817
817
|
"never_on_login"
|
|
818
818
|
]).optional()
|
|
819
819
|
});
|
|
820
|
-
function
|
|
820
|
+
function C(e) {
|
|
821
821
|
if (e !== null) {
|
|
822
|
-
if (Array.isArray(e)) return e.filter((e) => e !== null).map(
|
|
822
|
+
if (Array.isArray(e)) return e.filter((e) => e !== null).map(C);
|
|
823
823
|
if (e && typeof e == "object") {
|
|
824
824
|
let t = {};
|
|
825
|
-
for (let [n, r] of Object.entries(e)) r !== null && (t[n] =
|
|
825
|
+
for (let [n, r] of Object.entries(e)) r !== null && (t[n] = C(r));
|
|
826
826
|
return t;
|
|
827
827
|
}
|
|
828
828
|
return e;
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
|
-
var
|
|
831
|
+
var Ve = e.object({
|
|
832
832
|
id: e.string().optional(),
|
|
833
833
|
name: e.string(),
|
|
834
834
|
display_name: e.string().optional(),
|
|
835
835
|
strategy: e.string(),
|
|
836
|
-
options: e.preprocess((e) => e === null ? {} :
|
|
836
|
+
options: e.preprocess((e) => e === null ? {} : C(e), Be).default({}),
|
|
837
837
|
enabled_clients: e.array(e.string()).default([]).optional(),
|
|
838
|
-
response_type: e.nativeEnum(
|
|
839
|
-
response_mode: e.nativeEnum(
|
|
838
|
+
response_type: e.nativeEnum(Fe).optional(),
|
|
839
|
+
response_mode: e.nativeEnum(x).optional(),
|
|
840
840
|
is_domain_connection: e.boolean().optional(),
|
|
841
841
|
show_as_button: e.boolean().optional(),
|
|
842
842
|
metadata: e.record(e.string(), e.any()).optional(),
|
|
@@ -846,8 +846,8 @@ e.object({
|
|
|
846
846
|
id: e.string(),
|
|
847
847
|
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
848
848
|
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
849
|
-
}).extend(
|
|
850
|
-
var
|
|
849
|
+
}).extend(Ve.shape);
|
|
850
|
+
var He = e.object({
|
|
851
851
|
domain: e.string(),
|
|
852
852
|
custom_domain_id: e.string().optional(),
|
|
853
853
|
type: e.enum(["auth0_managed_certs", "self_managed_certs"]),
|
|
@@ -861,7 +861,7 @@ var qe = e.object({
|
|
|
861
861
|
"null"
|
|
862
862
|
]).optional(),
|
|
863
863
|
domain_metadata: e.record(e.string(), e.string().max(255)).optional()
|
|
864
|
-
}),
|
|
864
|
+
}), Ue = e.discriminatedUnion("name", [e.object({
|
|
865
865
|
name: e.literal("txt"),
|
|
866
866
|
record: e.string(),
|
|
867
867
|
domain: e.string()
|
|
@@ -869,7 +869,7 @@ var qe = e.object({
|
|
|
869
869
|
name: e.literal("http"),
|
|
870
870
|
http_body: e.string(),
|
|
871
871
|
http_url: e.string()
|
|
872
|
-
})]),
|
|
872
|
+
})]), We = He.extend({
|
|
873
873
|
custom_domain_id: e.string(),
|
|
874
874
|
primary: e.boolean(),
|
|
875
875
|
status: e.enum([
|
|
@@ -879,28 +879,28 @@ var qe = e.object({
|
|
|
879
879
|
"ready"
|
|
880
880
|
]),
|
|
881
881
|
origin_domain_name: e.string().optional(),
|
|
882
|
-
verification: e.object({ methods: e.array(
|
|
882
|
+
verification: e.object({ methods: e.array(Ue) }).optional(),
|
|
883
883
|
tls_policy: e.string().optional()
|
|
884
884
|
});
|
|
885
|
-
|
|
885
|
+
He.pick({
|
|
886
886
|
tls_policy: !0,
|
|
887
887
|
custom_client_ip_header: !0,
|
|
888
888
|
domain_metadata: !0
|
|
889
|
-
}).strict(),
|
|
889
|
+
}).strict(), We.extend({ tenant_id: e.string() }), e.object({
|
|
890
890
|
certificate: e.string().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/, "must be PEM-encoded; include the full certificate chain in leaf-first order"),
|
|
891
891
|
private_key: e.string().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/, "must be a PEM-encoded private key")
|
|
892
892
|
});
|
|
893
|
-
var
|
|
893
|
+
var w = e.object({
|
|
894
894
|
id: e.string(),
|
|
895
895
|
order: e.number().optional(),
|
|
896
896
|
visible: e.boolean().optional().default(!0)
|
|
897
|
-
}),
|
|
897
|
+
}), T = w.extend({ category: e.literal("BLOCK").optional() }), Ge = T.extend({
|
|
898
898
|
type: e.literal("DIVIDER"),
|
|
899
899
|
config: e.object({ text: e.string().optional() }).optional()
|
|
900
|
-
}),
|
|
900
|
+
}), Ke = T.extend({
|
|
901
901
|
type: e.literal("HTML"),
|
|
902
902
|
config: e.object({ content: e.string().optional() }).optional()
|
|
903
|
-
}),
|
|
903
|
+
}), qe = T.extend({
|
|
904
904
|
type: e.literal("IMAGE"),
|
|
905
905
|
config: e.object({
|
|
906
906
|
src: e.string().optional(),
|
|
@@ -908,43 +908,43 @@ var y = e.object({
|
|
|
908
908
|
width: e.number().optional(),
|
|
909
909
|
height: e.number().optional()
|
|
910
910
|
}).optional()
|
|
911
|
-
}),
|
|
911
|
+
}), Je = T.extend({
|
|
912
912
|
type: e.literal("JUMP_BUTTON"),
|
|
913
913
|
config: e.object({
|
|
914
914
|
text: e.string().optional(),
|
|
915
915
|
target_step: e.string().optional()
|
|
916
916
|
})
|
|
917
|
-
}),
|
|
917
|
+
}), Ye = T.extend({
|
|
918
918
|
type: e.literal("RESEND_BUTTON"),
|
|
919
919
|
config: e.object({
|
|
920
920
|
text: e.string().optional(),
|
|
921
921
|
resend_action: e.string().optional()
|
|
922
922
|
})
|
|
923
|
-
}),
|
|
923
|
+
}), Xe = T.extend({
|
|
924
924
|
type: e.literal("NEXT_BUTTON"),
|
|
925
925
|
config: e.object({ text: e.string().optional() })
|
|
926
|
-
}),
|
|
926
|
+
}), Ze = T.extend({
|
|
927
927
|
type: e.literal("PREVIOUS_BUTTON"),
|
|
928
928
|
config: e.object({ text: e.string().optional() })
|
|
929
|
-
}),
|
|
929
|
+
}), Qe = T.extend({
|
|
930
930
|
type: e.literal("RICH_TEXT"),
|
|
931
931
|
config: e.object({ content: e.string().optional() }).optional()
|
|
932
|
-
}),
|
|
932
|
+
}), E = w.extend({
|
|
933
933
|
category: e.literal("WIDGET").optional(),
|
|
934
934
|
label: e.string().min(1).optional(),
|
|
935
935
|
hint: e.string().min(1).max(500).optional(),
|
|
936
936
|
required: e.boolean().optional(),
|
|
937
937
|
sensitive: e.boolean().optional()
|
|
938
|
-
}),
|
|
938
|
+
}), $e = E.extend({
|
|
939
939
|
type: e.literal("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
940
940
|
config: e.object({ credential_type: e.string().optional() })
|
|
941
|
-
}),
|
|
941
|
+
}), et = E.extend({
|
|
942
942
|
type: e.literal("GMAPS_ADDRESS"),
|
|
943
943
|
config: e.object({ api_key: e.string().optional() })
|
|
944
|
-
}),
|
|
944
|
+
}), tt = E.extend({
|
|
945
945
|
type: e.literal("RECAPTCHA"),
|
|
946
946
|
config: e.object({ site_key: e.string().optional() })
|
|
947
|
-
}),
|
|
947
|
+
}), D = w.extend({
|
|
948
948
|
category: e.literal("FIELD").optional(),
|
|
949
949
|
label: e.string().min(1).optional(),
|
|
950
950
|
hint: e.string().min(1).max(500).optional(),
|
|
@@ -960,10 +960,10 @@ var y = e.object({
|
|
|
960
960
|
})).optional(),
|
|
961
961
|
required: e.boolean().optional(),
|
|
962
962
|
sensitive: e.boolean().optional()
|
|
963
|
-
}),
|
|
963
|
+
}), nt = D.extend({
|
|
964
964
|
type: e.literal("BOOLEAN"),
|
|
965
965
|
config: e.object({ default_value: e.boolean().optional() }).optional()
|
|
966
|
-
}),
|
|
966
|
+
}), rt = D.extend({
|
|
967
967
|
type: e.literal("CARDS"),
|
|
968
968
|
config: e.object({
|
|
969
969
|
options: e.array(e.object({
|
|
@@ -974,7 +974,7 @@ var y = e.object({
|
|
|
974
974
|
})).optional(),
|
|
975
975
|
multi_select: e.boolean().optional()
|
|
976
976
|
}).optional()
|
|
977
|
-
}),
|
|
977
|
+
}), it = D.extend({
|
|
978
978
|
type: e.literal("CHOICE"),
|
|
979
979
|
config: e.object({
|
|
980
980
|
options: e.array(e.object({
|
|
@@ -985,7 +985,7 @@ var y = e.object({
|
|
|
985
985
|
multiple: e.boolean().optional(),
|
|
986
986
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
987
987
|
}).optional()
|
|
988
|
-
}),
|
|
988
|
+
}), at = D.extend({
|
|
989
989
|
type: e.literal("CODE"),
|
|
990
990
|
config: e.object({
|
|
991
991
|
length: e.number().int().positive().max(100).optional(),
|
|
@@ -1002,7 +1002,7 @@ var y = e.object({
|
|
|
1002
1002
|
message: "default_value is longer than the configured length",
|
|
1003
1003
|
path: ["default_value"]
|
|
1004
1004
|
}).optional()
|
|
1005
|
-
}),
|
|
1005
|
+
}), ot = D.extend({
|
|
1006
1006
|
type: e.literal("CUSTOM"),
|
|
1007
1007
|
config: e.object({
|
|
1008
1008
|
component: e.string().optional(),
|
|
@@ -1010,7 +1010,7 @@ var y = e.object({
|
|
|
1010
1010
|
schema: e.record(e.string(), e.any()).optional(),
|
|
1011
1011
|
code: e.string().optional()
|
|
1012
1012
|
})
|
|
1013
|
-
}),
|
|
1013
|
+
}), st = D.extend({
|
|
1014
1014
|
type: e.literal("DATE"),
|
|
1015
1015
|
config: e.object({
|
|
1016
1016
|
format: e.string().optional(),
|
|
@@ -1018,7 +1018,7 @@ var y = e.object({
|
|
|
1018
1018
|
max: e.string().optional(),
|
|
1019
1019
|
default_value: e.string().optional()
|
|
1020
1020
|
}).optional()
|
|
1021
|
-
}),
|
|
1021
|
+
}), ct = D.extend({
|
|
1022
1022
|
type: e.literal("DROPDOWN"),
|
|
1023
1023
|
config: e.object({
|
|
1024
1024
|
options: e.array(e.object({
|
|
@@ -1030,7 +1030,7 @@ var y = e.object({
|
|
|
1030
1030
|
multiple: e.boolean().optional(),
|
|
1031
1031
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
1032
1032
|
}).optional()
|
|
1033
|
-
}),
|
|
1033
|
+
}), lt = D.extend({
|
|
1034
1034
|
type: e.literal("EMAIL"),
|
|
1035
1035
|
config: e.object({
|
|
1036
1036
|
placeholder: e.string().optional(),
|
|
@@ -1038,20 +1038,20 @@ var y = e.object({
|
|
|
1038
1038
|
last_used: e.boolean().optional(),
|
|
1039
1039
|
last_used_label: e.string().optional()
|
|
1040
1040
|
}).optional()
|
|
1041
|
-
}),
|
|
1041
|
+
}), ut = D.extend({
|
|
1042
1042
|
type: e.literal("FILE"),
|
|
1043
1043
|
config: e.object({
|
|
1044
1044
|
accept: e.string().optional(),
|
|
1045
1045
|
max_size: e.number().optional(),
|
|
1046
1046
|
multiple: e.boolean().optional()
|
|
1047
1047
|
}).optional()
|
|
1048
|
-
}),
|
|
1048
|
+
}), dt = D.extend({
|
|
1049
1049
|
type: e.literal("LEGAL"),
|
|
1050
1050
|
config: e.object({
|
|
1051
1051
|
text: e.string(),
|
|
1052
1052
|
html: e.boolean().optional()
|
|
1053
1053
|
}).optional()
|
|
1054
|
-
}),
|
|
1054
|
+
}), ft = D.extend({
|
|
1055
1055
|
type: e.literal("NUMBER"),
|
|
1056
1056
|
config: e.object({
|
|
1057
1057
|
placeholder: e.string().optional(),
|
|
@@ -1060,7 +1060,7 @@ var y = e.object({
|
|
|
1060
1060
|
step: e.number().optional(),
|
|
1061
1061
|
default_value: e.string().optional()
|
|
1062
1062
|
}).optional()
|
|
1063
|
-
}),
|
|
1063
|
+
}), pt = D.extend({
|
|
1064
1064
|
type: e.literal("PASSWORD"),
|
|
1065
1065
|
config: e.object({
|
|
1066
1066
|
placeholder: e.string().optional(),
|
|
@@ -1069,13 +1069,13 @@ var y = e.object({
|
|
|
1069
1069
|
forgot_password_link: e.string().optional(),
|
|
1070
1070
|
default_value: e.string().optional()
|
|
1071
1071
|
}).optional()
|
|
1072
|
-
}),
|
|
1072
|
+
}), mt = D.extend({
|
|
1073
1073
|
type: e.literal("PAYMENT"),
|
|
1074
1074
|
config: e.object({
|
|
1075
1075
|
provider: e.string().optional(),
|
|
1076
1076
|
currency: e.string().optional()
|
|
1077
1077
|
}).optional()
|
|
1078
|
-
}),
|
|
1078
|
+
}), ht = D.extend({
|
|
1079
1079
|
type: e.literal("SOCIAL"),
|
|
1080
1080
|
config: e.object({
|
|
1081
1081
|
providers: e.array(e.string()).optional(),
|
|
@@ -1089,7 +1089,7 @@ var y = e.object({
|
|
|
1089
1089
|
last_used_label: e.string().optional()
|
|
1090
1090
|
})).optional()
|
|
1091
1091
|
}).optional()
|
|
1092
|
-
}),
|
|
1092
|
+
}), gt = D.extend({
|
|
1093
1093
|
type: e.literal("TEL"),
|
|
1094
1094
|
config: e.object({
|
|
1095
1095
|
placeholder: e.string().optional(),
|
|
@@ -1097,7 +1097,7 @@ var y = e.object({
|
|
|
1097
1097
|
default_value: e.string().optional(),
|
|
1098
1098
|
allow_email: e.boolean().optional()
|
|
1099
1099
|
}).optional()
|
|
1100
|
-
}),
|
|
1100
|
+
}), _t = D.extend({
|
|
1101
1101
|
type: e.literal("TEXT"),
|
|
1102
1102
|
config: e.object({
|
|
1103
1103
|
placeholder: e.string().optional(),
|
|
@@ -1107,37 +1107,42 @@ var y = e.object({
|
|
|
1107
1107
|
last_used: e.boolean().optional(),
|
|
1108
1108
|
last_used_label: e.string().optional()
|
|
1109
1109
|
}).optional()
|
|
1110
|
-
}),
|
|
1110
|
+
}), vt = D.extend({
|
|
1111
1111
|
type: e.literal("COUNTRY"),
|
|
1112
1112
|
config: e.object({
|
|
1113
1113
|
placeholder: e.string().optional(),
|
|
1114
1114
|
default_value: e.string().optional()
|
|
1115
1115
|
}).optional()
|
|
1116
|
-
}),
|
|
1116
|
+
}), yt = D.extend({
|
|
1117
1117
|
type: e.literal("URL"),
|
|
1118
1118
|
config: e.object({
|
|
1119
1119
|
placeholder: e.string().optional(),
|
|
1120
1120
|
default_value: e.string().optional()
|
|
1121
1121
|
}).optional()
|
|
1122
|
-
}),
|
|
1122
|
+
}), bt = e.discriminatedUnion("type", [
|
|
1123
|
+
Ge,
|
|
1124
|
+
Ke,
|
|
1125
|
+
qe,
|
|
1126
|
+
Je,
|
|
1127
|
+
Ye,
|
|
1123
1128
|
Xe,
|
|
1124
1129
|
Ze,
|
|
1125
|
-
Qe
|
|
1130
|
+
Qe
|
|
1131
|
+
]), xt = e.discriminatedUnion("type", [
|
|
1126
1132
|
$e,
|
|
1127
1133
|
et,
|
|
1128
|
-
tt
|
|
1134
|
+
tt
|
|
1135
|
+
]), St = e.discriminatedUnion("type", [
|
|
1129
1136
|
nt,
|
|
1130
|
-
rt
|
|
1131
|
-
]), Et = e.discriminatedUnion("type", [
|
|
1137
|
+
rt,
|
|
1132
1138
|
it,
|
|
1133
1139
|
at,
|
|
1134
|
-
|
|
1135
|
-
|
|
1140
|
+
vt,
|
|
1141
|
+
ot,
|
|
1136
1142
|
st,
|
|
1137
1143
|
ct,
|
|
1138
1144
|
lt,
|
|
1139
1145
|
ut,
|
|
1140
|
-
Ct,
|
|
1141
1146
|
dt,
|
|
1142
1147
|
ft,
|
|
1143
1148
|
pt,
|
|
@@ -1145,16 +1150,11 @@ var y = e.object({
|
|
|
1145
1150
|
ht,
|
|
1146
1151
|
gt,
|
|
1147
1152
|
_t,
|
|
1148
|
-
|
|
1149
|
-
|
|
1153
|
+
yt
|
|
1154
|
+
]), Ct = e.union([
|
|
1150
1155
|
bt,
|
|
1151
1156
|
xt,
|
|
1152
|
-
St
|
|
1153
|
-
wt
|
|
1154
|
-
]), Ot = e.union([
|
|
1155
|
-
Tt,
|
|
1156
|
-
Et,
|
|
1157
|
-
Dt
|
|
1157
|
+
St
|
|
1158
1158
|
]);
|
|
1159
1159
|
new Set([
|
|
1160
1160
|
"BOOLEAN",
|
|
@@ -1181,22 +1181,22 @@ new Set([
|
|
|
1181
1181
|
visible: e.boolean().optional().default(!0),
|
|
1182
1182
|
customizations: e.record(e.string(), e.any()).optional()
|
|
1183
1183
|
});
|
|
1184
|
-
var
|
|
1184
|
+
var O = e.object({
|
|
1185
1185
|
x: e.number(),
|
|
1186
1186
|
y: e.number()
|
|
1187
|
-
}),
|
|
1187
|
+
}), wt = e.object({
|
|
1188
1188
|
id: e.string(),
|
|
1189
1189
|
type: e.literal("FLOW"),
|
|
1190
|
-
coordinates:
|
|
1190
|
+
coordinates: O,
|
|
1191
1191
|
alias: e.string().min(1).max(150).optional(),
|
|
1192
1192
|
config: e.object({
|
|
1193
1193
|
flow_id: e.string().max(30),
|
|
1194
1194
|
next_node: e.string().optional()
|
|
1195
1195
|
})
|
|
1196
|
-
}),
|
|
1196
|
+
}), Tt = e.object({
|
|
1197
1197
|
id: e.string(),
|
|
1198
1198
|
type: e.literal("ROUTER"),
|
|
1199
|
-
coordinates:
|
|
1199
|
+
coordinates: O,
|
|
1200
1200
|
alias: e.string().min(1).max(150),
|
|
1201
1201
|
config: e.object({
|
|
1202
1202
|
rules: e.array(e.object({
|
|
@@ -1207,20 +1207,20 @@ var C = e.object({
|
|
|
1207
1207
|
})),
|
|
1208
1208
|
fallback: e.string()
|
|
1209
1209
|
})
|
|
1210
|
-
}),
|
|
1210
|
+
}), Et = e.object({
|
|
1211
1211
|
id: e.string(),
|
|
1212
1212
|
type: e.literal("STEP"),
|
|
1213
|
-
coordinates:
|
|
1213
|
+
coordinates: O,
|
|
1214
1214
|
alias: e.string().min(1).max(150).optional(),
|
|
1215
1215
|
config: e.object({
|
|
1216
|
-
components: e.array(
|
|
1216
|
+
components: e.array(Ct),
|
|
1217
1217
|
next_node: e.string().optional()
|
|
1218
1218
|
})
|
|
1219
|
-
}),
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
]),
|
|
1219
|
+
}), Dt = e.discriminatedUnion("type", [
|
|
1220
|
+
wt,
|
|
1221
|
+
Tt,
|
|
1222
|
+
Et
|
|
1223
|
+
]), Ot = e.object({
|
|
1224
1224
|
name: e.string().openapi({ description: "The name of the form" }),
|
|
1225
1225
|
messages: e.object({
|
|
1226
1226
|
errors: e.record(e.string(), e.any()).optional(),
|
|
@@ -1231,14 +1231,14 @@ var C = e.object({
|
|
|
1231
1231
|
default: e.string().optional()
|
|
1232
1232
|
}).optional(),
|
|
1233
1233
|
translations: e.record(e.string(), e.any()).optional(),
|
|
1234
|
-
nodes: e.array(
|
|
1234
|
+
nodes: e.array(Dt).optional(),
|
|
1235
1235
|
start: e.object({
|
|
1236
1236
|
hidden_fields: e.array(e.object({
|
|
1237
1237
|
key: e.string(),
|
|
1238
1238
|
value: e.string()
|
|
1239
1239
|
})).optional(),
|
|
1240
1240
|
next_node: e.string().optional(),
|
|
1241
|
-
coordinates:
|
|
1241
|
+
coordinates: O.optional()
|
|
1242
1242
|
}).optional(),
|
|
1243
1243
|
ending: e.object({
|
|
1244
1244
|
redirection: e.object({
|
|
@@ -1246,7 +1246,7 @@ var C = e.object({
|
|
|
1246
1246
|
target: e.string().optional()
|
|
1247
1247
|
}).optional(),
|
|
1248
1248
|
after_submit: e.object({ flow_id: e.string().optional() }).optional(),
|
|
1249
|
-
coordinates:
|
|
1249
|
+
coordinates: O.optional(),
|
|
1250
1250
|
resume_flow: e.boolean().optional()
|
|
1251
1251
|
}).optional(),
|
|
1252
1252
|
style: e.object({ css: e.string().optional() }).optional(),
|
|
@@ -1255,8 +1255,8 @@ var C = e.object({
|
|
|
1255
1255
|
sdk_src: e.string().optional()
|
|
1256
1256
|
}).optional()
|
|
1257
1257
|
}).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
|
|
1258
|
-
n.extend(
|
|
1259
|
-
var
|
|
1258
|
+
n.extend(Ot.shape).extend({ id: e.string() });
|
|
1259
|
+
var kt = e.object({
|
|
1260
1260
|
id: e.number().optional(),
|
|
1261
1261
|
text: e.string(),
|
|
1262
1262
|
type: e.enum([
|
|
@@ -1265,7 +1265,7 @@ var Pt = e.object({
|
|
|
1265
1265
|
"success",
|
|
1266
1266
|
"warning"
|
|
1267
1267
|
])
|
|
1268
|
-
}),
|
|
1268
|
+
}), At = e.object({
|
|
1269
1269
|
id: e.string().optional(),
|
|
1270
1270
|
text: e.string(),
|
|
1271
1271
|
href: e.string(),
|
|
@@ -1277,12 +1277,12 @@ e.object({
|
|
|
1277
1277
|
method: e.enum(["POST", "GET"]),
|
|
1278
1278
|
title: e.string().optional(),
|
|
1279
1279
|
description: e.string().optional(),
|
|
1280
|
-
components: e.array(
|
|
1281
|
-
messages: e.array(
|
|
1282
|
-
links: e.array(
|
|
1280
|
+
components: e.array(Ct),
|
|
1281
|
+
messages: e.array(kt).optional(),
|
|
1282
|
+
links: e.array(At).optional(),
|
|
1283
1283
|
footer: e.string().optional()
|
|
1284
1284
|
});
|
|
1285
|
-
var
|
|
1285
|
+
var k = e.enum([
|
|
1286
1286
|
"pre-user-registration",
|
|
1287
1287
|
"post-user-registration",
|
|
1288
1288
|
"post-user-login",
|
|
@@ -1290,95 +1290,95 @@ var w = e.enum([
|
|
|
1290
1290
|
"validate-registration-username",
|
|
1291
1291
|
"pre-user-deletion",
|
|
1292
1292
|
"post-user-deletion"
|
|
1293
|
-
]),
|
|
1293
|
+
]), A = e.enum(["post-user-login"]), j = e.enum([
|
|
1294
1294
|
"post-user-login",
|
|
1295
1295
|
"post-user-registration",
|
|
1296
1296
|
"post-user-update",
|
|
1297
1297
|
"credentials-exchange"
|
|
1298
|
-
]),
|
|
1298
|
+
]), M = e.enum([
|
|
1299
1299
|
"post-user-login",
|
|
1300
1300
|
"credentials-exchange",
|
|
1301
1301
|
"pre-user-registration",
|
|
1302
1302
|
"post-user-registration"
|
|
1303
|
-
]),
|
|
1304
|
-
|
|
1305
|
-
var
|
|
1303
|
+
]), N = e.enum(["post-user-login"]);
|
|
1304
|
+
k.options, A.options, j.options, M.options, N.options;
|
|
1305
|
+
var jt = e.enum(["impersonate"]), Mt = e.enum([
|
|
1306
1306
|
"ensure-username",
|
|
1307
1307
|
"set-preferred-username",
|
|
1308
1308
|
"account-linking"
|
|
1309
|
-
]),
|
|
1309
|
+
]), P = {
|
|
1310
1310
|
enabled: e.boolean().default(!1),
|
|
1311
1311
|
synchronous: e.boolean().default(!1),
|
|
1312
1312
|
priority: e.number().optional(),
|
|
1313
1313
|
hook_id: e.string().optional(),
|
|
1314
1314
|
metadata: e.record(e.string(), e.unknown()).optional()
|
|
1315
|
-
},
|
|
1316
|
-
...
|
|
1317
|
-
trigger_id:
|
|
1315
|
+
}, Nt = e.object({
|
|
1316
|
+
...P,
|
|
1317
|
+
trigger_id: k,
|
|
1318
1318
|
url: e.string()
|
|
1319
|
-
}),
|
|
1320
|
-
...
|
|
1321
|
-
trigger_id:
|
|
1319
|
+
}), Pt = e.object({
|
|
1320
|
+
...P,
|
|
1321
|
+
trigger_id: A,
|
|
1322
1322
|
form_id: e.string()
|
|
1323
|
-
}),
|
|
1324
|
-
...
|
|
1325
|
-
trigger_id:
|
|
1326
|
-
template_id:
|
|
1327
|
-
}),
|
|
1328
|
-
...
|
|
1329
|
-
trigger_id:
|
|
1323
|
+
}), Ft = e.object({
|
|
1324
|
+
...P,
|
|
1325
|
+
trigger_id: j,
|
|
1326
|
+
template_id: Mt
|
|
1327
|
+
}), It = e.object({
|
|
1328
|
+
...P,
|
|
1329
|
+
trigger_id: M,
|
|
1330
1330
|
code_id: e.string()
|
|
1331
|
-
}),
|
|
1332
|
-
...
|
|
1333
|
-
trigger_id:
|
|
1334
|
-
page_id:
|
|
1331
|
+
}), Lt = e.object({
|
|
1332
|
+
...P,
|
|
1333
|
+
trigger_id: N,
|
|
1334
|
+
page_id: jt,
|
|
1335
1335
|
permission_required: e.string().optional()
|
|
1336
1336
|
});
|
|
1337
1337
|
e.union([
|
|
1338
|
+
Nt,
|
|
1339
|
+
Pt,
|
|
1340
|
+
Ft,
|
|
1338
1341
|
It,
|
|
1339
|
-
Lt
|
|
1340
|
-
Rt,
|
|
1341
|
-
zt,
|
|
1342
|
-
Bt
|
|
1342
|
+
Lt
|
|
1343
1343
|
]);
|
|
1344
|
-
var
|
|
1345
|
-
...
|
|
1346
|
-
trigger_id:
|
|
1344
|
+
var Rt = e.object({
|
|
1345
|
+
...P,
|
|
1346
|
+
trigger_id: k
|
|
1347
1347
|
}).extend(n.shape).extend({
|
|
1348
1348
|
hook_id: e.string(),
|
|
1349
1349
|
url: e.string()
|
|
1350
|
-
}),
|
|
1351
|
-
...
|
|
1352
|
-
trigger_id:
|
|
1350
|
+
}), zt = e.object({
|
|
1351
|
+
...P,
|
|
1352
|
+
trigger_id: A
|
|
1353
1353
|
}).extend(n.shape).extend({
|
|
1354
1354
|
hook_id: e.string(),
|
|
1355
1355
|
form_id: e.string()
|
|
1356
|
-
}),
|
|
1357
|
-
...
|
|
1358
|
-
trigger_id:
|
|
1356
|
+
}), Bt = e.object({
|
|
1357
|
+
...P,
|
|
1358
|
+
trigger_id: j
|
|
1359
1359
|
}).extend(n.shape).extend({
|
|
1360
1360
|
hook_id: e.string(),
|
|
1361
|
-
template_id:
|
|
1362
|
-
}),
|
|
1363
|
-
...
|
|
1364
|
-
trigger_id:
|
|
1361
|
+
template_id: Mt
|
|
1362
|
+
}), Vt = e.object({
|
|
1363
|
+
...P,
|
|
1364
|
+
trigger_id: M
|
|
1365
1365
|
}).extend(n.shape).extend({
|
|
1366
1366
|
hook_id: e.string(),
|
|
1367
1367
|
code_id: e.string()
|
|
1368
|
-
}),
|
|
1369
|
-
...
|
|
1370
|
-
trigger_id:
|
|
1368
|
+
}), Ht = e.object({
|
|
1369
|
+
...P,
|
|
1370
|
+
trigger_id: N
|
|
1371
1371
|
}).extend(n.shape).extend({
|
|
1372
1372
|
hook_id: e.string(),
|
|
1373
|
-
page_id:
|
|
1373
|
+
page_id: jt,
|
|
1374
1374
|
permission_required: e.string().optional()
|
|
1375
1375
|
});
|
|
1376
1376
|
e.union([
|
|
1377
|
+
Rt,
|
|
1378
|
+
zt,
|
|
1379
|
+
Bt,
|
|
1377
1380
|
Vt,
|
|
1378
|
-
Ht
|
|
1379
|
-
Ut,
|
|
1380
|
-
Wt,
|
|
1381
|
-
Gt
|
|
1381
|
+
Ht
|
|
1382
1382
|
]), e.object({
|
|
1383
1383
|
code: e.string().max(1e5),
|
|
1384
1384
|
secrets: e.record(e.string(), e.string()).optional()
|
|
@@ -1386,11 +1386,11 @@ e.union([
|
|
|
1386
1386
|
id: e.string(),
|
|
1387
1387
|
tenant_id: e.string()
|
|
1388
1388
|
}).extend(n.shape);
|
|
1389
|
-
var
|
|
1389
|
+
var Ut = e.object({ name: e.string().optional() }), Wt = e.object({ email: e.string().optional() }), Gt = e.object({
|
|
1390
1390
|
id: e.string().optional(),
|
|
1391
1391
|
organization_id: e.string().max(50),
|
|
1392
|
-
inviter:
|
|
1393
|
-
invitee:
|
|
1392
|
+
inviter: Ut,
|
|
1393
|
+
invitee: Wt,
|
|
1394
1394
|
invitation_url: e.string().url(),
|
|
1395
1395
|
client_id: e.string(),
|
|
1396
1396
|
connection_id: e.string().optional(),
|
|
@@ -1406,8 +1406,8 @@ e.object({
|
|
|
1406
1406
|
created_at: e.string().datetime(),
|
|
1407
1407
|
expires_at: e.string().datetime(),
|
|
1408
1408
|
ticket_id: e.string().optional()
|
|
1409
|
-
}).extend(
|
|
1410
|
-
var
|
|
1409
|
+
}).extend(Gt.omit({ id: !0 }).shape);
|
|
1410
|
+
var Kt = e.object({
|
|
1411
1411
|
alg: e.enum([
|
|
1412
1412
|
"RS256",
|
|
1413
1413
|
"RS384",
|
|
@@ -1449,7 +1449,7 @@ var Yt = e.object({
|
|
|
1449
1449
|
message: `EC JWK is missing required member '${r}'`
|
|
1450
1450
|
});
|
|
1451
1451
|
});
|
|
1452
|
-
e.object({ keys: e.array(
|
|
1452
|
+
e.object({ keys: e.array(Kt) }), e.object({
|
|
1453
1453
|
issuer: e.string(),
|
|
1454
1454
|
authorization_endpoint: e.string(),
|
|
1455
1455
|
token_endpoint: e.string(),
|
|
@@ -1476,35 +1476,35 @@ e.object({ keys: e.array(Yt) }), e.object({
|
|
|
1476
1476
|
backchannel_logout_supported: e.boolean().optional(),
|
|
1477
1477
|
backchannel_logout_session_supported: e.boolean().optional()
|
|
1478
1478
|
});
|
|
1479
|
-
var
|
|
1479
|
+
var qt = /* @__PURE__ */ function(e) {
|
|
1480
1480
|
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
|
-
}({}),
|
|
1481
|
+
}({}), Jt = e.nativeEnum(qt), F = e.object({
|
|
1482
1482
|
strategy: e.string(),
|
|
1483
1483
|
strategy_type: e.string()
|
|
1484
1484
|
});
|
|
1485
1485
|
e.object({
|
|
1486
1486
|
csrf_token: e.string(),
|
|
1487
1487
|
auth0Client: e.string().optional(),
|
|
1488
|
-
authParams:
|
|
1488
|
+
authParams: Re,
|
|
1489
1489
|
expires_at: e.string(),
|
|
1490
1490
|
deleted_at: e.string().optional(),
|
|
1491
1491
|
ip: e.string().optional(),
|
|
1492
1492
|
useragent: e.string().optional(),
|
|
1493
1493
|
session_id: e.string().optional(),
|
|
1494
1494
|
authorization_url: e.string().optional(),
|
|
1495
|
-
state:
|
|
1495
|
+
state: Jt.optional().default("pending"),
|
|
1496
1496
|
state_data: e.string().optional(),
|
|
1497
1497
|
failure_reason: e.string().optional(),
|
|
1498
1498
|
user_id: e.string().optional(),
|
|
1499
1499
|
auth_connection: e.string().optional(),
|
|
1500
|
-
auth_strategy:
|
|
1500
|
+
auth_strategy: F.optional(),
|
|
1501
1501
|
authenticated_at: e.string().optional()
|
|
1502
1502
|
}).openapi({ description: "This represents a login sesion" }).extend({
|
|
1503
1503
|
id: e.string().openapi({ description: "This is is used as the state in the universal login" }),
|
|
1504
1504
|
created_at: e.string(),
|
|
1505
1505
|
updated_at: e.string()
|
|
1506
1506
|
});
|
|
1507
|
-
var
|
|
1507
|
+
var I = {
|
|
1508
1508
|
ACLS_SUMMARY: "acls_summary",
|
|
1509
1509
|
ACTIONS_EXECUTION_FAILED: "actions_execution_failed",
|
|
1510
1510
|
API_LIMIT: "api_limit",
|
|
@@ -1664,17 +1664,17 @@ var M = {
|
|
|
1664
1664
|
WARNING_DURING_LOGIN: "w",
|
|
1665
1665
|
WARNING_SENDING_NOTIFICATION: "wn",
|
|
1666
1666
|
WARNING_USER_MANAGEMENT: "wum"
|
|
1667
|
-
},
|
|
1668
|
-
|
|
1667
|
+
}, Yt = e.string().refine((e) => Object.values(I).includes(e), { message: "Invalid log type" });
|
|
1668
|
+
I.ACLS_SUMMARY, I.ACTIONS_EXECUTION_FAILED, I.API_LIMIT, I.API_LIMIT_WARNING, I.APPI, I.CIBA_EXCHANGE_FAILED, I.CIBA_EXCHANGE_SUCCEEDED, I.CIBA_START_FAILED, I.CIBA_START_SUCCEEDED, I.CODE_LINK_SENT, I.CODE_SENT, I.DEPRECATION_NOTICE, I.FAILED_LOGIN, I.FAILED_BY_CONNECTOR, I.FAILED_CHANGE_EMAIL, I.FAILED_BY_CORS, I.FAILED_CROSS_ORIGIN_AUTHENTICATION, I.FAILED_CHANGE_PASSWORD, I.FAILED_POST_CHANGE_PASSWORD_HOOK, I.FAILED_CHANGE_PHONE_NUMBER, I.FAILED_CHANGE_PASSWORD_REQUEST, I.FAILED_CONNECTOR_PROVISIONING, I.FAILED_CHANGE_USERNAME, I.FAILED_DELEGATION, I.FAILED_DEVICE_ACTIVATION, I.FAILED_DEVICE_AUTHORIZATION_REQUEST, I.USER_CANCELED_DEVICE_CONFIRMATION, I.FAILED_USER_DELETION, I.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, I.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, I.FAILED_EXCHANGE_CUSTOM_TOKEN, I.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, I.FAILED_FEDERATED_LOGOUT, I.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN, I.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, I.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, I.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, I.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, I.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, I.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN, I.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, I.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, I.FAILED_HOOK, I.FAILED_IMPERSONATION, I.FAILED_INVITE_ACCEPT, I.FAILED_LOGOUT, I.FLOWS_EXECUTION_COMPLETED, I.FLOWS_EXECUTION_FAILED, I.FAILED_SENDING_NOTIFICATION, I.FORMS_SUBMISSION_FAILED, I.FORMS_SUBMISSION_SUCCEEDED, I.FAILED_LOGIN_INCORRECT_PASSWORD, I.FAILED_PUSHED_AUTHORIZATION_REQUEST, I.FAILED_POST_USER_REGISTRATION_HOOK, I.FAILED_SIGNUP, I.FAILED_SILENT_AUTH, I.FAILED_LOGIN_INVALID_EMAIL_USERNAME, I.FAILED_USERS_IMPORT, I.FAILED_VERIFICATION_EMAIL, I.FAILED_VERIFICATION_EMAIL_REQUEST, I.EMAIL_VERIFICATION_CONFIRMED, I.EMAIL_VERIFICATION_FAILED, I.MFA_AUTH_FAILED, I.MFA_AUTH_REJECTED, I.MFA_AUTH_SUCCESS, I.MFA_ENROLLMENT_COMPLETE, I.TOO_MANY_MFA_FAILURES, I.MFA_RECOVERY_FAILED, I.MFA_RECOVERY_RATE_LIMIT_EXCEED, I.MFA_RECOVERY_SUCCESS, I.MFA_EMAIL_SENT, I.EMAIL_VERIFICATION_SENT, I.EMAIL_VERIFICATION_SEND_FAILURE, I.PUSH_NOTIFICATION_SENT, I.ERROR_SENDING_MFA_PUSH_NOTIFICATION, I.MFA_SMS_SENT, I.ERROR_SENDING_MFA_SMS, I.MFA_VOICE_CALL_SUCCESS, I.MFA_VOICE_CALL_FAILED, I.SECOND_FACTOR_STARTED, I.MFA_ENROLL_STARTED, I.MFA_ENROLLMENT_FAILED, I.GUARDIAN_TENANT_UPDATE, I.UNENROLL_DEVICE_ACCOUNT, I.UPDATE_DEVICE_ACCOUNT, I.WEBAUTHN_CHALLENGE_FAILED, I.WEBAUTHN_ENROLLMENT_FAILED, I.FAILED_KMS_API_OPERATION, I.SUCCESS_KMS_API_OPERATION, I.KMS_KEY_STATE_CHANGED, I.TOO_MANY_CALLS_TO_DELEGATION, I.BLOCKED_IP_ADDRESS, I.BLOCKED_ACCOUNT_IP, I.BLOCKED_ACCOUNT_EMAIL, I.INFORMATION, I.MFA_REQUIRED, I.MANAGEMENT_API_READ_OPERATION, I.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, I.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, I.FAILED_OIDC_BACKCHANNEL_LOGOUT, I.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT, I.ORGANIZATION_MEMBER_ADDED, I.PASSKEY_CHALLENGE_FAILED, I.PASSKEY_CHALLENGE_STARTED, I.PRE_LOGIN_ASSESSMENT, I.BREACHED_PASSWORD, I.BREACHED_PASSWORD_ON_RESET, I.SUCCESS_RESOURCE_CLEANUP, I.RICH_CONSENTS_ACCESS_ERROR, I.SUCCESS_LOGIN, I.SUCCESS_API_OPERATION, I.FAILED_API_OPERATION, I.SUCCESS_CHANGE_EMAIL, I.SUCCESS_CROSS_ORIGIN_AUTHENTICATION, I.SUCCESS_CHANGE_PASSWORD, I.SUCCESS_CHANGE_PHONE_NUMBER, I.SUCCESS_CHANGE_PASSWORD_REQUEST, I.SUCCESS_CHANGE_USERNAME, I.SUCCESS_CREDENTIAL_VALIDATION, I.SUCCESS_DELEGATION, I.SUCCESS_USER_DELETION, I.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, I.SUCCESS_EXCHANGE_CUSTOM_TOKEN, I.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN, I.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, I.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, I.SUCCESS_IMPERSONATION, I.SUCCESSFULLY_ACCEPTED_USER_INVITE, I.BREACHED_PASSWORD_ON_SIGNUP, I.SUCCESS_LOGOUT, I.SUCCESS_HOOK, I.SUCCESS_PASSWORD_MIGRATION, I.SUCCESS_REVOCATION, I.SUCCESS_SIGNUP, I.FAILED_SS_SSO_OPERATION, I.INFORMATION_FROM_SS_SSO_OPERATION, I.SUCCESS_SS_SSO_OPERATION, I.SUCCESS_SILENT_AUTH, I.SUCCESSFUL_SCIM_OPERATION, I.SUCCESSFULLY_IMPORTED_USERS, I.SUCCESS_VERIFICATION_EMAIL, I.SUCCESS_VERIFICATION_EMAIL_REQUEST, I.MAX_AMOUNT_OF_AUTHENTICATORS, I.USER_LOGIN_BLOCK_RELEASED, I.FAILED_UNIVERSAL_LOGOUT, I.SUCCESSFUL_UNIVERSAL_LOGOUT, I.WARNING_DURING_LOGIN, I.WARNING_SENDING_NOTIFICATION, I.WARNING_USER_MANAGEMENT, (() => {
|
|
1669
1669
|
let e = {};
|
|
1670
|
-
for (let [t, n] of Object.entries(
|
|
1670
|
+
for (let [t, n] of Object.entries(I)) 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
1671
|
return e;
|
|
1672
1672
|
})();
|
|
1673
|
-
var
|
|
1673
|
+
var Xt = e.object({
|
|
1674
1674
|
name: e.string(),
|
|
1675
1675
|
version: e.string(),
|
|
1676
1676
|
env: e.object({ node: e.string().optional() }).optional()
|
|
1677
|
-
}),
|
|
1677
|
+
}), Zt = e.object({
|
|
1678
1678
|
country_code: e.string().length(2),
|
|
1679
1679
|
city_name: e.string(),
|
|
1680
1680
|
latitude: e.string(),
|
|
@@ -1683,7 +1683,7 @@ var en = e.object({
|
|
|
1683
1683
|
continent_code: e.string()
|
|
1684
1684
|
});
|
|
1685
1685
|
e.object({
|
|
1686
|
-
type:
|
|
1686
|
+
type: Yt,
|
|
1687
1687
|
date: e.string(),
|
|
1688
1688
|
description: e.string().optional(),
|
|
1689
1689
|
ip: e.string().optional(),
|
|
@@ -1701,63 +1701,63 @@ e.object({
|
|
|
1701
1701
|
strategy: e.string().optional(),
|
|
1702
1702
|
strategy_type: e.string().optional(),
|
|
1703
1703
|
hostname: e.string().optional(),
|
|
1704
|
-
auth0_client:
|
|
1704
|
+
auth0_client: Xt.optional(),
|
|
1705
1705
|
log_id: e.string().optional(),
|
|
1706
|
-
location_info:
|
|
1706
|
+
location_info: Zt.optional()
|
|
1707
1707
|
}).extend({ log_id: e.string() });
|
|
1708
|
-
var
|
|
1708
|
+
var Qt = e.enum([
|
|
1709
1709
|
"http",
|
|
1710
1710
|
"eventbridge",
|
|
1711
1711
|
"eventgrid",
|
|
1712
1712
|
"splunk",
|
|
1713
1713
|
"datadog",
|
|
1714
1714
|
"sumo"
|
|
1715
|
-
]),
|
|
1715
|
+
]), $t = e.enum([
|
|
1716
1716
|
"active",
|
|
1717
1717
|
"paused",
|
|
1718
1718
|
"suspended"
|
|
1719
|
-
]),
|
|
1719
|
+
]), en = e.object({
|
|
1720
1720
|
type: e.string(),
|
|
1721
1721
|
name: e.string()
|
|
1722
1722
|
});
|
|
1723
1723
|
e.object({
|
|
1724
1724
|
name: e.string(),
|
|
1725
|
-
type:
|
|
1726
|
-
status:
|
|
1725
|
+
type: Qt,
|
|
1726
|
+
status: $t.optional(),
|
|
1727
1727
|
sink: e.record(e.string(), e.unknown()),
|
|
1728
|
-
filters: e.array(
|
|
1728
|
+
filters: e.array(en).optional(),
|
|
1729
1729
|
isPriority: e.boolean().optional()
|
|
1730
1730
|
}).extend({
|
|
1731
1731
|
id: e.string(),
|
|
1732
|
-
status:
|
|
1732
|
+
status: $t,
|
|
1733
1733
|
created_at: e.string().optional(),
|
|
1734
1734
|
updated_at: e.string().optional()
|
|
1735
1735
|
});
|
|
1736
|
-
var
|
|
1736
|
+
var tn = e.enum([
|
|
1737
1737
|
"auth0",
|
|
1738
1738
|
"cognito",
|
|
1739
1739
|
"okta",
|
|
1740
1740
|
"oidc"
|
|
1741
|
-
]),
|
|
1741
|
+
]), nn = e.object({
|
|
1742
1742
|
domain: e.string(),
|
|
1743
1743
|
client_id: e.string(),
|
|
1744
1744
|
client_secret: e.string(),
|
|
1745
1745
|
audience: e.string().optional(),
|
|
1746
1746
|
scope: e.string().optional()
|
|
1747
|
-
}),
|
|
1747
|
+
}), rn = e.object({
|
|
1748
1748
|
id: e.string().optional(),
|
|
1749
1749
|
name: e.string(),
|
|
1750
|
-
provider:
|
|
1750
|
+
provider: tn,
|
|
1751
1751
|
connection: e.string(),
|
|
1752
1752
|
enabled: e.boolean().default(!0),
|
|
1753
|
-
credentials:
|
|
1753
|
+
credentials: nn
|
|
1754
1754
|
});
|
|
1755
1755
|
e.object({
|
|
1756
1756
|
id: e.string(),
|
|
1757
1757
|
created_at: e.string(),
|
|
1758
1758
|
updated_at: e.string()
|
|
1759
|
-
}).extend(
|
|
1760
|
-
var
|
|
1759
|
+
}).extend(rn.shape);
|
|
1760
|
+
var an = e.object({
|
|
1761
1761
|
enabled: e.boolean().optional(),
|
|
1762
1762
|
shields: e.array(e.string()).optional(),
|
|
1763
1763
|
admin_notification_frequency: e.array(e.string()).optional(),
|
|
@@ -1766,13 +1766,13 @@ var ln = e.object({
|
|
|
1766
1766
|
"pre-user-registration": e.object({ shields: e.array(e.string()).optional() }).optional(),
|
|
1767
1767
|
"pre-change-password": e.object({ shields: e.array(e.string()).optional() }).optional()
|
|
1768
1768
|
}).optional()
|
|
1769
|
-
}),
|
|
1769
|
+
}), on = e.object({
|
|
1770
1770
|
enabled: e.boolean().optional(),
|
|
1771
1771
|
shields: e.array(e.string()).optional(),
|
|
1772
1772
|
allowlist: e.array(e.string()).optional(),
|
|
1773
1773
|
mode: e.string().optional(),
|
|
1774
1774
|
max_attempts: e.number().optional()
|
|
1775
|
-
}),
|
|
1775
|
+
}), sn = e.object({
|
|
1776
1776
|
enabled: e.boolean().optional(),
|
|
1777
1777
|
shields: e.array(e.string()).optional(),
|
|
1778
1778
|
allowlist: e.array(e.string()).optional(),
|
|
@@ -1786,10 +1786,10 @@ var ln = e.object({
|
|
|
1786
1786
|
rate: e.number().optional()
|
|
1787
1787
|
}).optional()
|
|
1788
1788
|
}).optional()
|
|
1789
|
-
}),
|
|
1790
|
-
breached_password_detection:
|
|
1791
|
-
brute_force_protection:
|
|
1792
|
-
suspicious_ip_throttling:
|
|
1789
|
+
}), cn = e.object({
|
|
1790
|
+
breached_password_detection: an.optional(),
|
|
1791
|
+
brute_force_protection: on.optional(),
|
|
1792
|
+
suspicious_ip_throttling: sn.optional()
|
|
1793
1793
|
});
|
|
1794
1794
|
e.object({
|
|
1795
1795
|
id: e.string().optional(),
|
|
@@ -1802,14 +1802,14 @@ e.object({
|
|
|
1802
1802
|
created_at: e.string(),
|
|
1803
1803
|
updated_at: e.string()
|
|
1804
1804
|
});
|
|
1805
|
-
var
|
|
1805
|
+
var ln = e.object({
|
|
1806
1806
|
initial_user_agent: e.string().describe("First user agent of the device from which this user logged in"),
|
|
1807
1807
|
initial_ip: e.string().describe("First IP address associated with this session"),
|
|
1808
1808
|
initial_asn: e.string().describe("First autonomous system number associated with this session"),
|
|
1809
1809
|
last_user_agent: e.string().describe("Last user agent of the device from which this user logged in"),
|
|
1810
1810
|
last_ip: e.string().describe("Last IP address from which this user logged in"),
|
|
1811
1811
|
last_asn: e.string().describe("Last autonomous system number from which this user logged in")
|
|
1812
|
-
}),
|
|
1812
|
+
}), un = e.object({
|
|
1813
1813
|
id: e.string(),
|
|
1814
1814
|
revoked_at: e.string().optional(),
|
|
1815
1815
|
used_at: e.string().optional(),
|
|
@@ -1817,7 +1817,7 @@ var pn = e.object({
|
|
|
1817
1817
|
expires_at: e.string().optional(),
|
|
1818
1818
|
login_session_id: e.string(),
|
|
1819
1819
|
idle_expires_at: e.string().optional(),
|
|
1820
|
-
device:
|
|
1820
|
+
device: ln.describe("Metadata related to the device used in the session"),
|
|
1821
1821
|
clients: e.array(e.string()).describe("List of client details for the session")
|
|
1822
1822
|
});
|
|
1823
1823
|
e.object({
|
|
@@ -1825,7 +1825,7 @@ e.object({
|
|
|
1825
1825
|
updated_at: e.string(),
|
|
1826
1826
|
authenticated_at: e.string(),
|
|
1827
1827
|
last_interaction_at: e.string()
|
|
1828
|
-
}).extend(
|
|
1828
|
+
}).extend(un.shape), e.object({
|
|
1829
1829
|
kid: e.string().openapi({ description: "The key id of the signing key" }),
|
|
1830
1830
|
tenant_id: e.string().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
|
|
1831
1831
|
cert: e.string().openapi({ description: "The public certificate of the signing key" }),
|
|
@@ -1842,7 +1842,7 @@ e.object({
|
|
|
1842
1842
|
connection: e.string().optional().openapi({ description: "The connection identifier associated with the key" }),
|
|
1843
1843
|
type: e.enum(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
|
|
1844
1844
|
});
|
|
1845
|
-
var
|
|
1845
|
+
var dn = e.object({
|
|
1846
1846
|
id: e.string().optional(),
|
|
1847
1847
|
audience: e.string().optional(),
|
|
1848
1848
|
friendly_name: e.string(),
|
|
@@ -1960,7 +1960,7 @@ var hn = e.object({
|
|
|
1960
1960
|
"shared_planetscale"
|
|
1961
1961
|
]).optional(),
|
|
1962
1962
|
d1_database_id: e.string().max(64).optional(),
|
|
1963
|
-
attack_protection:
|
|
1963
|
+
attack_protection: cn.optional(),
|
|
1964
1964
|
mfa: e.object({
|
|
1965
1965
|
policy: e.enum(["never", "always"]).default("never").optional(),
|
|
1966
1966
|
factors: e.object({
|
|
@@ -1991,29 +1991,29 @@ var hn = e.object({
|
|
|
1991
1991
|
e.object({
|
|
1992
1992
|
created_at: e.string().nullable().transform((e) => e ?? ""),
|
|
1993
1993
|
updated_at: e.string().nullable().transform((e) => e ?? "")
|
|
1994
|
-
}).extend(
|
|
1994
|
+
}).extend(dn.shape).extend({
|
|
1995
1995
|
id: e.string(),
|
|
1996
1996
|
is_control_plane: e.boolean().optional()
|
|
1997
1997
|
});
|
|
1998
|
-
var
|
|
1998
|
+
var fn = e.enum([
|
|
1999
1999
|
"provision",
|
|
2000
2000
|
"seed",
|
|
2001
2001
|
"upgrade",
|
|
2002
2002
|
"backup",
|
|
2003
2003
|
"deprovision",
|
|
2004
2004
|
"users_import"
|
|
2005
|
-
]),
|
|
2005
|
+
]), pn = e.enum([
|
|
2006
2006
|
"pending",
|
|
2007
2007
|
"running",
|
|
2008
2008
|
"succeeded",
|
|
2009
2009
|
"failed",
|
|
2010
2010
|
"cancelled"
|
|
2011
|
-
]),
|
|
2011
|
+
]), mn = e.string().max(64);
|
|
2012
2012
|
e.object({
|
|
2013
2013
|
tenant_id: e.string().max(255).nullable().default(null),
|
|
2014
2014
|
rollout_id: e.string().max(255).nullable().optional(),
|
|
2015
|
-
kind:
|
|
2016
|
-
engine:
|
|
2015
|
+
kind: fn,
|
|
2016
|
+
engine: mn,
|
|
2017
2017
|
engine_instance_id: e.string().max(100).nullable().optional(),
|
|
2018
2018
|
target_worker_version: e.string().max(255).nullable().optional(),
|
|
2019
2019
|
target_database_version: e.string().max(255).nullable().optional(),
|
|
@@ -2021,7 +2021,7 @@ e.object({
|
|
|
2021
2021
|
input: e.record(e.string(), e.unknown()).nullable().optional()
|
|
2022
2022
|
}).extend({
|
|
2023
2023
|
id: e.string(),
|
|
2024
|
-
status:
|
|
2024
|
+
status: pn,
|
|
2025
2025
|
current_step: e.string().max(255).nullable().optional(),
|
|
2026
2026
|
error: e.string().nullable().optional(),
|
|
2027
2027
|
result: e.record(e.string(), e.unknown()).nullable().optional(),
|
|
@@ -2042,7 +2042,7 @@ e.object({
|
|
|
2042
2042
|
claim_expires_at: !0,
|
|
2043
2043
|
finished_at: !0
|
|
2044
2044
|
}).partial();
|
|
2045
|
-
var
|
|
2045
|
+
var hn = e.enum([
|
|
2046
2046
|
"started",
|
|
2047
2047
|
"succeeded",
|
|
2048
2048
|
"failed",
|
|
@@ -2053,14 +2053,14 @@ var yn = e.enum([
|
|
|
2053
2053
|
e.object({
|
|
2054
2054
|
operation_id: e.string().max(255),
|
|
2055
2055
|
step: e.string().max(255),
|
|
2056
|
-
outcome:
|
|
2056
|
+
outcome: hn,
|
|
2057
2057
|
detail: e.record(e.string(), e.unknown()).nullable().optional(),
|
|
2058
2058
|
attempt: e.number().int().min(1).default(1)
|
|
2059
2059
|
}).extend({
|
|
2060
2060
|
id: e.string(),
|
|
2061
2061
|
created_at: e.string()
|
|
2062
2062
|
});
|
|
2063
|
-
var
|
|
2063
|
+
var L = e.enum([
|
|
2064
2064
|
"pending",
|
|
2065
2065
|
"inserted",
|
|
2066
2066
|
"updated",
|
|
@@ -2071,28 +2071,28 @@ e.object({
|
|
|
2071
2071
|
operation_id: e.string().max(255),
|
|
2072
2072
|
seq: e.number().int().min(0),
|
|
2073
2073
|
payload: e.record(e.string(), e.unknown()),
|
|
2074
|
-
status:
|
|
2074
|
+
status: L.default("pending"),
|
|
2075
2075
|
error_code: e.string().max(64).nullable().optional(),
|
|
2076
2076
|
error_message: e.string().nullable().optional(),
|
|
2077
2077
|
error_path: e.string().max(255).nullable().optional(),
|
|
2078
2078
|
entity_id: e.string().max(255).nullable().optional()
|
|
2079
2079
|
}).extend({
|
|
2080
|
-
status:
|
|
2080
|
+
status: L,
|
|
2081
2081
|
created_at: e.string(),
|
|
2082
2082
|
updated_at: e.string()
|
|
2083
2083
|
}), e.object({
|
|
2084
2084
|
seq: e.number().int().min(0),
|
|
2085
|
-
status:
|
|
2085
|
+
status: L,
|
|
2086
2086
|
error_code: e.string().max(64).nullable().optional(),
|
|
2087
2087
|
error_message: e.string().nullable().optional(),
|
|
2088
2088
|
error_path: e.string().max(255).nullable().optional(),
|
|
2089
2089
|
entity_id: e.string().max(255).nullable().optional()
|
|
2090
2090
|
});
|
|
2091
|
-
var
|
|
2091
|
+
var gn = e.enum([
|
|
2092
2092
|
"upgrade",
|
|
2093
2093
|
"reseed",
|
|
2094
2094
|
"backup"
|
|
2095
|
-
]),
|
|
2095
|
+
]), _n = e.enum([
|
|
2096
2096
|
"pending",
|
|
2097
2097
|
"canary",
|
|
2098
2098
|
"rolling",
|
|
@@ -2101,7 +2101,7 @@ var bn = e.enum([
|
|
|
2101
2101
|
"failed"
|
|
2102
2102
|
]);
|
|
2103
2103
|
e.object({
|
|
2104
|
-
kind:
|
|
2104
|
+
kind: gn,
|
|
2105
2105
|
target_worker_version: e.string().max(255).nullable().optional(),
|
|
2106
2106
|
target_database_version: e.string().max(255).nullable().optional(),
|
|
2107
2107
|
wave_size: e.number().int().min(1).default(10),
|
|
@@ -2110,7 +2110,7 @@ e.object({
|
|
|
2110
2110
|
initiated_by: e.string().max(255).nullable().optional()
|
|
2111
2111
|
}).extend({
|
|
2112
2112
|
id: e.string(),
|
|
2113
|
-
status:
|
|
2113
|
+
status: _n,
|
|
2114
2114
|
created_at: e.string(),
|
|
2115
2115
|
updated_at: e.string(),
|
|
2116
2116
|
finished_at: e.string().nullable().optional()
|
|
@@ -2132,7 +2132,7 @@ e.object({
|
|
|
2132
2132
|
code: e.string(),
|
|
2133
2133
|
state: e.string().optional()
|
|
2134
2134
|
});
|
|
2135
|
-
var
|
|
2135
|
+
var vn = e.object({
|
|
2136
2136
|
button_border_radius: e.number(),
|
|
2137
2137
|
button_border_weight: e.number(),
|
|
2138
2138
|
buttons_style: e.enum([
|
|
@@ -2150,7 +2150,7 @@ var Sn = e.object({
|
|
|
2150
2150
|
show_widget_shadow: e.boolean(),
|
|
2151
2151
|
widget_border_weight: e.number(),
|
|
2152
2152
|
widget_corner_radius: e.number()
|
|
2153
|
-
}),
|
|
2153
|
+
}), yn = e.object({
|
|
2154
2154
|
base_focus_color: e.string(),
|
|
2155
2155
|
base_hover_color: e.string(),
|
|
2156
2156
|
body_text: e.string(),
|
|
@@ -2174,20 +2174,20 @@ var Sn = e.object({
|
|
|
2174
2174
|
success: e.string(),
|
|
2175
2175
|
widget_background: e.string(),
|
|
2176
2176
|
widget_border: e.string()
|
|
2177
|
-
}),
|
|
2177
|
+
}), R = e.object({
|
|
2178
2178
|
bold: e.boolean(),
|
|
2179
2179
|
size: e.number()
|
|
2180
|
-
}),
|
|
2181
|
-
body_text:
|
|
2182
|
-
buttons_text:
|
|
2180
|
+
}), bn = e.object({
|
|
2181
|
+
body_text: R,
|
|
2182
|
+
buttons_text: R,
|
|
2183
2183
|
font_url: e.string(),
|
|
2184
|
-
input_labels:
|
|
2185
|
-
links:
|
|
2184
|
+
input_labels: R,
|
|
2185
|
+
links: R,
|
|
2186
2186
|
links_style: e.enum(["normal", "underlined"]),
|
|
2187
2187
|
reference_text_size: e.number(),
|
|
2188
|
-
subtitle:
|
|
2189
|
-
title:
|
|
2190
|
-
}),
|
|
2188
|
+
subtitle: R,
|
|
2189
|
+
title: R
|
|
2190
|
+
}), xn = e.object({
|
|
2191
2191
|
background_color: e.string(),
|
|
2192
2192
|
background_image_url: e.string(),
|
|
2193
2193
|
page_layout: e.enum([
|
|
@@ -2200,7 +2200,7 @@ var Sn = e.object({
|
|
|
2200
2200
|
"chip",
|
|
2201
2201
|
"none"
|
|
2202
2202
|
]).optional()
|
|
2203
|
-
}),
|
|
2203
|
+
}), Sn = e.object({
|
|
2204
2204
|
header_text_alignment: e.enum([
|
|
2205
2205
|
"center",
|
|
2206
2206
|
"left",
|
|
@@ -2217,12 +2217,12 @@ var Sn = e.object({
|
|
|
2217
2217
|
social_buttons_layout: e.enum(["bottom", "top"])
|
|
2218
2218
|
});
|
|
2219
2219
|
e.object({
|
|
2220
|
-
borders:
|
|
2221
|
-
colors:
|
|
2220
|
+
borders: vn,
|
|
2221
|
+
colors: yn,
|
|
2222
2222
|
displayName: e.string(),
|
|
2223
|
-
fonts:
|
|
2224
|
-
page_background:
|
|
2225
|
-
widget:
|
|
2223
|
+
fonts: bn,
|
|
2224
|
+
page_background: xn,
|
|
2225
|
+
widget: Sn
|
|
2226
2226
|
}).extend({ themeId: e.string() }), e.object({
|
|
2227
2227
|
universal_login_experience: e.enum(["new", "classic"]).default("new"),
|
|
2228
2228
|
identifier_first: e.boolean().default(!0),
|
|
@@ -2230,42 +2230,42 @@ e.object({
|
|
|
2230
2230
|
show_last_used_connection: e.boolean().default(!1),
|
|
2231
2231
|
webauthn_platform_first_factor: e.boolean()
|
|
2232
2232
|
});
|
|
2233
|
-
var
|
|
2233
|
+
var Cn = e.object({
|
|
2234
2234
|
hosts: e.array(e.string()).optional(),
|
|
2235
2235
|
methods: e.array(e.string()).optional(),
|
|
2236
2236
|
path: e.string().default("/*"),
|
|
2237
2237
|
headers: e.record(e.string(), e.string()).optional(),
|
|
2238
2238
|
query: e.record(e.string(), e.string()).optional()
|
|
2239
|
-
}),
|
|
2239
|
+
}), wn = e.object({
|
|
2240
2240
|
type: e.string(),
|
|
2241
2241
|
options: e.record(e.string(), e.unknown()).default({})
|
|
2242
|
-
}),
|
|
2242
|
+
}), z = e.object({
|
|
2243
2243
|
id: e.string().optional(),
|
|
2244
2244
|
custom_domain_id: e.string(),
|
|
2245
2245
|
priority: e.number().int().default(100),
|
|
2246
|
-
match:
|
|
2247
|
-
handlers: e.array(
|
|
2248
|
-
}),
|
|
2246
|
+
match: Cn,
|
|
2247
|
+
handlers: e.array(wn).min(1)
|
|
2248
|
+
}), Tn = z.extend({
|
|
2249
2249
|
id: e.string(),
|
|
2250
2250
|
tenant_id: e.string(),
|
|
2251
2251
|
created_at: e.string(),
|
|
2252
2252
|
updated_at: e.string()
|
|
2253
|
-
}),
|
|
2253
|
+
}), En = z.partial().omit({
|
|
2254
2254
|
id: !0,
|
|
2255
2255
|
custom_domain_id: !0
|
|
2256
|
-
}),
|
|
2256
|
+
}), Dn = e.object({
|
|
2257
2257
|
scim: e.string(),
|
|
2258
2258
|
auth0: e.string()
|
|
2259
|
-
}),
|
|
2259
|
+
}), On = e.object({
|
|
2260
2260
|
connection_id: e.string(),
|
|
2261
2261
|
user_id_attribute: e.string().default("externalId"),
|
|
2262
|
-
mapping: e.array(
|
|
2262
|
+
mapping: e.array(Dn).default([])
|
|
2263
2263
|
});
|
|
2264
2264
|
e.object({
|
|
2265
2265
|
created_at: e.string(),
|
|
2266
2266
|
updated_at: e.string()
|
|
2267
|
-
}).extend(
|
|
2268
|
-
var
|
|
2267
|
+
}).extend(On.shape);
|
|
2268
|
+
var kn = e.object({
|
|
2269
2269
|
token_id: e.string(),
|
|
2270
2270
|
connection_id: e.string(),
|
|
2271
2271
|
token_hash: e.string(),
|
|
@@ -2275,20 +2275,20 @@ var Nn = e.object({
|
|
|
2275
2275
|
e.object({
|
|
2276
2276
|
created_at: e.string(),
|
|
2277
2277
|
last_used_at: e.string().optional()
|
|
2278
|
-
}).extend(
|
|
2279
|
-
var
|
|
2278
|
+
}).extend(kn.shape);
|
|
2279
|
+
var An = e.object({
|
|
2280
2280
|
connection_id: e.string(),
|
|
2281
2281
|
external_id: e.string(),
|
|
2282
2282
|
user_id: e.string()
|
|
2283
2283
|
});
|
|
2284
|
-
e.object({ created_at: e.string() }).extend(
|
|
2284
|
+
e.object({ created_at: e.string() }).extend(An.shape), e.object({
|
|
2285
2285
|
name: e.string(),
|
|
2286
2286
|
enabled: e.boolean().optional().default(!0),
|
|
2287
2287
|
default_from_address: e.string().optional(),
|
|
2288
2288
|
credentials: e.record(e.string(), e.unknown()),
|
|
2289
2289
|
settings: e.object({}).optional()
|
|
2290
2290
|
});
|
|
2291
|
-
var
|
|
2291
|
+
var jn = e.enum([
|
|
2292
2292
|
"verify_email",
|
|
2293
2293
|
"verify_email_by_code",
|
|
2294
2294
|
"reset_email",
|
|
@@ -2303,7 +2303,7 @@ var Fn = e.enum([
|
|
|
2303
2303
|
"user_invitation"
|
|
2304
2304
|
]);
|
|
2305
2305
|
e.object({
|
|
2306
|
-
template:
|
|
2306
|
+
template: jn,
|
|
2307
2307
|
body: e.string(),
|
|
2308
2308
|
from: e.string(),
|
|
2309
2309
|
subject: e.string(),
|
|
@@ -2318,13 +2318,13 @@ e.object({
|
|
|
2318
2318
|
session_id: e.string().optional(),
|
|
2319
2319
|
organization: e.string().optional(),
|
|
2320
2320
|
auth_connection: e.string().optional(),
|
|
2321
|
-
auth_strategy:
|
|
2321
|
+
auth_strategy: F.optional(),
|
|
2322
2322
|
user_id: e.string(),
|
|
2323
2323
|
client_id: e.string(),
|
|
2324
2324
|
expires_at: e.string().optional(),
|
|
2325
2325
|
idle_expires_at: e.string().optional(),
|
|
2326
2326
|
last_exchanged_at: e.string().optional(),
|
|
2327
|
-
device:
|
|
2327
|
+
device: ln,
|
|
2328
2328
|
resource_servers: e.array(e.object({
|
|
2329
2329
|
audience: e.string(),
|
|
2330
2330
|
scopes: e.string()
|
|
@@ -2345,10 +2345,10 @@ e.object({
|
|
|
2345
2345
|
name: e.string(),
|
|
2346
2346
|
options: e.object({})
|
|
2347
2347
|
});
|
|
2348
|
-
var
|
|
2348
|
+
var Mn = e.object({
|
|
2349
2349
|
value: e.string(),
|
|
2350
2350
|
description: e.string().optional()
|
|
2351
|
-
}),
|
|
2351
|
+
}), Nn = e.object({
|
|
2352
2352
|
token_dialect: e.enum(["access_token", "access_token_authz"]).optional(),
|
|
2353
2353
|
enforce_policies: e.boolean().optional(),
|
|
2354
2354
|
allow_skipping_userinfo: e.boolean().optional(),
|
|
@@ -2356,11 +2356,11 @@ var In = e.object({
|
|
|
2356
2356
|
persist_client_authorization: e.boolean().optional(),
|
|
2357
2357
|
enable_introspection_endpoint: e.boolean().optional(),
|
|
2358
2358
|
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2359
|
-
}),
|
|
2359
|
+
}), Pn = e.object({
|
|
2360
2360
|
id: e.string().optional(),
|
|
2361
2361
|
name: e.string(),
|
|
2362
2362
|
identifier: e.string(),
|
|
2363
|
-
scopes: e.array(
|
|
2363
|
+
scopes: e.array(Mn).optional(),
|
|
2364
2364
|
signing_alg: e.string().optional(),
|
|
2365
2365
|
signing_secret: e.string().optional(),
|
|
2366
2366
|
token_lifetime: e.number().default(86400),
|
|
@@ -2368,20 +2368,20 @@ var In = e.object({
|
|
|
2368
2368
|
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2369
2369
|
allow_offline_access: e.boolean().optional(),
|
|
2370
2370
|
verificationKey: e.string().optional(),
|
|
2371
|
-
options:
|
|
2371
|
+
options: Nn.optional(),
|
|
2372
2372
|
is_system: e.boolean().optional(),
|
|
2373
2373
|
metadata: e.record(e.string(), e.any()).optional()
|
|
2374
2374
|
}).extend({
|
|
2375
2375
|
created_at: e.string().optional(),
|
|
2376
2376
|
updated_at: e.string().optional()
|
|
2377
2377
|
});
|
|
2378
|
-
e.array(
|
|
2379
|
-
var
|
|
2378
|
+
e.array(Pn);
|
|
2379
|
+
var Fn = e.object({
|
|
2380
2380
|
role_id: e.string(),
|
|
2381
2381
|
resource_server_identifier: e.string(),
|
|
2382
2382
|
permission_name: e.string()
|
|
2383
2383
|
}).extend({ created_at: e.string() });
|
|
2384
|
-
e.array(
|
|
2384
|
+
e.array(Fn), e.object({
|
|
2385
2385
|
user_id: e.string().openapi({ description: "The id of the user that granted the consent" }),
|
|
2386
2386
|
clientID: e.string().openapi({ description: "The id of the client the grant was issued to" }),
|
|
2387
2387
|
audience: e.string().optional().openapi({ description: "The audience the grant applies to" }),
|
|
@@ -2394,7 +2394,7 @@ e.array(zn), e.object({
|
|
|
2394
2394
|
failed_logins: e.array(e.string()).optional(),
|
|
2395
2395
|
last_password_reset: e.string().optional()
|
|
2396
2396
|
});
|
|
2397
|
-
var
|
|
2397
|
+
var In = e.object({
|
|
2398
2398
|
user_id: e.string(),
|
|
2399
2399
|
resource_server_identifier: e.string(),
|
|
2400
2400
|
permission_name: e.string(),
|
|
@@ -2403,8 +2403,8 @@ var Bn = e.object({
|
|
|
2403
2403
|
tenant_id: e.string(),
|
|
2404
2404
|
created_at: e.string().optional()
|
|
2405
2405
|
});
|
|
2406
|
-
e.array(
|
|
2407
|
-
var
|
|
2406
|
+
e.array(In);
|
|
2407
|
+
var Ln = e.object({
|
|
2408
2408
|
user_id: e.string(),
|
|
2409
2409
|
resource_server_identifier: e.string(),
|
|
2410
2410
|
resource_server_name: e.string(),
|
|
@@ -2413,8 +2413,8 @@ var Vn = e.object({
|
|
|
2413
2413
|
created_at: e.string().optional(),
|
|
2414
2414
|
organization_id: e.string().optional()
|
|
2415
2415
|
});
|
|
2416
|
-
e.array(
|
|
2417
|
-
var
|
|
2416
|
+
e.array(Ln);
|
|
2417
|
+
var Rn = e.object({
|
|
2418
2418
|
user_id: e.string(),
|
|
2419
2419
|
role_id: e.string(),
|
|
2420
2420
|
organization_id: e.string().optional()
|
|
@@ -2422,8 +2422,8 @@ var Hn = e.object({
|
|
|
2422
2422
|
tenant_id: e.string(),
|
|
2423
2423
|
created_at: e.string().optional()
|
|
2424
2424
|
});
|
|
2425
|
-
e.array(
|
|
2426
|
-
var
|
|
2425
|
+
e.array(Rn);
|
|
2426
|
+
var zn = e.object({
|
|
2427
2427
|
id: e.string().optional().openapi({ description: "The unique identifier of the role. If not provided, one will be generated." }),
|
|
2428
2428
|
name: e.string().min(1).max(50).openapi({ description: "The name of the role. Cannot include '<' or '>'" }),
|
|
2429
2429
|
description: e.string().max(255).optional().openapi({ description: "The description of the role" }),
|
|
@@ -2434,19 +2434,19 @@ var Un = e.object({
|
|
|
2434
2434
|
created_at: e.string().optional(),
|
|
2435
2435
|
updated_at: e.string().optional()
|
|
2436
2436
|
});
|
|
2437
|
-
e.array(
|
|
2438
|
-
var
|
|
2437
|
+
e.array(zn);
|
|
2438
|
+
var Bn = e.object({
|
|
2439
2439
|
logo_url: e.string().optional().openapi({ description: "URL of the organization's logo" }),
|
|
2440
2440
|
colors: e.object({
|
|
2441
2441
|
primary: e.string().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
2442
2442
|
page_background: e.string().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
2443
2443
|
}).optional()
|
|
2444
|
-
}).optional(),
|
|
2444
|
+
}).optional(), Vn = e.object({
|
|
2445
2445
|
connection_id: e.string().openapi({ description: "ID of the connection" }),
|
|
2446
2446
|
assign_membership_on_login: e.boolean().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
2447
2447
|
show_as_button: e.boolean().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
2448
2448
|
is_signup_enabled: e.boolean().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
2449
|
-
}),
|
|
2449
|
+
}), Hn = e.object({ client_credentials: e.object({
|
|
2450
2450
|
enforce: e.boolean().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
2451
2451
|
per_day: e.number().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
2452
2452
|
per_hour: e.number().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
@@ -2455,15 +2455,15 @@ e.object({
|
|
|
2455
2455
|
id: e.string().optional(),
|
|
2456
2456
|
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
2457
|
display_name: e.string().optional().openapi({ description: "The display name of the organization" }),
|
|
2458
|
-
branding:
|
|
2458
|
+
branding: Bn,
|
|
2459
2459
|
metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
2460
|
-
enabled_connections: e.array(
|
|
2461
|
-
token_quota:
|
|
2460
|
+
enabled_connections: e.array(Vn).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2461
|
+
token_quota: Hn
|
|
2462
2462
|
}).extend(n.shape).extend({
|
|
2463
2463
|
id: e.string(),
|
|
2464
2464
|
name: e.string().min(1).openapi({ description: "The name of the organization" })
|
|
2465
2465
|
});
|
|
2466
|
-
var
|
|
2466
|
+
var Un = e.object({
|
|
2467
2467
|
connection_id: e.string().openapi({ description: "ID of the tenant-level connection to enable for the org." }),
|
|
2468
2468
|
assign_membership_on_login: e.boolean().optional().default(!1),
|
|
2469
2469
|
show_as_button: e.boolean().optional().default(!0),
|
|
@@ -2476,7 +2476,7 @@ var qn = e.object({
|
|
|
2476
2476
|
created_at: e.string().optional(),
|
|
2477
2477
|
updated_at: e.string().optional()
|
|
2478
2478
|
});
|
|
2479
|
-
e.array(
|
|
2479
|
+
e.array(Un), e.object({
|
|
2480
2480
|
user_id: e.string().openapi({ description: "ID of the user" }),
|
|
2481
2481
|
organization_id: e.string().openapi({ description: "ID of the organization" })
|
|
2482
2482
|
}).extend(n.shape).extend({ id: e.string() }), e.object({
|
|
@@ -2615,7 +2615,7 @@ e.array(qn), e.object({
|
|
|
2615
2615
|
"passwordless",
|
|
2616
2616
|
"enterprise"
|
|
2617
2617
|
]);
|
|
2618
|
-
var
|
|
2618
|
+
var Wn = e.object({
|
|
2619
2619
|
cohort: e.string(),
|
|
2620
2620
|
sessions: e.number(),
|
|
2621
2621
|
active: e.array(e.number())
|
|
@@ -2624,9 +2624,9 @@ e.object({
|
|
|
2624
2624
|
interval: e.literal("week"),
|
|
2625
2625
|
from: e.string(),
|
|
2626
2626
|
to: e.string(),
|
|
2627
|
-
cohorts: e.array(
|
|
2627
|
+
cohorts: e.array(Wn)
|
|
2628
2628
|
});
|
|
2629
|
-
var
|
|
2629
|
+
var Gn = e.object({
|
|
2630
2630
|
cohort: e.string(),
|
|
2631
2631
|
tokens: e.number(),
|
|
2632
2632
|
active: e.array(e.number())
|
|
@@ -2635,24 +2635,24 @@ e.object({
|
|
|
2635
2635
|
interval: e.literal("week"),
|
|
2636
2636
|
from: e.string(),
|
|
2637
2637
|
to: e.string(),
|
|
2638
|
-
cohorts: e.array(
|
|
2638
|
+
cohorts: e.array(Gn)
|
|
2639
2639
|
});
|
|
2640
|
-
var
|
|
2640
|
+
var Kn = e.object({
|
|
2641
2641
|
name: e.string(),
|
|
2642
2642
|
type: e.string()
|
|
2643
|
-
}),
|
|
2643
|
+
}), qn = e.object({
|
|
2644
2644
|
elapsed: e.number(),
|
|
2645
2645
|
rows_read: e.number().optional(),
|
|
2646
2646
|
bytes_read: e.number().optional()
|
|
2647
2647
|
});
|
|
2648
2648
|
e.object({
|
|
2649
|
-
meta: e.array(
|
|
2649
|
+
meta: e.array(Kn),
|
|
2650
2650
|
data: e.array(e.record(e.string(), e.any())),
|
|
2651
2651
|
rows: e.number(),
|
|
2652
2652
|
rows_before_limit_at_least: e.number().optional(),
|
|
2653
|
-
statistics:
|
|
2653
|
+
statistics: qn.optional()
|
|
2654
2654
|
});
|
|
2655
|
-
var
|
|
2655
|
+
var Jn = 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(".")), Yn = e.record(e.string(), e.record(e.string(), e.string())).openapi({
|
|
2656
2656
|
type: "object",
|
|
2657
2657
|
additionalProperties: {
|
|
2658
2658
|
type: "object",
|
|
@@ -2660,11 +2660,11 @@ var Qn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.
|
|
|
2660
2660
|
}
|
|
2661
2661
|
});
|
|
2662
2662
|
e.object({
|
|
2663
|
-
prompt:
|
|
2663
|
+
prompt: Jn,
|
|
2664
2664
|
language: e.string(),
|
|
2665
|
-
custom_text:
|
|
2665
|
+
custom_text: Yn
|
|
2666
2666
|
});
|
|
2667
|
-
var
|
|
2667
|
+
var Xn = e.enum([
|
|
2668
2668
|
"phone",
|
|
2669
2669
|
"totp",
|
|
2670
2670
|
"email",
|
|
@@ -2672,9 +2672,9 @@ var er = e.enum([
|
|
|
2672
2672
|
"webauthn-roaming",
|
|
2673
2673
|
"webauthn-platform",
|
|
2674
2674
|
"passkey"
|
|
2675
|
-
]),
|
|
2675
|
+
]), Zn = e.object({
|
|
2676
2676
|
user_id: e.string(),
|
|
2677
|
-
type:
|
|
2677
|
+
type: Xn,
|
|
2678
2678
|
phone_number: e.string().optional(),
|
|
2679
2679
|
totp_secret: e.string().optional(),
|
|
2680
2680
|
credential_id: e.string().optional(),
|
|
@@ -2685,7 +2685,7 @@ var er = e.enum([
|
|
|
2685
2685
|
friendly_name: e.string().optional(),
|
|
2686
2686
|
confirmed: e.boolean().default(!1)
|
|
2687
2687
|
});
|
|
2688
|
-
function
|
|
2688
|
+
function Qn(t, n) {
|
|
2689
2689
|
t.type === "phone" && !t.phone_number && n.addIssue({
|
|
2690
2690
|
code: e.ZodIssueCode.custom,
|
|
2691
2691
|
message: "phone_number is required when type is 'phone'",
|
|
@@ -2708,69 +2708,91 @@ function I(t, n) {
|
|
|
2708
2708
|
path: ["public_key"]
|
|
2709
2709
|
}));
|
|
2710
2710
|
}
|
|
2711
|
-
|
|
2711
|
+
Zn.superRefine(Qn), Zn.extend({
|
|
2712
2712
|
id: e.string(),
|
|
2713
2713
|
created_at: e.string(),
|
|
2714
2714
|
updated_at: e.string()
|
|
2715
|
-
}).superRefine(
|
|
2715
|
+
}).superRefine(Qn), e.object({
|
|
2716
2716
|
id: e.string().optional(),
|
|
2717
2717
|
created_at: e.string().datetime({ offset: !0 }).optional(),
|
|
2718
2718
|
updated_at: e.string().datetime({ offset: !0 }).optional()
|
|
2719
2719
|
});
|
|
2720
|
-
var
|
|
2721
|
-
|
|
2720
|
+
var $n = "x-authhero-preserve-location", B = class extends Error {
|
|
2721
|
+
ms;
|
|
2722
|
+
constructor(e, t) {
|
|
2723
|
+
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
function V(e) {
|
|
2727
|
+
return e instanceof B ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2728
|
+
}
|
|
2729
|
+
function H(e, t) {
|
|
2730
|
+
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
2731
|
+
return t(n.signal).finally(() => clearTimeout(r));
|
|
2732
|
+
}
|
|
2733
|
+
function U(e, t, n) {
|
|
2734
|
+
let r, i = new Promise((e, i) => {
|
|
2735
|
+
r = setTimeout(() => i(new B(t, n)), t);
|
|
2736
|
+
});
|
|
2737
|
+
return Promise.race([e, i]).finally(() => {
|
|
2738
|
+
r && clearTimeout(r);
|
|
2739
|
+
});
|
|
2740
|
+
}
|
|
2741
|
+
//#endregion
|
|
2742
|
+
//#region src/data-plane/cache.ts
|
|
2743
|
+
var er = 1e4, tr = 8e3;
|
|
2744
|
+
function W(e, t, n) {
|
|
2722
2745
|
let r = typeof t == "number" ? {
|
|
2723
2746
|
freshTtlMs: t,
|
|
2724
2747
|
maxEntries: n
|
|
2725
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ??
|
|
2726
|
-
function
|
|
2727
|
-
for (let [t, n] of
|
|
2728
|
-
for (;
|
|
2729
|
-
let e =
|
|
2748
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ?? er, l = r.waitUntil, u = r.upstreamTimeoutMs ?? tr, d = u > 0 ? u : 1e4, f = /* @__PURE__ */ new Map();
|
|
2749
|
+
function p(e) {
|
|
2750
|
+
for (let [t, n] of f) n.stale_if_error_until <= e && n.stale_until <= e && f.delete(t);
|
|
2751
|
+
for (; f.size >= c;) {
|
|
2752
|
+
let e = f.keys().next().value;
|
|
2730
2753
|
if (e === void 0) break;
|
|
2731
|
-
|
|
2754
|
+
f.delete(e);
|
|
2732
2755
|
}
|
|
2733
2756
|
}
|
|
2734
|
-
function
|
|
2757
|
+
function m(e, t, n) {
|
|
2735
2758
|
let r = n + (t === null ? s : i), c = t === null ? r : r + a, l = {
|
|
2736
2759
|
value: t,
|
|
2737
2760
|
fresh_until: r,
|
|
2738
2761
|
stale_until: c,
|
|
2739
2762
|
stale_if_error_until: t === null ? c : c + o
|
|
2740
2763
|
};
|
|
2741
|
-
return
|
|
2764
|
+
return f.delete(e), p(n), f.set(e, l), l;
|
|
2742
2765
|
}
|
|
2743
|
-
function
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
}
|
|
2760
|
-
return r.refreshing = i, n || (d(Date.now()), u.set(t, r)), i;
|
|
2766
|
+
function h(e, t) {
|
|
2767
|
+
return e.refresh_started_at === void 0 ? !1 : t - e.refresh_started_at < d ? !0 : (e.refresh_started_at = void 0, !1);
|
|
2768
|
+
}
|
|
2769
|
+
function g(t) {
|
|
2770
|
+
let n = e.resolveHost(t);
|
|
2771
|
+
return u > 0 ? U(n, u, "resolveHost") : n;
|
|
2772
|
+
}
|
|
2773
|
+
async function _(e) {
|
|
2774
|
+
let t = f.get(e);
|
|
2775
|
+
t && (t.refresh_started_at = Date.now());
|
|
2776
|
+
try {
|
|
2777
|
+
let t = await g(e);
|
|
2778
|
+
return m(e, t, Date.now()), t;
|
|
2779
|
+
} catch (t) {
|
|
2780
|
+
let n = f.get(e);
|
|
2781
|
+
throw n && (n.refresh_started_at = void 0, n.stale_if_error_until <= Date.now() && f.delete(e)), t;
|
|
2782
|
+
}
|
|
2761
2783
|
}
|
|
2762
2784
|
return { async resolveHost(e) {
|
|
2763
|
-
let t = Date.now(), n =
|
|
2764
|
-
if (n && n.fresh_until > t) return
|
|
2785
|
+
let t = Date.now(), n = f.get(e);
|
|
2786
|
+
if (n && n.fresh_until > t) return f.delete(e), f.set(e, n), n.value;
|
|
2765
2787
|
if (n && n.stale_until > t) {
|
|
2766
|
-
if (
|
|
2767
|
-
let t =
|
|
2788
|
+
if (f.delete(e), f.set(e, n), !h(n, t)) {
|
|
2789
|
+
let t = _(e).catch(() => void 0);
|
|
2768
2790
|
l && l(t);
|
|
2769
2791
|
}
|
|
2770
2792
|
return n.value;
|
|
2771
2793
|
}
|
|
2772
2794
|
try {
|
|
2773
|
-
return await
|
|
2795
|
+
return await _(e);
|
|
2774
2796
|
} catch (e) {
|
|
2775
2797
|
if (n && n.stale_if_error_until > t) return n.value;
|
|
2776
2798
|
throw e;
|
|
@@ -2779,7 +2801,7 @@ function L(e, t, n) {
|
|
|
2779
2801
|
}
|
|
2780
2802
|
//#endregion
|
|
2781
2803
|
//#region src/data-plane/registry.ts
|
|
2782
|
-
var
|
|
2804
|
+
var nr = class {
|
|
2783
2805
|
definitions = /* @__PURE__ */ new Map();
|
|
2784
2806
|
bindings;
|
|
2785
2807
|
constructor(e = {}) {
|
|
@@ -2799,38 +2821,38 @@ var R = class {
|
|
|
2799
2821
|
return n.build(r.data, { bindings: this.bindings });
|
|
2800
2822
|
}
|
|
2801
2823
|
};
|
|
2802
|
-
function
|
|
2824
|
+
function G(e) {
|
|
2803
2825
|
return e;
|
|
2804
2826
|
}
|
|
2805
2827
|
//#endregion
|
|
2806
2828
|
//#region src/data-plane/handlers/util.ts
|
|
2807
|
-
var
|
|
2808
|
-
function
|
|
2809
|
-
e.set(
|
|
2810
|
-
}
|
|
2811
|
-
function U(e) {
|
|
2812
|
-
return e.get(B) ?? e.req.raw;
|
|
2813
|
-
}
|
|
2814
|
-
function sr(e, t) {
|
|
2815
|
-
e.set(V, t.tenant_id), e.set(H, t.custom_domain_id), e.set(ir, t.domain);
|
|
2829
|
+
var rr = "__authhero_proxy_request__", ir = "__authhero_proxy_tenant_id__", ar = "__authhero_proxy_custom_domain_id__", or = "__authhero_proxy_domain__", sr = "x-authhero-proxy-mutability-probe";
|
|
2830
|
+
function cr(e, t) {
|
|
2831
|
+
e.set(rr, t);
|
|
2816
2832
|
}
|
|
2817
|
-
function
|
|
2818
|
-
return e.get(
|
|
2833
|
+
function K(e) {
|
|
2834
|
+
return e.get(rr) ?? e.req.raw;
|
|
2819
2835
|
}
|
|
2820
|
-
function lr(e) {
|
|
2821
|
-
|
|
2836
|
+
function lr(e, t) {
|
|
2837
|
+
e.set(ir, t.tenant_id), e.set(ar, t.custom_domain_id), e.set(or, t.domain);
|
|
2822
2838
|
}
|
|
2823
2839
|
function ur(e) {
|
|
2824
2840
|
return e.get(ir);
|
|
2825
2841
|
}
|
|
2826
|
-
function dr(e
|
|
2827
|
-
|
|
2828
|
-
t(r), or(e, new Request(n, { headers: r }));
|
|
2842
|
+
function dr(e) {
|
|
2843
|
+
return e.get(ar);
|
|
2829
2844
|
}
|
|
2830
|
-
function
|
|
2845
|
+
function fr(e) {
|
|
2846
|
+
return e.get(or);
|
|
2847
|
+
}
|
|
2848
|
+
function pr(e, t) {
|
|
2849
|
+
let n = K(e), r = new Headers(n.headers);
|
|
2850
|
+
t(r), cr(e, new Request(n, { headers: r }));
|
|
2851
|
+
}
|
|
2852
|
+
function q(e) {
|
|
2831
2853
|
let t = e.res;
|
|
2832
2854
|
try {
|
|
2833
|
-
t.headers.append(
|
|
2855
|
+
t.headers.append(sr, "1"), t.headers.delete(sr);
|
|
2834
2856
|
return;
|
|
2835
2857
|
} catch {
|
|
2836
2858
|
e.res = new Response(t.body, {
|
|
@@ -2842,7 +2864,7 @@ function W(e) {
|
|
|
2842
2864
|
}
|
|
2843
2865
|
//#endregion
|
|
2844
2866
|
//#region src/data-plane/handlers/cors.ts
|
|
2845
|
-
var
|
|
2867
|
+
var mr = e.object({
|
|
2846
2868
|
origins: e.array(e.string()).optional(),
|
|
2847
2869
|
allow_credentials: e.boolean().optional(),
|
|
2848
2870
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2850,44 +2872,44 @@ var fr = e.object({
|
|
|
2850
2872
|
expose_headers: e.array(e.string()).optional(),
|
|
2851
2873
|
max_age: e.number().int().optional()
|
|
2852
2874
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2853
|
-
function
|
|
2875
|
+
function hr(e, t) {
|
|
2854
2876
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2855
2877
|
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;
|
|
2856
2878
|
}
|
|
2857
|
-
var
|
|
2879
|
+
var gr = G({
|
|
2858
2880
|
type: "cors",
|
|
2859
|
-
optionsSchema:
|
|
2881
|
+
optionsSchema: mr,
|
|
2860
2882
|
build(e) {
|
|
2861
2883
|
return async (t, n) => {
|
|
2862
2884
|
let r = t.req.header("origin") ?? null;
|
|
2863
2885
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2864
|
-
let t =
|
|
2886
|
+
let t = hr(e, r);
|
|
2865
2887
|
return new Response(null, {
|
|
2866
2888
|
status: 204,
|
|
2867
2889
|
headers: t
|
|
2868
2890
|
});
|
|
2869
2891
|
}
|
|
2870
2892
|
await n();
|
|
2871
|
-
let i =
|
|
2872
|
-
|
|
2893
|
+
let i = hr(e, r);
|
|
2894
|
+
q(t), i.forEach((e, n) => {
|
|
2873
2895
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2874
2896
|
});
|
|
2875
2897
|
};
|
|
2876
2898
|
}
|
|
2877
|
-
}),
|
|
2899
|
+
}), _r = e.object({
|
|
2878
2900
|
username: e.string(),
|
|
2879
2901
|
password: e.string(),
|
|
2880
2902
|
realm: e.string().optional()
|
|
2881
2903
|
});
|
|
2882
|
-
function
|
|
2904
|
+
function vr(e, t) {
|
|
2883
2905
|
let n = `${e}:${t}`;
|
|
2884
2906
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2885
2907
|
}
|
|
2886
|
-
var
|
|
2908
|
+
var yr = G({
|
|
2887
2909
|
type: "basic_auth",
|
|
2888
|
-
optionsSchema:
|
|
2910
|
+
optionsSchema: _r,
|
|
2889
2911
|
build(e) {
|
|
2890
|
-
let t =
|
|
2912
|
+
let t = vr(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2891
2913
|
return async (e, r) => {
|
|
2892
2914
|
let i = e.req.header("authorization");
|
|
2893
2915
|
if (i) {
|
|
@@ -2903,7 +2925,7 @@ var _r = z({
|
|
|
2903
2925
|
});
|
|
2904
2926
|
};
|
|
2905
2927
|
}
|
|
2906
|
-
}),
|
|
2928
|
+
}), br = G({
|
|
2907
2929
|
type: "headers",
|
|
2908
2930
|
optionsSchema: e.object({
|
|
2909
2931
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2913,23 +2935,23 @@ var _r = z({
|
|
|
2913
2935
|
}),
|
|
2914
2936
|
build(e) {
|
|
2915
2937
|
return async (t, n) => {
|
|
2916
|
-
if ((e.request || e.remove_request) &&
|
|
2938
|
+
if ((e.request || e.remove_request) && pr(t, (t) => {
|
|
2917
2939
|
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2918
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
2940
|
+
}), 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);
|
|
2919
2941
|
};
|
|
2920
2942
|
}
|
|
2921
|
-
}),
|
|
2943
|
+
}), xr = G({
|
|
2922
2944
|
type: "cache",
|
|
2923
2945
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2924
2946
|
build(e) {
|
|
2925
2947
|
return async (t, n) => {
|
|
2926
2948
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2927
2949
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2928
|
-
|
|
2950
|
+
q(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2929
2951
|
}
|
|
2930
2952
|
};
|
|
2931
2953
|
}
|
|
2932
|
-
}),
|
|
2954
|
+
}), Sr = [
|
|
2933
2955
|
"173.245.48.0/20",
|
|
2934
2956
|
"103.21.244.0/22",
|
|
2935
2957
|
"103.22.200.0/22",
|
|
@@ -2953,7 +2975,7 @@ var _r = z({
|
|
|
2953
2975
|
"2a06:98c0::/29",
|
|
2954
2976
|
"2c0f:f248::/32"
|
|
2955
2977
|
];
|
|
2956
|
-
function
|
|
2978
|
+
function Cr(e) {
|
|
2957
2979
|
let t = e.split(".");
|
|
2958
2980
|
if (t.length !== 4) return null;
|
|
2959
2981
|
let n = [];
|
|
@@ -2965,14 +2987,14 @@ function xr(e) {
|
|
|
2965
2987
|
}
|
|
2966
2988
|
return n;
|
|
2967
2989
|
}
|
|
2968
|
-
function
|
|
2990
|
+
function wr(e) {
|
|
2969
2991
|
if (e === "") return [];
|
|
2970
2992
|
let t = e.split(":"), n = [];
|
|
2971
2993
|
for (let e = 0; e < t.length; e++) {
|
|
2972
2994
|
let r = t[e];
|
|
2973
2995
|
if (r.includes(".")) {
|
|
2974
2996
|
if (e !== t.length - 1) return null;
|
|
2975
|
-
let i =
|
|
2997
|
+
let i = Cr(r);
|
|
2976
2998
|
if (!i) return null;
|
|
2977
2999
|
n.push(i[0] << 8 | i[1], i[2] << 8 | i[3]);
|
|
2978
3000
|
continue;
|
|
@@ -2982,14 +3004,14 @@ function Sr(e) {
|
|
|
2982
3004
|
}
|
|
2983
3005
|
return n;
|
|
2984
3006
|
}
|
|
2985
|
-
function
|
|
3007
|
+
function Tr(e) {
|
|
2986
3008
|
let t = e.split("::");
|
|
2987
3009
|
if (t.length > 2) return null;
|
|
2988
|
-
let n =
|
|
3010
|
+
let n = wr(t[0] ?? "");
|
|
2989
3011
|
if (!n) return null;
|
|
2990
3012
|
let r;
|
|
2991
3013
|
if (t.length === 2) {
|
|
2992
|
-
let e =
|
|
3014
|
+
let e = wr(t[1] ?? "");
|
|
2993
3015
|
if (!e) return null;
|
|
2994
3016
|
let i = 8 - n.length - e.length;
|
|
2995
3017
|
if (i < 1) return null;
|
|
@@ -3004,25 +3026,25 @@ function Cr(e) {
|
|
|
3004
3026
|
for (let e of r) i.push(e >> 8 & 255, e & 255);
|
|
3005
3027
|
return i;
|
|
3006
3028
|
}
|
|
3007
|
-
function
|
|
3029
|
+
function Er(e) {
|
|
3008
3030
|
let t = e.trim();
|
|
3009
3031
|
t.startsWith("[") && t.endsWith("]") && (t = t.slice(1, -1));
|
|
3010
3032
|
let n = t.indexOf("%");
|
|
3011
3033
|
if (n !== -1 && (t = t.slice(0, n)), t === "") return null;
|
|
3012
|
-
if (!t.includes(":")) return
|
|
3013
|
-
let r =
|
|
3034
|
+
if (!t.includes(":")) return Cr(t);
|
|
3035
|
+
let r = Tr(t);
|
|
3014
3036
|
return r ? r.slice(0, 10).every((e) => e === 0) && r[10] === 255 && r[11] === 255 ? r.slice(12) : r : null;
|
|
3015
3037
|
}
|
|
3016
|
-
function
|
|
3017
|
-
let [t, n] = e.split("/"), r =
|
|
3038
|
+
function Dr(e) {
|
|
3039
|
+
let [t, n] = e.split("/"), r = Er(t ?? ""), i = Number(n);
|
|
3018
3040
|
if (!r || !Number.isInteger(i)) throw Error(`Invalid Cloudflare CIDR: ${e}`);
|
|
3019
3041
|
return {
|
|
3020
3042
|
bytes: r,
|
|
3021
3043
|
prefixBits: i
|
|
3022
3044
|
};
|
|
3023
3045
|
}
|
|
3024
|
-
var
|
|
3025
|
-
function
|
|
3046
|
+
var Or = Sr.map(Dr);
|
|
3047
|
+
function kr(e, t) {
|
|
3026
3048
|
if (e.length !== t.bytes.length) return !1;
|
|
3027
3049
|
let n = t.prefixBits >> 3;
|
|
3028
3050
|
for (let r = 0; r < n; r++) if (e[r] !== t.bytes[r]) return !1;
|
|
@@ -3031,11 +3053,11 @@ function Dr(e, t) {
|
|
|
3031
3053
|
let i = 255 << 8 - r & 255;
|
|
3032
3054
|
return (e[n] & i) === (t.bytes[n] & i);
|
|
3033
3055
|
}
|
|
3034
|
-
function
|
|
3035
|
-
let t =
|
|
3036
|
-
return t ?
|
|
3056
|
+
function Ar(e) {
|
|
3057
|
+
let t = Er(e);
|
|
3058
|
+
return t ? Or.some((e) => kr(t, e)) : !1;
|
|
3037
3059
|
}
|
|
3038
|
-
var
|
|
3060
|
+
var jr = G({
|
|
3039
3061
|
type: "forwarded_headers",
|
|
3040
3062
|
optionsSchema: e.object({
|
|
3041
3063
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -3046,46 +3068,46 @@ var kr = z({
|
|
|
3046
3068
|
build(e) {
|
|
3047
3069
|
return async (t, n) => {
|
|
3048
3070
|
let r = new URL(t.req.url);
|
|
3049
|
-
|
|
3071
|
+
pr(t, (n) => {
|
|
3050
3072
|
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);
|
|
3051
|
-
let i = n.get(e.client_ip_header), a = i && e.skip_cloudflare_client_ip &&
|
|
3073
|
+
let i = n.get(e.client_ip_header), a = i && e.skip_cloudflare_client_ip && Ar(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;
|
|
3052
3074
|
n.set("x-forwarded-for", l), e.set_x_real_ip && n.set("x-real-ip", s);
|
|
3053
3075
|
}), await n();
|
|
3054
3076
|
};
|
|
3055
3077
|
}
|
|
3056
|
-
}),
|
|
3057
|
-
function
|
|
3078
|
+
}), Mr = e.object({ upstream_host: e.string().optional() });
|
|
3079
|
+
function Nr(e) {
|
|
3058
3080
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3059
3081
|
}
|
|
3060
|
-
function
|
|
3082
|
+
function Pr(e) {
|
|
3061
3083
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
3062
3084
|
let t = [];
|
|
3063
3085
|
return e.forEach((e, n) => {
|
|
3064
3086
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
3065
3087
|
}), t;
|
|
3066
3088
|
}
|
|
3067
|
-
var
|
|
3089
|
+
var Fr = G({
|
|
3068
3090
|
type: "rewrite_cookies",
|
|
3069
|
-
optionsSchema:
|
|
3091
|
+
optionsSchema: Mr,
|
|
3070
3092
|
build(e) {
|
|
3071
3093
|
return async (t, n) => {
|
|
3072
3094
|
await n();
|
|
3073
3095
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
3074
3096
|
if (!i) return;
|
|
3075
|
-
let a =
|
|
3097
|
+
let a = Pr(t.res.headers);
|
|
3076
3098
|
if (a.length === 0) return;
|
|
3077
|
-
let o =
|
|
3078
|
-
|
|
3099
|
+
let o = Nr(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
3100
|
+
q(t), t.res.headers.delete("set-cookie");
|
|
3079
3101
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
3080
3102
|
};
|
|
3081
3103
|
}
|
|
3082
|
-
}),
|
|
3104
|
+
}), Ir = G({
|
|
3083
3105
|
type: "rewrite_location",
|
|
3084
3106
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
3085
3107
|
build(e) {
|
|
3086
3108
|
return async (t, n) => {
|
|
3087
3109
|
if (await n(), t.res.headers.has("x-authhero-preserve-location")) {
|
|
3088
|
-
|
|
3110
|
+
q(t), t.res.headers.delete($n);
|
|
3089
3111
|
return;
|
|
3090
3112
|
}
|
|
3091
3113
|
let r = t.res.status;
|
|
@@ -3102,33 +3124,10 @@ var Nr = z({
|
|
|
3102
3124
|
}
|
|
3103
3125
|
if (o.origin !== a) return;
|
|
3104
3126
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
3105
|
-
|
|
3127
|
+
q(t), t.res.headers.set("location", c);
|
|
3106
3128
|
};
|
|
3107
3129
|
}
|
|
3108
|
-
}),
|
|
3109
|
-
ms;
|
|
3110
|
-
constructor(e, t) {
|
|
3111
|
-
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
3112
|
-
}
|
|
3113
|
-
};
|
|
3114
|
-
function G(e) {
|
|
3115
|
-
return e instanceof Fr ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
3116
|
-
}
|
|
3117
|
-
function K(e, t) {
|
|
3118
|
-
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
3119
|
-
return t(n.signal).finally(() => clearTimeout(r));
|
|
3120
|
-
}
|
|
3121
|
-
function q(e, t, n) {
|
|
3122
|
-
let r, i = new Promise((e, i) => {
|
|
3123
|
-
r = setTimeout(() => i(new Fr(t, n)), t);
|
|
3124
|
-
});
|
|
3125
|
-
return Promise.race([e, i]).finally(() => {
|
|
3126
|
-
r && clearTimeout(r);
|
|
3127
|
-
});
|
|
3128
|
-
}
|
|
3129
|
-
//#endregion
|
|
3130
|
-
//#region src/data-plane/handlers/http.ts
|
|
3131
|
-
var Ir = new Set([
|
|
3130
|
+
}), Lr = new Set([
|
|
3132
3131
|
"connection",
|
|
3133
3132
|
"keep-alive",
|
|
3134
3133
|
"proxy-authenticate",
|
|
@@ -3137,24 +3136,24 @@ var Ir = new Set([
|
|
|
3137
3136
|
"trailers",
|
|
3138
3137
|
"transfer-encoding",
|
|
3139
3138
|
"upgrade"
|
|
3140
|
-
]),
|
|
3139
|
+
]), Rr = 3e4, zr = e.object({
|
|
3141
3140
|
upstream_url: e.string(),
|
|
3142
3141
|
preserve_host: e.boolean().default(!1),
|
|
3143
3142
|
timeout_ms: e.number().int().positive().optional()
|
|
3144
3143
|
});
|
|
3145
|
-
function
|
|
3144
|
+
function Br(e, t) {
|
|
3146
3145
|
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
3147
3146
|
}
|
|
3148
|
-
function
|
|
3147
|
+
function Vr(e) {
|
|
3149
3148
|
return e !== "GET" && e !== "HEAD";
|
|
3150
3149
|
}
|
|
3151
|
-
function
|
|
3150
|
+
function Hr(e, t) {
|
|
3152
3151
|
let n = new URL(t.url), r = new URL(e.upstream_url);
|
|
3153
|
-
r.pathname =
|
|
3152
|
+
r.pathname = Br(r.pathname, n.pathname), r.search = n.search;
|
|
3154
3153
|
let i = new Headers(t.headers);
|
|
3155
|
-
for (let e of
|
|
3154
|
+
for (let e of Lr) i.delete(e);
|
|
3156
3155
|
e.preserve_host || i.set("host", r.host), i.has("x-forwarded-host") || i.set("x-forwarded-host", n.host), i.has("x-forwarded-proto") || i.set("x-forwarded-proto", n.protocol.replace(":", ""));
|
|
3157
|
-
let a =
|
|
3156
|
+
let a = Vr(t.method) ? t.body : void 0, o = {
|
|
3158
3157
|
method: t.method,
|
|
3159
3158
|
headers: i,
|
|
3160
3159
|
body: a,
|
|
@@ -3165,84 +3164,84 @@ function Vr(e, t) {
|
|
|
3165
3164
|
init: o
|
|
3166
3165
|
};
|
|
3167
3166
|
}
|
|
3168
|
-
var
|
|
3167
|
+
var Ur = G({
|
|
3169
3168
|
type: "http",
|
|
3170
|
-
optionsSchema:
|
|
3169
|
+
optionsSchema: zr,
|
|
3171
3170
|
build(e) {
|
|
3172
|
-
let t = e.timeout_ms ??
|
|
3171
|
+
let t = e.timeout_ms ?? Rr;
|
|
3173
3172
|
return async (n) => {
|
|
3174
|
-
let { target: r, init: i } =
|
|
3173
|
+
let { target: r, init: i } = Hr(e, K(n));
|
|
3175
3174
|
n.set("__proxy_upstream_host__", r.hostname), n.set("__proxy_upstream_origin__", `${r.protocol}//${r.host}`);
|
|
3176
3175
|
try {
|
|
3177
|
-
return await
|
|
3176
|
+
return await H(t, (e) => fetch(r.toString(), {
|
|
3178
3177
|
...i,
|
|
3179
3178
|
signal: e
|
|
3180
3179
|
}));
|
|
3181
3180
|
} catch (e) {
|
|
3182
|
-
return
|
|
3181
|
+
return V(e) ? n.text("Upstream timeout", 504, { "x-authhero-proxy-error": "http_timeout" }) : n.text("Bad gateway", 502, { "x-authhero-proxy-error": "http_failed" });
|
|
3183
3182
|
}
|
|
3184
3183
|
};
|
|
3185
3184
|
}
|
|
3186
|
-
}),
|
|
3185
|
+
}), Wr = 3e4, Gr = e.object({
|
|
3187
3186
|
binding: e.string(),
|
|
3188
3187
|
upstream_url: e.string().optional(),
|
|
3189
3188
|
preserve_host: e.boolean().default(!0),
|
|
3190
3189
|
timeout_ms: e.number().int().positive().optional()
|
|
3191
3190
|
});
|
|
3192
|
-
function
|
|
3191
|
+
function Kr(e) {
|
|
3193
3192
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
3194
3193
|
}
|
|
3195
|
-
var
|
|
3194
|
+
var qr = G({
|
|
3196
3195
|
type: "service_binding",
|
|
3197
|
-
optionsSchema:
|
|
3196
|
+
optionsSchema: Gr,
|
|
3198
3197
|
build(e, t) {
|
|
3199
3198
|
let n = t.bindings[e.binding];
|
|
3200
|
-
if (!
|
|
3201
|
-
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ??
|
|
3199
|
+
if (!Kr(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
3200
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ?? Wr;
|
|
3202
3201
|
return async (t) => {
|
|
3203
|
-
let a =
|
|
3202
|
+
let a = K(t), { target: o, init: s } = Hr({
|
|
3204
3203
|
upstream_url: r,
|
|
3205
3204
|
preserve_host: e.preserve_host
|
|
3206
3205
|
}, a);
|
|
3207
3206
|
t.set("__proxy_upstream_host__", o.hostname), t.set("__proxy_upstream_origin__", `${o.protocol}//${o.host}`);
|
|
3208
3207
|
try {
|
|
3209
|
-
return await
|
|
3208
|
+
return await H(i, async (e) => n.fetch(new Request(o.toString(), {
|
|
3210
3209
|
...s,
|
|
3211
3210
|
signal: e
|
|
3212
3211
|
})));
|
|
3213
3212
|
} catch (e) {
|
|
3214
|
-
return
|
|
3213
|
+
return V(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" });
|
|
3215
3214
|
}
|
|
3216
3215
|
};
|
|
3217
3216
|
}
|
|
3218
|
-
}),
|
|
3217
|
+
}), Jr = 3e4, Yr = e.object({
|
|
3219
3218
|
binding: e.string(),
|
|
3220
3219
|
script_name: e.string(),
|
|
3221
3220
|
cpu_ms: e.number().int().positive().optional(),
|
|
3222
3221
|
subrequests: e.number().int().positive().optional(),
|
|
3223
3222
|
timeout_ms: e.number().int().positive().optional()
|
|
3224
3223
|
});
|
|
3225
|
-
function
|
|
3224
|
+
function Xr(e) {
|
|
3226
3225
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
3227
3226
|
}
|
|
3228
3227
|
var J = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
3229
|
-
function
|
|
3228
|
+
function Zr(e) {
|
|
3230
3229
|
return J.lastIndex = 0, J.test(e);
|
|
3231
3230
|
}
|
|
3232
|
-
var
|
|
3231
|
+
var Qr = G({
|
|
3233
3232
|
type: "dispatch_namespace",
|
|
3234
|
-
optionsSchema:
|
|
3233
|
+
optionsSchema: Yr,
|
|
3235
3234
|
build(e, t) {
|
|
3236
3235
|
let n = t.bindings[e.binding];
|
|
3237
|
-
if (!
|
|
3238
|
-
let r =
|
|
3236
|
+
if (!Xr(n)) throw Error(`Dispatch namespace binding "${e.binding}" is not configured or does not expose .get()`);
|
|
3237
|
+
let r = Zr(e.script_name), i = e.timeout_ms ?? Jr, a = e.cpu_ms || e.subrequests ? { limits: {
|
|
3239
3238
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
3240
3239
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
3241
3240
|
} } : void 0;
|
|
3242
3241
|
return async (t) => {
|
|
3243
3242
|
let o = e.script_name;
|
|
3244
3243
|
if (r) {
|
|
3245
|
-
let n =
|
|
3244
|
+
let n = ur(t), r = dr(t), i = fr(t), a = t.req.header("host") ?? t.req.header("x-forwarded-host") ?? "";
|
|
3246
3245
|
if (o = o.replace(J, (e, t) => {
|
|
3247
3246
|
switch (t) {
|
|
3248
3247
|
case "tenant_id": return n ?? "";
|
|
@@ -3253,19 +3252,19 @@ var Zr = z({
|
|
|
3253
3252
|
}
|
|
3254
3253
|
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
3255
3254
|
}
|
|
3256
|
-
let s =
|
|
3255
|
+
let s = K(t);
|
|
3257
3256
|
try {
|
|
3258
3257
|
let e = n.get(o, void 0, a);
|
|
3259
|
-
return await
|
|
3258
|
+
return await H(i, async (t) => {
|
|
3260
3259
|
let n = new Request(s, { signal: t });
|
|
3261
3260
|
return e.fetch(n);
|
|
3262
3261
|
});
|
|
3263
3262
|
} catch (e) {
|
|
3264
|
-
return
|
|
3263
|
+
return V(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" });
|
|
3265
3264
|
}
|
|
3266
3265
|
};
|
|
3267
3266
|
}
|
|
3268
|
-
}),
|
|
3267
|
+
}), $r = G({
|
|
3269
3268
|
type: "redirect",
|
|
3270
3269
|
optionsSchema: e.object({
|
|
3271
3270
|
upstream_url: e.string().refine((e) => {
|
|
@@ -3294,7 +3293,7 @@ var Zr = z({
|
|
|
3294
3293
|
});
|
|
3295
3294
|
};
|
|
3296
3295
|
}
|
|
3297
|
-
}),
|
|
3296
|
+
}), ei = G({
|
|
3298
3297
|
type: "static",
|
|
3299
3298
|
optionsSchema: e.object({
|
|
3300
3299
|
status: e.number().int().default(200),
|
|
@@ -3314,15 +3313,15 @@ var Zr = z({
|
|
|
3314
3313
|
});
|
|
3315
3314
|
//#endregion
|
|
3316
3315
|
//#region src/data-plane/handlers/index.ts
|
|
3317
|
-
function
|
|
3318
|
-
e.add(
|
|
3316
|
+
function ti(e) {
|
|
3317
|
+
e.add(gr).add(yr).add(br).add(xr).add(jr).add(Fr).add(Ir).add(Ur).add(qr).add(Qr).add($r).add(ei);
|
|
3319
3318
|
}
|
|
3320
3319
|
//#endregion
|
|
3321
3320
|
//#region src/data-plane/matcher.ts
|
|
3322
|
-
function
|
|
3321
|
+
function ni(e) {
|
|
3323
3322
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
3324
3323
|
}
|
|
3325
|
-
function
|
|
3324
|
+
function ri(e, t) {
|
|
3326
3325
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
3327
3326
|
if (n === r) return !0;
|
|
3328
3327
|
if (n.startsWith("*.")) {
|
|
@@ -3331,13 +3330,13 @@ function ni(e, t) {
|
|
|
3331
3330
|
}
|
|
3332
3331
|
return !1;
|
|
3333
3332
|
}
|
|
3334
|
-
function
|
|
3335
|
-
return !e || e.length === 0 ? !0 : e.some((e) =>
|
|
3333
|
+
function ii(e, t) {
|
|
3334
|
+
return !e || e.length === 0 ? !0 : e.some((e) => ri(e, t));
|
|
3336
3335
|
}
|
|
3337
|
-
function
|
|
3336
|
+
function ai(e) {
|
|
3338
3337
|
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;
|
|
3339
3338
|
return async (e, i) => {
|
|
3340
|
-
if (r && !
|
|
3339
|
+
if (r && !ii(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
3341
3340
|
for (let [n, r] of t) {
|
|
3342
3341
|
let t = e.req.header(n);
|
|
3343
3342
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -3354,17 +3353,17 @@ function ii(e) {
|
|
|
3354
3353
|
}
|
|
3355
3354
|
//#endregion
|
|
3356
3355
|
//#region src/data-plane/compile.ts
|
|
3357
|
-
var
|
|
3358
|
-
function
|
|
3356
|
+
var oi = "forwarded_headers";
|
|
3357
|
+
function si(e) {
|
|
3359
3358
|
return e.some((e) => e.type === "forwarded_headers") ? [...e] : [{
|
|
3360
|
-
type:
|
|
3359
|
+
type: oi,
|
|
3361
3360
|
options: {}
|
|
3362
3361
|
}, ...e];
|
|
3363
3362
|
}
|
|
3364
|
-
function
|
|
3365
|
-
return e.has("forwarded_headers") ?
|
|
3363
|
+
function Y(e, t) {
|
|
3364
|
+
return e.has("forwarded_headers") ? si(t) : [...t];
|
|
3366
3365
|
}
|
|
3367
|
-
var
|
|
3366
|
+
var ci = [
|
|
3368
3367
|
"GET",
|
|
3369
3368
|
"POST",
|
|
3370
3369
|
"PUT",
|
|
@@ -3373,63 +3372,63 @@ var oi = [
|
|
|
3373
3372
|
"OPTIONS",
|
|
3374
3373
|
"HEAD"
|
|
3375
3374
|
];
|
|
3376
|
-
function
|
|
3375
|
+
function X(e, n, r, i) {
|
|
3377
3376
|
let a = new t();
|
|
3378
3377
|
r && a.use("*", async (e, t) => {
|
|
3379
|
-
|
|
3378
|
+
lr(e, r), await t();
|
|
3380
3379
|
});
|
|
3381
|
-
let o =
|
|
3380
|
+
let o = ni(e);
|
|
3382
3381
|
for (let e of o) {
|
|
3383
3382
|
let t = [];
|
|
3384
|
-
t.push(
|
|
3385
|
-
for (let r of
|
|
3386
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3383
|
+
t.push(ai(e.match));
|
|
3384
|
+
for (let r of Y(n, e.handlers)) t.push(n.build(r.type, r.options));
|
|
3385
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : ci, i = e.match.path || "/*";
|
|
3387
3386
|
a.on(r, [i], ...t);
|
|
3388
3387
|
}
|
|
3389
|
-
return i && i.length > 0 ? a.on(
|
|
3390
|
-
let n =
|
|
3388
|
+
return i && i.length > 0 ? a.on(ci, ["*"], ...i) : a.all("*", (e) => e.text("No matching route", 404)), a.onError((e, t) => {
|
|
3389
|
+
let n = V(e);
|
|
3391
3390
|
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3392
3391
|
}), a;
|
|
3393
3392
|
}
|
|
3394
3393
|
//#endregion
|
|
3395
3394
|
//#region src/data-plane/router.ts
|
|
3396
|
-
var
|
|
3397
|
-
function
|
|
3398
|
-
return e.resolver ? e.resolver : e.cache ?
|
|
3395
|
+
var li = 1e4;
|
|
3396
|
+
function ui(e) {
|
|
3397
|
+
return e.resolver ? e.resolver : e.cache ? W(e.data, e.cache) : W(e.data, e.cacheTtlMs ?? 3e4);
|
|
3399
3398
|
}
|
|
3400
|
-
function
|
|
3399
|
+
function di(e) {
|
|
3401
3400
|
if (e.registry) return e.registry;
|
|
3402
|
-
let t = new
|
|
3403
|
-
return
|
|
3401
|
+
let t = new nr(e.bindings ?? {});
|
|
3402
|
+
return ti(t), t;
|
|
3404
3403
|
}
|
|
3405
|
-
function
|
|
3406
|
-
let t =
|
|
3404
|
+
function Z(e) {
|
|
3405
|
+
let t = ui(e), n = di(e), r = /* @__PURE__ */ new WeakMap(), i = e.resolveHostTimeoutMs ?? li, a = e.defaultHandlers && e.defaultHandlers.length > 0 ? Y(n, e.defaultHandlers).map((e) => n.build(e.type, e.options)) : void 0, o = a ? X([], n, void 0, a) : void 0;
|
|
3407
3406
|
return async (e) => {
|
|
3408
3407
|
let s = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3409
3408
|
if (!s) return e.text("Missing host", 400);
|
|
3410
3409
|
try {
|
|
3411
|
-
let c = await
|
|
3410
|
+
let c = await U(t.resolveHost(s), i, "resolveHost");
|
|
3412
3411
|
if (!c) return o ? await o.fetch(e.req.raw) : e.text("Unknown host", 404);
|
|
3413
3412
|
let l = r.get(c);
|
|
3414
|
-
return l || (l =
|
|
3413
|
+
return l || (l = X(c.routes, n, {
|
|
3415
3414
|
tenant_id: c.tenant_id,
|
|
3416
3415
|
custom_domain_id: c.custom_domain_id,
|
|
3417
3416
|
domain: c.domain
|
|
3418
3417
|
}, a), r.set(c, l)), await l.fetch(e.req.raw);
|
|
3419
3418
|
} catch (t) {
|
|
3420
|
-
return o ? await o.fetch(e.req.raw) :
|
|
3419
|
+
return o ? await o.fetch(e.req.raw) : V(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" });
|
|
3421
3420
|
}
|
|
3422
3421
|
};
|
|
3423
3422
|
}
|
|
3424
|
-
function
|
|
3423
|
+
function fi(e) {
|
|
3425
3424
|
let n = new t();
|
|
3426
|
-
return n.all("*",
|
|
3425
|
+
return n.all("*", Z(e)), n;
|
|
3427
3426
|
}
|
|
3428
3427
|
//#endregion
|
|
3429
3428
|
//#region src/app.ts
|
|
3430
|
-
function
|
|
3429
|
+
function pi(e) {
|
|
3431
3430
|
let n = new t();
|
|
3432
|
-
return n.all("*",
|
|
3431
|
+
return n.all("*", Z({
|
|
3433
3432
|
data: e.data,
|
|
3434
3433
|
cacheTtlMs: e.cacheTtlMs,
|
|
3435
3434
|
cache: e.cache,
|
|
@@ -3439,111 +3438,116 @@ function di(e) {
|
|
|
3439
3438
|
resolveHostTimeoutMs: e.resolveHostTimeoutMs,
|
|
3440
3439
|
defaultHandlers: e.defaultHandlers
|
|
3441
3440
|
})), n.onError((e, t) => {
|
|
3442
|
-
let n =
|
|
3441
|
+
let n = V(e);
|
|
3443
3442
|
return t.text(n ? "Proxy timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "proxy_timeout" : "proxy_error" });
|
|
3444
3443
|
}), n;
|
|
3445
3444
|
}
|
|
3446
3445
|
//#endregion
|
|
3447
3446
|
//#region src/data-plane/cache-api-cache.ts
|
|
3448
|
-
var
|
|
3449
|
-
function
|
|
3447
|
+
var mi = 1e3, hi = 1e3;
|
|
3448
|
+
function gi(e, t) {
|
|
3450
3449
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3451
3450
|
}
|
|
3452
|
-
function
|
|
3451
|
+
function _i() {
|
|
3453
3452
|
return globalThis.caches?.default;
|
|
3454
3453
|
}
|
|
3455
|
-
function
|
|
3456
|
-
let t = e.cache ??
|
|
3454
|
+
function vi(e) {
|
|
3455
|
+
let t = e.cache ?? _i();
|
|
3457
3456
|
if (!t) return e.upstream;
|
|
3458
|
-
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ??
|
|
3457
|
+
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ?? mi, c = e.cacheWriteTimeoutMs ?? hi;
|
|
3459
3458
|
async function l(e) {
|
|
3460
3459
|
try {
|
|
3461
|
-
return await
|
|
3460
|
+
return await U(Promise.resolve(n.match(e)), s, "cache.match");
|
|
3462
3461
|
} catch {
|
|
3463
3462
|
return;
|
|
3464
3463
|
}
|
|
3465
3464
|
}
|
|
3466
3465
|
return { async resolveHost(t) {
|
|
3467
|
-
let s =
|
|
3466
|
+
let s = gi(r, t), u = await l(s);
|
|
3468
3467
|
if (u) try {
|
|
3469
3468
|
return (await u.json()).value;
|
|
3470
3469
|
} catch {}
|
|
3471
3470
|
let d = await e.upstream.resolveHost(t), f = d === null ? a : i, p = new Response(JSON.stringify({ value: d }), { headers: {
|
|
3472
3471
|
"content-type": "application/json",
|
|
3473
3472
|
"cache-control": `public, max-age=${f}`
|
|
3474
|
-
} }), m =
|
|
3473
|
+
} }), m = U(Promise.resolve(n.put(s, p)), c, "cache.put").catch(() => void 0);
|
|
3475
3474
|
return o ? o(m) : await m, d;
|
|
3476
3475
|
} };
|
|
3477
3476
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return
|
|
3477
|
+
function yi(e, t) {
|
|
3478
|
+
return gi(e, t);
|
|
3480
3479
|
}
|
|
3481
3480
|
//#endregion
|
|
3482
3481
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3483
|
-
var
|
|
3484
|
-
function
|
|
3485
|
-
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 =
|
|
3486
|
-
function
|
|
3482
|
+
var bi = 1e3, xi = 1e3, Si = 5e3;
|
|
3483
|
+
function Ci(e) {
|
|
3484
|
+
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 = bi, cacheWriteTimeoutMs: u = xi, upstreamTimeoutMs: d = Si } = e, f = d > 0 ? d : 1e4, p = /* @__PURE__ */ new Map();
|
|
3485
|
+
function m(e) {
|
|
3487
3486
|
return `${s}:${e.toLowerCase()}`;
|
|
3488
3487
|
}
|
|
3489
|
-
async function
|
|
3488
|
+
async function h(e) {
|
|
3490
3489
|
try {
|
|
3491
|
-
return await
|
|
3490
|
+
return await U(n.get(e), l, "cache.get") ?? null;
|
|
3492
3491
|
} catch {
|
|
3493
3492
|
return null;
|
|
3494
3493
|
}
|
|
3495
3494
|
}
|
|
3496
|
-
function
|
|
3497
|
-
let i =
|
|
3495
|
+
function g(e, t, r) {
|
|
3496
|
+
let i = U(Promise.resolve().then(() => n.set(e, t, r)), u, "cache.set").catch(() => void 0);
|
|
3498
3497
|
return c ? (c(i), Promise.resolve()) : i;
|
|
3499
3498
|
}
|
|
3500
|
-
|
|
3501
|
-
let n =
|
|
3502
|
-
|
|
3503
|
-
|
|
3499
|
+
function _(e, t) {
|
|
3500
|
+
let n = p.get(e);
|
|
3501
|
+
return n === void 0 ? !1 : t - n < f ? !0 : (p.delete(e), !1);
|
|
3502
|
+
}
|
|
3503
|
+
function ee(e) {
|
|
3504
|
+
let n = t.resolveHost(e);
|
|
3505
|
+
return d > 0 ? U(n, d, "resolveHost") : n;
|
|
3506
|
+
}
|
|
3507
|
+
async function v(e) {
|
|
3508
|
+
return p.set(e, Date.now()), (async () => {
|
|
3504
3509
|
try {
|
|
3505
|
-
let
|
|
3506
|
-
value:
|
|
3507
|
-
freshUntilMs:
|
|
3508
|
-
staleUntilMs:
|
|
3509
|
-
staleIfErrorUntilMs: s + c + l
|
|
3510
|
-
},
|
|
3511
|
-
return await m(
|
|
3510
|
+
let t = await ee(e), n = Date.now(), s = t === null ? o : r, c = t === null ? 0 : i, l = t === null ? 0 : a, u = {
|
|
3511
|
+
value: t,
|
|
3512
|
+
freshUntilMs: n + s,
|
|
3513
|
+
staleUntilMs: n + s + c,
|
|
3514
|
+
staleIfErrorUntilMs: n + s + c + l
|
|
3515
|
+
}, d = Math.max(1, Math.ceil((s + c + l) / 1e3));
|
|
3516
|
+
return await g(m(e), u, d), t;
|
|
3512
3517
|
} finally {
|
|
3513
|
-
|
|
3518
|
+
p.delete(e);
|
|
3514
3519
|
}
|
|
3515
3520
|
})();
|
|
3516
|
-
return d.set(e, s), s;
|
|
3517
3521
|
}
|
|
3518
3522
|
return { async resolveHost(e) {
|
|
3519
|
-
let t = await
|
|
3523
|
+
let t = await h(m(e)), n = Date.now();
|
|
3520
3524
|
if (t && typeof t.freshUntilMs == "number") {
|
|
3521
3525
|
if (t.freshUntilMs > n) return t.value;
|
|
3522
3526
|
if (t.staleUntilMs > n) {
|
|
3523
|
-
if (!
|
|
3524
|
-
let t =
|
|
3527
|
+
if (!_(e, n)) {
|
|
3528
|
+
let t = v(e).catch(() => void 0);
|
|
3525
3529
|
c && c(t);
|
|
3526
3530
|
}
|
|
3527
3531
|
return t.value;
|
|
3528
3532
|
}
|
|
3529
3533
|
}
|
|
3530
3534
|
try {
|
|
3531
|
-
return await
|
|
3535
|
+
return await v(e);
|
|
3532
3536
|
} catch (e) {
|
|
3533
3537
|
if (t && (t.staleIfErrorUntilMs ?? t.staleUntilMs) > n) return t.value;
|
|
3534
3538
|
throw e;
|
|
3535
3539
|
}
|
|
3536
3540
|
} };
|
|
3537
3541
|
}
|
|
3538
|
-
function
|
|
3542
|
+
function wi(e, t) {
|
|
3539
3543
|
return `${e}:${t.toLowerCase()}`;
|
|
3540
3544
|
}
|
|
3541
3545
|
//#endregion
|
|
3542
3546
|
//#region src/static/index.ts
|
|
3543
|
-
function
|
|
3547
|
+
function Q() {
|
|
3544
3548
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3545
3549
|
}
|
|
3546
|
-
function
|
|
3550
|
+
function Ti(e, t, n, r, i, a) {
|
|
3547
3551
|
return {
|
|
3548
3552
|
id: e.id ?? `${n}:${t}`,
|
|
3549
3553
|
tenant_id: r,
|
|
@@ -3558,10 +3562,10 @@ function Si(e, t, n, r, i, a) {
|
|
|
3558
3562
|
updated_at: e.updated_at ?? a
|
|
3559
3563
|
};
|
|
3560
3564
|
}
|
|
3561
|
-
function
|
|
3565
|
+
function Ei(e) {
|
|
3562
3566
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3563
3567
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
3564
|
-
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) =>
|
|
3568
|
+
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) => Ti(n, r, e, s, c, t)).sort((e, t) => e.priority - t.priority);
|
|
3565
3569
|
r.set(e, {
|
|
3566
3570
|
tenant_id: s,
|
|
3567
3571
|
custom_domain_id: c,
|
|
@@ -3572,13 +3576,13 @@ function Ci(e) {
|
|
|
3572
3576
|
return {
|
|
3573
3577
|
proxyRoutes: {
|
|
3574
3578
|
async create() {
|
|
3575
|
-
return
|
|
3579
|
+
return Q();
|
|
3576
3580
|
},
|
|
3577
3581
|
async update() {
|
|
3578
|
-
return
|
|
3582
|
+
return Q();
|
|
3579
3583
|
},
|
|
3580
3584
|
async remove() {
|
|
3581
|
-
return
|
|
3585
|
+
return Q();
|
|
3582
3586
|
},
|
|
3583
3587
|
async get(e, t) {
|
|
3584
3588
|
for (let n of r.values()) {
|
|
@@ -3605,7 +3609,7 @@ function Ci(e) {
|
|
|
3605
3609
|
}
|
|
3606
3610
|
};
|
|
3607
3611
|
}
|
|
3608
|
-
function
|
|
3612
|
+
function Di(e, t = {}) {
|
|
3609
3613
|
return {
|
|
3610
3614
|
priority: t.priority,
|
|
3611
3615
|
match: { path: t.path ?? "/*" },
|
|
@@ -3620,10 +3624,10 @@ function wi(e, t = {}) {
|
|
|
3620
3624
|
}
|
|
3621
3625
|
//#endregion
|
|
3622
3626
|
//#region src/constants.ts
|
|
3623
|
-
var
|
|
3627
|
+
var Oi = "proxy:resolve_host";
|
|
3624
3628
|
//#endregion
|
|
3625
3629
|
//#region src/http-adapter/index.ts
|
|
3626
|
-
function
|
|
3630
|
+
function ki() {
|
|
3627
3631
|
let e = () => {
|
|
3628
3632
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3629
3633
|
};
|
|
@@ -3645,54 +3649,61 @@ function Ei() {
|
|
|
3645
3649
|
}
|
|
3646
3650
|
};
|
|
3647
3651
|
}
|
|
3648
|
-
function
|
|
3652
|
+
function Ai(e) {
|
|
3649
3653
|
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;
|
|
3650
3654
|
function c(e) {
|
|
3651
|
-
let t = new AbortController(), n =
|
|
3652
|
-
|
|
3655
|
+
let t = new AbortController(), n, r = new Promise((e, r) => {
|
|
3656
|
+
n = setTimeout(() => {
|
|
3657
|
+
t.abort(), r(new B(s, "control plane"));
|
|
3658
|
+
}, s);
|
|
3659
|
+
});
|
|
3660
|
+
return Promise.race([e(t.signal), r]).finally(() => clearTimeout(n));
|
|
3653
3661
|
}
|
|
3654
|
-
let l = null
|
|
3655
|
-
async function
|
|
3656
|
-
let r = await c((r) =>
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3662
|
+
let l = null;
|
|
3663
|
+
async function u() {
|
|
3664
|
+
let r = await c(async (r) => {
|
|
3665
|
+
let o = await t(`${n}/oauth/token`, {
|
|
3666
|
+
method: "POST",
|
|
3667
|
+
headers: { "content-type": "application/json" },
|
|
3668
|
+
body: JSON.stringify({
|
|
3669
|
+
grant_type: "client_credentials",
|
|
3670
|
+
client_id: e.clientId,
|
|
3671
|
+
client_secret: e.clientSecret,
|
|
3672
|
+
audience: i,
|
|
3673
|
+
scope: a
|
|
3674
|
+
}),
|
|
3675
|
+
signal: r
|
|
3676
|
+
});
|
|
3677
|
+
if (!o.ok) throw Error(`Proxy adapter token request failed: ${o.status} ${await o.text().catch(() => "")}`);
|
|
3678
|
+
return await o.json();
|
|
3679
|
+
}), s = r.expires_in ?? 3600;
|
|
3670
3680
|
return l = {
|
|
3671
|
-
value:
|
|
3672
|
-
expires_at: Date.now() + (
|
|
3673
|
-
},
|
|
3681
|
+
value: r.access_token,
|
|
3682
|
+
expires_at: Date.now() + (s - o) * 1e3
|
|
3683
|
+
}, r.access_token;
|
|
3674
3684
|
}
|
|
3675
|
-
async function
|
|
3676
|
-
return l && l.expires_at > Date.now() ? l.value : u
|
|
3677
|
-
u = null;
|
|
3678
|
-
}), u);
|
|
3685
|
+
async function d() {
|
|
3686
|
+
return l && l.expires_at > Date.now() ? l.value : u();
|
|
3679
3687
|
}
|
|
3680
3688
|
return {
|
|
3681
|
-
proxyRoutes:
|
|
3689
|
+
proxyRoutes: ki(),
|
|
3682
3690
|
async resolveHost(e) {
|
|
3683
|
-
let i = await
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3691
|
+
let i = await d(), a = `${n}${r}${encodeURIComponent(e.toLowerCase())}`;
|
|
3692
|
+
return c(async (e) => {
|
|
3693
|
+
let n = await t(a, {
|
|
3694
|
+
headers: { authorization: `Bearer ${i}` },
|
|
3695
|
+
signal: e
|
|
3696
|
+
});
|
|
3697
|
+
if (n.status === 404) return null;
|
|
3698
|
+
if (!n.ok) throw Error(`Proxy adapter resolveHost failed: ${n.status} ${await n.text().catch(() => "")}`);
|
|
3699
|
+
return await n.json();
|
|
3700
|
+
});
|
|
3690
3701
|
}
|
|
3691
3702
|
};
|
|
3692
3703
|
}
|
|
3693
3704
|
//#endregion
|
|
3694
3705
|
//#region src/http-adapter/service-binding-fetch.ts
|
|
3695
|
-
function
|
|
3706
|
+
function ji(e) {
|
|
3696
3707
|
return (t, n) => {
|
|
3697
3708
|
let r = t instanceof Request && n === void 0 ? t : new Request(t, n);
|
|
3698
3709
|
return e.fetch(r);
|
|
@@ -3700,11 +3711,11 @@ function Oi(e) {
|
|
|
3700
3711
|
}
|
|
3701
3712
|
//#endregion
|
|
3702
3713
|
//#region src/kv-adapter/index.ts
|
|
3703
|
-
var
|
|
3704
|
-
function
|
|
3714
|
+
var $ = "authhero-proxy-host:";
|
|
3715
|
+
function Mi(e, t) {
|
|
3705
3716
|
return `${e}${t.toLowerCase()}`;
|
|
3706
3717
|
}
|
|
3707
|
-
function
|
|
3718
|
+
function Ni() {
|
|
3708
3719
|
let e = () => {
|
|
3709
3720
|
throw Error("KV proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3710
3721
|
};
|
|
@@ -3726,15 +3737,15 @@ function ji() {
|
|
|
3726
3737
|
}
|
|
3727
3738
|
};
|
|
3728
3739
|
}
|
|
3729
|
-
function
|
|
3730
|
-
let { kv: t, keyPrefix: n =
|
|
3740
|
+
function Pi(e) {
|
|
3741
|
+
let { kv: t, keyPrefix: n = $, timeoutMs: r } = e;
|
|
3731
3742
|
return {
|
|
3732
|
-
proxyRoutes:
|
|
3743
|
+
proxyRoutes: Ni(),
|
|
3733
3744
|
async resolveHost(e) {
|
|
3734
|
-
let i =
|
|
3735
|
-
return (r && r > 0 ? await
|
|
3745
|
+
let i = Mi(n, e), a = t.get(i, "json");
|
|
3746
|
+
return (r && r > 0 ? await U(a, r, "kv.get") : await a) ?? null;
|
|
3736
3747
|
}
|
|
3737
3748
|
};
|
|
3738
3749
|
}
|
|
3739
3750
|
//#endregion
|
|
3740
|
-
export {
|
|
3751
|
+
export { $ as DEFAULT_KV_HOST_KEY_PREFIX, oi as FORWARDED_HEADERS_HANDLER_TYPE, nr as HandlerRegistry, Oi as PROXY_RESOLVE_HOST_SCOPE, yr as basicAuthHandler, wi as buildCacheAdapterKey, yi as buildCacheApiKey, Mi as buildKvHostKey, ai as buildMatchFilter, xr as cacheHandler, X as compileHostApp, gr as corsHandler, Ci as createCacheAdapterHostCache, vi as createCacheApiHostCache, Ai as createHttpProxyAdapter, W as createInMemoryHostCache, Pi as createKvProxyAdapter, pi as createProxyApp, Z as createProxyDataPlaneHandler, fi as createProxyDataPlaneRouter, ji as createServiceBindingFetch, Ei as createStaticProxyAdapter, G as defineHandler, Qr as dispatchNamespaceHandler, jr as forwardedHeadersHandler, wn as handlerConfigSchema, br as headersHandler, Ur as httpHandler, Di as httpRoute, Ar as isCloudflareIp, Cn as matchSchema, ii as matchesAnyHost, ri as matchesHost, z as proxyRouteInsertSchema, Tn as proxyRouteSchema, En as proxyRouteUpdateSchema, $r as redirectHandler, ti as registerBuiltinHandlers, Fr as rewriteCookiesHandler, Ir as rewriteLocationHandler, qr as serviceBindingHandler, ni as sortRoutes, ei as staticHandler, si as withForwardedHeaders, Y as withForwardedHeadersFor };
|