@authhero/proxy 0.10.14 → 0.10.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/proxy.cjs +1 -1
- package/dist/proxy.mjs +604 -551
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/data-plane/handlers/http.d.ts +7 -2
- package/package.json +1 -1
package/dist/proxy.mjs
CHANGED
|
@@ -121,7 +121,7 @@ var h = e.enum([
|
|
|
121
121
|
old: e.unknown(),
|
|
122
122
|
new: e.unknown()
|
|
123
123
|
})).optional()
|
|
124
|
-
}),
|
|
124
|
+
}), v = 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
|
+
}), y = e.object({
|
|
134
134
|
status_code: e.number(),
|
|
135
135
|
body: e.unknown().optional()
|
|
136
|
-
}),
|
|
136
|
+
}), ee = 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
|
+
}), te = e.object({
|
|
144
144
|
name: e.string(),
|
|
145
145
|
version: e.string(),
|
|
146
146
|
env: e.record(e.string(), e.string()).optional()
|
|
@@ -153,8 +153,8 @@ e.object({
|
|
|
153
153
|
category: h,
|
|
154
154
|
actor: g,
|
|
155
155
|
target: _,
|
|
156
|
-
request:
|
|
157
|
-
response:
|
|
156
|
+
request: v,
|
|
157
|
+
response: y.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: ee.optional(),
|
|
166
|
+
auth0_client: te.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 ne = 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
|
+
}), re = 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 re = e.object({
|
|
|
197
197
|
user_id: e.string(),
|
|
198
198
|
changes: e.record(e.string(), e.any())
|
|
199
199
|
})
|
|
200
|
-
}),
|
|
200
|
+
}), ie = 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 re = e.object({
|
|
|
206
206
|
mask_output: e.boolean().optional(),
|
|
207
207
|
params: e.object({
|
|
208
208
|
email: e.string(),
|
|
209
|
-
rules:
|
|
209
|
+
rules: ne.optional()
|
|
210
210
|
})
|
|
211
|
-
}),
|
|
211
|
+
}), ae = e.enum([
|
|
212
212
|
"change-email",
|
|
213
213
|
"account",
|
|
214
214
|
"custom"
|
|
215
|
-
]),
|
|
215
|
+
]), oe = 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 re = 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: ae.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
|
-
}),
|
|
226
|
+
}), se = e.union([
|
|
227
|
+
re,
|
|
227
228
|
ie,
|
|
228
|
-
|
|
229
|
-
se
|
|
229
|
+
oe
|
|
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(se).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 ce = 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 le = 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()), le = e.object({
|
|
260
260
|
connection: e.string(),
|
|
261
261
|
user_id: e.string(),
|
|
262
262
|
provider: e.string(),
|
|
@@ -269,15 +269,15 @@ var le = 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: ce.optional()
|
|
273
|
+
}), ue = 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(), de = 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 le = e.object({
|
|
|
300
300
|
gender: e.string().optional(),
|
|
301
301
|
birthdate: e.string().optional(),
|
|
302
302
|
zoneinfo: e.string().optional(),
|
|
303
|
-
address:
|
|
303
|
+
address: ue
|
|
304
304
|
});
|
|
305
|
-
|
|
305
|
+
de.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 @@ fe.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(le).optional()
|
|
327
|
+
}).omit({ registration_completed_at: !0 }), de.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 fe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", pe = (e = 21) => {
|
|
335
335
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
336
|
-
for (; e--;) t +=
|
|
336
|
+
for (; e--;) t += fe[n[e] & 63];
|
|
337
337
|
return t;
|
|
338
|
-
},
|
|
338
|
+
}, me = 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(() => pe()).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 pe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", me
|
|
|
457
457
|
e.object({
|
|
458
458
|
created_at: e.string(),
|
|
459
459
|
updated_at: e.string()
|
|
460
|
-
}).extend(
|
|
461
|
-
var
|
|
460
|
+
}).extend(me.shape).extend({ client_id: e.string() });
|
|
461
|
+
var he = 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 ge = 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
|
+
}), ge = e.object({ id: e.string().openapi({ description: "ID of the client grant." }) }).extend(he.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(ge);
|
|
479
|
+
var _e = e.enum(["iat", "rat"]), ve = e.object({
|
|
480
480
|
id: e.string(),
|
|
481
481
|
token_hash: e.string(),
|
|
482
|
-
type:
|
|
482
|
+
type: _e,
|
|
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(ve.shape);
|
|
494
|
+
var b = e.object({
|
|
495
495
|
x: e.number(),
|
|
496
496
|
y: e.number()
|
|
497
|
-
}),
|
|
497
|
+
}), ye = /* @__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
|
+
}({}), be = /* @__PURE__ */ function(e) {
|
|
500
500
|
return e.BLOCK = "BLOCK", e.FIELD = "FIELD", e;
|
|
501
|
-
}({}),
|
|
501
|
+
}({}), x = e.object({
|
|
502
502
|
id: e.string(),
|
|
503
|
-
category: e.nativeEnum(
|
|
504
|
-
type: e.nativeEnum(
|
|
505
|
-
}),
|
|
503
|
+
category: e.nativeEnum(be),
|
|
504
|
+
type: e.nativeEnum(ye)
|
|
505
|
+
}), xe = x.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
|
+
}), Se = x.extend({
|
|
510
510
|
category: e.literal("BLOCK"),
|
|
511
511
|
type: e.union([
|
|
512
512
|
e.literal("NEXT_BUTTON"),
|
|
@@ -514,13 +514,13 @@ var y = e.object({
|
|
|
514
514
|
e.literal("SUBMIT_BUTTON")
|
|
515
515
|
]),
|
|
516
516
|
config: e.object({ text: e.string() }).passthrough()
|
|
517
|
-
}),
|
|
517
|
+
}), Ce = x.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
|
+
}), we = x.extend({
|
|
524
524
|
category: e.literal("FIELD"),
|
|
525
525
|
type: e.union([
|
|
526
526
|
e.literal("TEXT"),
|
|
@@ -540,38 +540,38 @@ var y = e.object({
|
|
|
540
540
|
label: e.string().optional(),
|
|
541
541
|
placeholder: e.string().optional()
|
|
542
542
|
}).passthrough()
|
|
543
|
-
}),
|
|
543
|
+
}), Te = e.object({
|
|
544
544
|
id: e.string(),
|
|
545
545
|
category: e.string(),
|
|
546
546
|
type: e.string()
|
|
547
|
-
}).passthrough(),
|
|
547
|
+
}).passthrough(), Ee = e.union([
|
|
548
|
+
xe,
|
|
548
549
|
Se,
|
|
549
550
|
Ce,
|
|
550
551
|
we,
|
|
551
|
-
Te
|
|
552
|
-
|
|
553
|
-
]), Oe = e.object({
|
|
552
|
+
Te
|
|
553
|
+
]), De = e.object({
|
|
554
554
|
id: e.string(),
|
|
555
555
|
type: e.literal("STEP"),
|
|
556
|
-
coordinates:
|
|
556
|
+
coordinates: b,
|
|
557
557
|
alias: e.string().optional(),
|
|
558
558
|
config: e.object({
|
|
559
|
-
components: e.array(
|
|
559
|
+
components: e.array(Ee),
|
|
560
560
|
next_node: e.string()
|
|
561
561
|
}).passthrough()
|
|
562
|
-
}),
|
|
562
|
+
}), Oe = e.object({
|
|
563
563
|
id: e.string(),
|
|
564
564
|
type: e.literal("FLOW"),
|
|
565
|
-
coordinates:
|
|
565
|
+
coordinates: b,
|
|
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
|
+
}), ke = e.object({
|
|
572
572
|
id: e.string(),
|
|
573
573
|
type: e.literal("ACTION"),
|
|
574
|
-
coordinates:
|
|
574
|
+
coordinates: b,
|
|
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 y = 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
|
+
}), Ae = e.object({
|
|
587
587
|
id: e.string(),
|
|
588
588
|
type: e.string(),
|
|
589
|
-
coordinates:
|
|
590
|
-
}).passthrough(),
|
|
589
|
+
coordinates: b
|
|
590
|
+
}).passthrough(), je = e.union([
|
|
591
|
+
De,
|
|
591
592
|
Oe,
|
|
592
593
|
ke,
|
|
593
|
-
Ae
|
|
594
|
-
|
|
595
|
-
]), Ne = e.object({
|
|
594
|
+
Ae
|
|
595
|
+
]), Me = e.object({
|
|
596
596
|
next_node: e.string(),
|
|
597
|
-
coordinates:
|
|
598
|
-
}).passthrough(),
|
|
597
|
+
coordinates: b
|
|
598
|
+
}).passthrough(), Ne = e.object({
|
|
599
599
|
resume_flow: e.boolean().optional(),
|
|
600
|
-
coordinates:
|
|
600
|
+
coordinates: b
|
|
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(je),
|
|
607
|
+
start: Me,
|
|
608
|
+
ending: Ne,
|
|
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 S = /* @__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
|
+
}({}), Pe = /* @__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
|
+
}({}), Fe = /* @__PURE__ */ function(e) {
|
|
625
625
|
return e.S256 = "S256", e.Plain = "plain", e;
|
|
626
|
-
}({}),
|
|
626
|
+
}({}), Ie = 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
630
|
})]).nullable(), Le = e.object({
|
|
631
|
-
userinfo: e.record(e.string(),
|
|
632
|
-
id_token: e.record(e.string(),
|
|
631
|
+
userinfo: e.record(e.string(), Ie).optional(),
|
|
632
|
+
id_token: e.record(e.string(), Ie).optional()
|
|
633
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(S).optional(),
|
|
637
|
+
response_mode: e.nativeEnum(Pe).optional(),
|
|
638
638
|
redirect_uri: e.string().optional(),
|
|
639
639
|
audience: e.string().optional(),
|
|
640
640
|
organization: e.string().optional(),
|
|
@@ -642,7 +642,7 @@ var Fe = /* @__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(Fe).optional(),
|
|
646
646
|
code_challenge: e.string().optional(),
|
|
647
647
|
username: e.string().optional(),
|
|
648
648
|
ui_locales: e.string().optional(),
|
|
@@ -835,8 +835,8 @@ var Ve = e.object({
|
|
|
835
835
|
strategy: e.string(),
|
|
836
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(S).optional(),
|
|
839
|
+
response_mode: e.nativeEnum(Pe).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(),
|
|
@@ -847,7 +847,7 @@ e.object({
|
|
|
847
847
|
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
848
848
|
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
849
849
|
}).extend(Ve.shape);
|
|
850
|
-
var
|
|
850
|
+
var w = 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 He = e.object({
|
|
|
861
861
|
"null"
|
|
862
862
|
]).optional(),
|
|
863
863
|
domain_metadata: e.record(e.string(), e.string().max(255)).optional()
|
|
864
|
-
}),
|
|
864
|
+
}), He = 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 He = e.object({
|
|
|
869
869
|
name: e.literal("http"),
|
|
870
870
|
http_body: e.string(),
|
|
871
871
|
http_url: e.string()
|
|
872
|
-
})]),
|
|
872
|
+
})]), Ue = w.extend({
|
|
873
873
|
custom_domain_id: e.string(),
|
|
874
874
|
primary: e.boolean(),
|
|
875
875
|
status: e.enum([
|
|
@@ -879,28 +879,28 @@ var He = 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(He) }).optional(),
|
|
883
883
|
tls_policy: e.string().optional()
|
|
884
884
|
});
|
|
885
|
-
|
|
885
|
+
w.pick({
|
|
886
886
|
tls_policy: !0,
|
|
887
887
|
custom_client_ip_header: !0,
|
|
888
888
|
domain_metadata: !0
|
|
889
|
-
}).strict(),
|
|
889
|
+
}).strict(), Ue.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 T = e.object({
|
|
894
894
|
id: e.string(),
|
|
895
895
|
order: e.number().optional(),
|
|
896
896
|
visible: e.boolean().optional().default(!0)
|
|
897
|
-
}),
|
|
897
|
+
}), E = T.extend({ category: e.literal("BLOCK").optional() }), We = E.extend({
|
|
898
898
|
type: e.literal("DIVIDER"),
|
|
899
899
|
config: e.object({ text: e.string().optional() }).optional()
|
|
900
|
-
}),
|
|
900
|
+
}), Ge = E.extend({
|
|
901
901
|
type: e.literal("HTML"),
|
|
902
902
|
config: e.object({ content: e.string().optional() }).optional()
|
|
903
|
-
}),
|
|
903
|
+
}), Ke = E.extend({
|
|
904
904
|
type: e.literal("IMAGE"),
|
|
905
905
|
config: e.object({
|
|
906
906
|
src: e.string().optional(),
|
|
@@ -908,43 +908,43 @@ var w = e.object({
|
|
|
908
908
|
width: e.number().optional(),
|
|
909
909
|
height: e.number().optional()
|
|
910
910
|
}).optional()
|
|
911
|
-
}),
|
|
911
|
+
}), qe = E.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
|
+
}), Je = E.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
|
+
}), Ye = E.extend({
|
|
924
924
|
type: e.literal("NEXT_BUTTON"),
|
|
925
925
|
config: e.object({ text: e.string().optional() })
|
|
926
|
-
}),
|
|
926
|
+
}), Xe = E.extend({
|
|
927
927
|
type: e.literal("PREVIOUS_BUTTON"),
|
|
928
928
|
config: e.object({ text: e.string().optional() })
|
|
929
|
-
}),
|
|
929
|
+
}), Ze = E.extend({
|
|
930
930
|
type: e.literal("RICH_TEXT"),
|
|
931
931
|
config: e.object({ content: e.string().optional() }).optional()
|
|
932
|
-
}),
|
|
932
|
+
}), D = T.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
|
+
}), Qe = D.extend({
|
|
939
939
|
type: e.literal("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
940
940
|
config: e.object({ credential_type: e.string().optional() })
|
|
941
|
-
}),
|
|
941
|
+
}), $e = D.extend({
|
|
942
942
|
type: e.literal("GMAPS_ADDRESS"),
|
|
943
943
|
config: e.object({ api_key: e.string().optional() })
|
|
944
|
-
}),
|
|
944
|
+
}), et = D.extend({
|
|
945
945
|
type: e.literal("RECAPTCHA"),
|
|
946
946
|
config: e.object({ site_key: e.string().optional() })
|
|
947
|
-
}),
|
|
947
|
+
}), O = T.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 w = e.object({
|
|
|
960
960
|
})).optional(),
|
|
961
961
|
required: e.boolean().optional(),
|
|
962
962
|
sensitive: e.boolean().optional()
|
|
963
|
-
}),
|
|
963
|
+
}), tt = O.extend({
|
|
964
964
|
type: e.literal("BOOLEAN"),
|
|
965
965
|
config: e.object({ default_value: e.boolean().optional() }).optional()
|
|
966
|
-
}),
|
|
966
|
+
}), nt = O.extend({
|
|
967
967
|
type: e.literal("CARDS"),
|
|
968
968
|
config: e.object({
|
|
969
969
|
options: e.array(e.object({
|
|
@@ -974,7 +974,7 @@ var w = e.object({
|
|
|
974
974
|
})).optional(),
|
|
975
975
|
multi_select: e.boolean().optional()
|
|
976
976
|
}).optional()
|
|
977
|
-
}),
|
|
977
|
+
}), rt = O.extend({
|
|
978
978
|
type: e.literal("CHOICE"),
|
|
979
979
|
config: e.object({
|
|
980
980
|
options: e.array(e.object({
|
|
@@ -985,7 +985,7 @@ var w = 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
|
+
}), it = O.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 w = e.object({
|
|
|
1002
1002
|
message: "default_value is longer than the configured length",
|
|
1003
1003
|
path: ["default_value"]
|
|
1004
1004
|
}).optional()
|
|
1005
|
-
}),
|
|
1005
|
+
}), at = O.extend({
|
|
1006
1006
|
type: e.literal("CUSTOM"),
|
|
1007
1007
|
config: e.object({
|
|
1008
1008
|
component: e.string().optional(),
|
|
@@ -1010,7 +1010,7 @@ var w = e.object({
|
|
|
1010
1010
|
schema: e.record(e.string(), e.any()).optional(),
|
|
1011
1011
|
code: e.string().optional()
|
|
1012
1012
|
})
|
|
1013
|
-
}),
|
|
1013
|
+
}), ot = O.extend({
|
|
1014
1014
|
type: e.literal("DATE"),
|
|
1015
1015
|
config: e.object({
|
|
1016
1016
|
format: e.string().optional(),
|
|
@@ -1018,7 +1018,7 @@ var w = e.object({
|
|
|
1018
1018
|
max: e.string().optional(),
|
|
1019
1019
|
default_value: e.string().optional()
|
|
1020
1020
|
}).optional()
|
|
1021
|
-
}),
|
|
1021
|
+
}), st = O.extend({
|
|
1022
1022
|
type: e.literal("DROPDOWN"),
|
|
1023
1023
|
config: e.object({
|
|
1024
1024
|
options: e.array(e.object({
|
|
@@ -1030,7 +1030,7 @@ var w = 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
|
+
}), ct = O.extend({
|
|
1034
1034
|
type: e.literal("EMAIL"),
|
|
1035
1035
|
config: e.object({
|
|
1036
1036
|
placeholder: e.string().optional(),
|
|
@@ -1038,20 +1038,20 @@ var w = e.object({
|
|
|
1038
1038
|
last_used: e.boolean().optional(),
|
|
1039
1039
|
last_used_label: e.string().optional()
|
|
1040
1040
|
}).optional()
|
|
1041
|
-
}),
|
|
1041
|
+
}), lt = O.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
|
+
}), ut = O.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
|
+
}), dt = O.extend({
|
|
1055
1055
|
type: e.literal("NUMBER"),
|
|
1056
1056
|
config: e.object({
|
|
1057
1057
|
placeholder: e.string().optional(),
|
|
@@ -1060,7 +1060,7 @@ var w = e.object({
|
|
|
1060
1060
|
step: e.number().optional(),
|
|
1061
1061
|
default_value: e.string().optional()
|
|
1062
1062
|
}).optional()
|
|
1063
|
-
}),
|
|
1063
|
+
}), ft = O.extend({
|
|
1064
1064
|
type: e.literal("PASSWORD"),
|
|
1065
1065
|
config: e.object({
|
|
1066
1066
|
placeholder: e.string().optional(),
|
|
@@ -1069,13 +1069,13 @@ var w = e.object({
|
|
|
1069
1069
|
forgot_password_link: e.string().optional(),
|
|
1070
1070
|
default_value: e.string().optional()
|
|
1071
1071
|
}).optional()
|
|
1072
|
-
}),
|
|
1072
|
+
}), pt = O.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
|
+
}), mt = O.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 w = e.object({
|
|
|
1089
1089
|
last_used_label: e.string().optional()
|
|
1090
1090
|
})).optional()
|
|
1091
1091
|
}).optional()
|
|
1092
|
-
}),
|
|
1092
|
+
}), ht = O.extend({
|
|
1093
1093
|
type: e.literal("TEL"),
|
|
1094
1094
|
config: e.object({
|
|
1095
1095
|
placeholder: e.string().optional(),
|
|
@@ -1097,7 +1097,7 @@ var w = e.object({
|
|
|
1097
1097
|
default_value: e.string().optional(),
|
|
1098
1098
|
allow_email: e.boolean().optional()
|
|
1099
1099
|
}).optional()
|
|
1100
|
-
}),
|
|
1100
|
+
}), gt = O.extend({
|
|
1101
1101
|
type: e.literal("TEXT"),
|
|
1102
1102
|
config: e.object({
|
|
1103
1103
|
placeholder: e.string().optional(),
|
|
@@ -1107,37 +1107,38 @@ var w = e.object({
|
|
|
1107
1107
|
last_used: e.boolean().optional(),
|
|
1108
1108
|
last_used_label: e.string().optional()
|
|
1109
1109
|
}).optional()
|
|
1110
|
-
}),
|
|
1110
|
+
}), _t = O.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
|
+
}), vt = O.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
|
+
}), yt = e.discriminatedUnion("type", [
|
|
1123
|
+
We,
|
|
1123
1124
|
Ge,
|
|
1124
1125
|
Ke,
|
|
1125
1126
|
qe,
|
|
1126
1127
|
Je,
|
|
1127
1128
|
Ye,
|
|
1128
1129
|
Xe,
|
|
1129
|
-
Ze
|
|
1130
|
-
|
|
1131
|
-
|
|
1130
|
+
Ze
|
|
1131
|
+
]), bt = e.discriminatedUnion("type", [
|
|
1132
|
+
Qe,
|
|
1132
1133
|
$e,
|
|
1133
|
-
et
|
|
1134
|
-
|
|
1135
|
-
|
|
1134
|
+
et
|
|
1135
|
+
]), xt = e.discriminatedUnion("type", [
|
|
1136
|
+
tt,
|
|
1136
1137
|
nt,
|
|
1137
1138
|
rt,
|
|
1138
1139
|
it,
|
|
1140
|
+
_t,
|
|
1139
1141
|
at,
|
|
1140
|
-
vt,
|
|
1141
1142
|
ot,
|
|
1142
1143
|
st,
|
|
1143
1144
|
ct,
|
|
@@ -1149,12 +1150,11 @@ var w = e.object({
|
|
|
1149
1150
|
mt,
|
|
1150
1151
|
ht,
|
|
1151
1152
|
gt,
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1153
|
+
vt
|
|
1154
|
+
]), St = e.union([
|
|
1155
|
+
yt,
|
|
1155
1156
|
bt,
|
|
1156
|
-
xt
|
|
1157
|
-
St
|
|
1157
|
+
xt
|
|
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 k = e.object({
|
|
1185
1185
|
x: e.number(),
|
|
1186
1186
|
y: e.number()
|
|
1187
|
-
}),
|
|
1187
|
+
}), Ct = e.object({
|
|
1188
1188
|
id: e.string(),
|
|
1189
1189
|
type: e.literal("FLOW"),
|
|
1190
|
-
coordinates:
|
|
1190
|
+
coordinates: k,
|
|
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
|
+
}), wt = e.object({
|
|
1197
1197
|
id: e.string(),
|
|
1198
1198
|
type: e.literal("ROUTER"),
|
|
1199
|
-
coordinates:
|
|
1199
|
+
coordinates: k,
|
|
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 O = e.object({
|
|
|
1207
1207
|
})),
|
|
1208
1208
|
fallback: e.string()
|
|
1209
1209
|
})
|
|
1210
|
-
}),
|
|
1210
|
+
}), Tt = e.object({
|
|
1211
1211
|
id: e.string(),
|
|
1212
1212
|
type: e.literal("STEP"),
|
|
1213
|
-
coordinates:
|
|
1213
|
+
coordinates: k,
|
|
1214
1214
|
alias: e.string().min(1).max(150).optional(),
|
|
1215
1215
|
config: e.object({
|
|
1216
|
-
components: e.array(
|
|
1216
|
+
components: e.array(St),
|
|
1217
1217
|
next_node: e.string().optional()
|
|
1218
1218
|
})
|
|
1219
|
-
}),
|
|
1219
|
+
}), Et = e.discriminatedUnion("type", [
|
|
1220
|
+
Ct,
|
|
1220
1221
|
wt,
|
|
1221
|
-
Tt
|
|
1222
|
-
|
|
1223
|
-
]), Ot = e.object({
|
|
1222
|
+
Tt
|
|
1223
|
+
]), Dt = 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 O = 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(Et).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: k.optional()
|
|
1242
1242
|
}).optional(),
|
|
1243
1243
|
ending: e.object({
|
|
1244
1244
|
redirection: e.object({
|
|
@@ -1246,7 +1246,7 @@ var O = 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: k.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 O = 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(Dt.shape).extend({ id: e.string() });
|
|
1259
|
+
var Ot = e.object({
|
|
1260
1260
|
id: e.number().optional(),
|
|
1261
1261
|
text: e.string(),
|
|
1262
1262
|
type: e.enum([
|
|
@@ -1265,7 +1265,7 @@ var kt = e.object({
|
|
|
1265
1265
|
"success",
|
|
1266
1266
|
"warning"
|
|
1267
1267
|
])
|
|
1268
|
-
}),
|
|
1268
|
+
}), kt = 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(St),
|
|
1281
|
+
messages: e.array(Ot).optional(),
|
|
1282
|
+
links: e.array(kt).optional(),
|
|
1283
1283
|
footer: e.string().optional()
|
|
1284
1284
|
});
|
|
1285
|
-
var
|
|
1285
|
+
var A = e.enum([
|
|
1286
1286
|
"pre-user-registration",
|
|
1287
1287
|
"post-user-registration",
|
|
1288
1288
|
"post-user-login",
|
|
@@ -1290,95 +1290,95 @@ var k = e.enum([
|
|
|
1290
1290
|
"validate-registration-username",
|
|
1291
1291
|
"pre-user-deletion",
|
|
1292
1292
|
"post-user-deletion"
|
|
1293
|
-
]),
|
|
1293
|
+
]), j = e.enum(["post-user-login"]), M = e.enum([
|
|
1294
1294
|
"post-user-login",
|
|
1295
1295
|
"post-user-registration",
|
|
1296
1296
|
"post-user-update",
|
|
1297
1297
|
"credentials-exchange"
|
|
1298
|
-
]),
|
|
1298
|
+
]), N = 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
|
+
]), P = e.enum(["post-user-login"]);
|
|
1304
|
+
A.options, j.options, M.options, N.options, P.options;
|
|
1305
|
+
var At = e.enum(["impersonate"]), jt = e.enum([
|
|
1306
1306
|
"ensure-username",
|
|
1307
1307
|
"set-preferred-username",
|
|
1308
1308
|
"account-linking"
|
|
1309
|
-
]),
|
|
1309
|
+
]), F = {
|
|
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: k,
|
|
1318
|
-
url: e.string()
|
|
1319
|
-
}), Pt = e.object({
|
|
1320
|
-
...P,
|
|
1315
|
+
}, Mt = e.object({
|
|
1316
|
+
...F,
|
|
1321
1317
|
trigger_id: A,
|
|
1322
|
-
|
|
1323
|
-
}),
|
|
1324
|
-
...
|
|
1318
|
+
url: e.string()
|
|
1319
|
+
}), Nt = e.object({
|
|
1320
|
+
...F,
|
|
1325
1321
|
trigger_id: j,
|
|
1326
|
-
|
|
1327
|
-
}),
|
|
1328
|
-
...
|
|
1322
|
+
form_id: e.string()
|
|
1323
|
+
}), Pt = e.object({
|
|
1324
|
+
...F,
|
|
1329
1325
|
trigger_id: M,
|
|
1330
|
-
|
|
1331
|
-
}),
|
|
1332
|
-
...
|
|
1326
|
+
template_id: jt
|
|
1327
|
+
}), Ft = e.object({
|
|
1328
|
+
...F,
|
|
1333
1329
|
trigger_id: N,
|
|
1334
|
-
|
|
1330
|
+
code_id: e.string()
|
|
1331
|
+
}), It = e.object({
|
|
1332
|
+
...F,
|
|
1333
|
+
trigger_id: P,
|
|
1334
|
+
page_id: At,
|
|
1335
1335
|
permission_required: e.string().optional()
|
|
1336
1336
|
});
|
|
1337
1337
|
e.union([
|
|
1338
|
+
Mt,
|
|
1338
1339
|
Nt,
|
|
1339
1340
|
Pt,
|
|
1340
1341
|
Ft,
|
|
1341
|
-
It
|
|
1342
|
-
Lt
|
|
1342
|
+
It
|
|
1343
1343
|
]);
|
|
1344
|
-
var
|
|
1345
|
-
...
|
|
1346
|
-
trigger_id:
|
|
1344
|
+
var Lt = e.object({
|
|
1345
|
+
...F,
|
|
1346
|
+
trigger_id: A
|
|
1347
1347
|
}).extend(n.shape).extend({
|
|
1348
1348
|
hook_id: e.string(),
|
|
1349
1349
|
url: e.string()
|
|
1350
|
-
}),
|
|
1351
|
-
...
|
|
1352
|
-
trigger_id:
|
|
1350
|
+
}), Rt = e.object({
|
|
1351
|
+
...F,
|
|
1352
|
+
trigger_id: j
|
|
1353
1353
|
}).extend(n.shape).extend({
|
|
1354
1354
|
hook_id: e.string(),
|
|
1355
1355
|
form_id: e.string()
|
|
1356
|
-
}),
|
|
1357
|
-
...
|
|
1358
|
-
trigger_id:
|
|
1356
|
+
}), zt = e.object({
|
|
1357
|
+
...F,
|
|
1358
|
+
trigger_id: M
|
|
1359
1359
|
}).extend(n.shape).extend({
|
|
1360
1360
|
hook_id: e.string(),
|
|
1361
|
-
template_id:
|
|
1362
|
-
}),
|
|
1363
|
-
...
|
|
1364
|
-
trigger_id:
|
|
1361
|
+
template_id: jt
|
|
1362
|
+
}), Bt = e.object({
|
|
1363
|
+
...F,
|
|
1364
|
+
trigger_id: N
|
|
1365
1365
|
}).extend(n.shape).extend({
|
|
1366
1366
|
hook_id: e.string(),
|
|
1367
1367
|
code_id: e.string()
|
|
1368
|
-
}),
|
|
1369
|
-
...
|
|
1370
|
-
trigger_id:
|
|
1368
|
+
}), Vt = e.object({
|
|
1369
|
+
...F,
|
|
1370
|
+
trigger_id: P
|
|
1371
1371
|
}).extend(n.shape).extend({
|
|
1372
1372
|
hook_id: e.string(),
|
|
1373
|
-
page_id:
|
|
1373
|
+
page_id: At,
|
|
1374
1374
|
permission_required: e.string().optional()
|
|
1375
1375
|
});
|
|
1376
1376
|
e.union([
|
|
1377
|
+
Lt,
|
|
1377
1378
|
Rt,
|
|
1378
1379
|
zt,
|
|
1379
1380
|
Bt,
|
|
1380
|
-
Vt
|
|
1381
|
-
Ht
|
|
1381
|
+
Vt
|
|
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 Ht = e.object({ name: e.string().optional() }), Ut = e.object({ email: e.string().optional() }), Wt = e.object({
|
|
1390
1390
|
id: e.string().optional(),
|
|
1391
1391
|
organization_id: e.string().max(50),
|
|
1392
|
-
inviter:
|
|
1393
|
-
invitee:
|
|
1392
|
+
inviter: Ht,
|
|
1393
|
+
invitee: Ut,
|
|
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(Wt.omit({ id: !0 }).shape);
|
|
1410
|
+
var Gt = e.object({
|
|
1411
1411
|
alg: e.enum([
|
|
1412
1412
|
"RS256",
|
|
1413
1413
|
"RS384",
|
|
@@ -1449,7 +1449,7 @@ var Kt = 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(Gt) }), e.object({
|
|
1453
1453
|
issuer: e.string(),
|
|
1454
1454
|
authorization_endpoint: e.string(),
|
|
1455
1455
|
token_endpoint: e.string(),
|
|
@@ -1476,9 +1476,9 @@ e.object({ keys: e.array(Kt) }), 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 Kt = /* @__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
|
+
}({}), qt = e.nativeEnum(Kt), I = e.object({
|
|
1482
1482
|
strategy: e.string(),
|
|
1483
1483
|
strategy_type: e.string()
|
|
1484
1484
|
});
|
|
@@ -1492,19 +1492,19 @@ e.object({
|
|
|
1492
1492
|
useragent: e.string().optional(),
|
|
1493
1493
|
session_id: e.string().optional(),
|
|
1494
1494
|
authorization_url: e.string().optional(),
|
|
1495
|
-
state:
|
|
1495
|
+
state: qt.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: I.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 L = {
|
|
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 I = {
|
|
|
1664
1664
|
WARNING_DURING_LOGIN: "w",
|
|
1665
1665
|
WARNING_SENDING_NOTIFICATION: "wn",
|
|
1666
1666
|
WARNING_USER_MANAGEMENT: "wum"
|
|
1667
|
-
},
|
|
1668
|
-
|
|
1667
|
+
}, Jt = e.string().refine((e) => Object.values(L).includes(e), { message: "Invalid log type" });
|
|
1668
|
+
L.ACLS_SUMMARY, L.ACTIONS_EXECUTION_FAILED, L.API_LIMIT, L.API_LIMIT_WARNING, L.APPI, L.CIBA_EXCHANGE_FAILED, L.CIBA_EXCHANGE_SUCCEEDED, L.CIBA_START_FAILED, L.CIBA_START_SUCCEEDED, L.CODE_LINK_SENT, L.CODE_SENT, L.DEPRECATION_NOTICE, L.FAILED_LOGIN, L.FAILED_BY_CONNECTOR, L.FAILED_CHANGE_EMAIL, L.FAILED_BY_CORS, L.FAILED_CROSS_ORIGIN_AUTHENTICATION, L.FAILED_CHANGE_PASSWORD, L.FAILED_POST_CHANGE_PASSWORD_HOOK, L.FAILED_CHANGE_PHONE_NUMBER, L.FAILED_CHANGE_PASSWORD_REQUEST, L.FAILED_CONNECTOR_PROVISIONING, L.FAILED_CHANGE_USERNAME, L.FAILED_DELEGATION, L.FAILED_DEVICE_ACTIVATION, L.FAILED_DEVICE_AUTHORIZATION_REQUEST, L.USER_CANCELED_DEVICE_CONFIRMATION, L.FAILED_USER_DELETION, L.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, L.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, L.FAILED_EXCHANGE_CUSTOM_TOKEN, L.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, L.FAILED_FEDERATED_LOGOUT, L.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN, L.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, L.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, L.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, L.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, L.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, L.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN, L.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, L.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, L.FAILED_HOOK, L.FAILED_IMPERSONATION, L.FAILED_INVITE_ACCEPT, L.FAILED_LOGOUT, L.FLOWS_EXECUTION_COMPLETED, L.FLOWS_EXECUTION_FAILED, L.FAILED_SENDING_NOTIFICATION, L.FORMS_SUBMISSION_FAILED, L.FORMS_SUBMISSION_SUCCEEDED, L.FAILED_LOGIN_INCORRECT_PASSWORD, L.FAILED_PUSHED_AUTHORIZATION_REQUEST, L.FAILED_POST_USER_REGISTRATION_HOOK, L.FAILED_SIGNUP, L.FAILED_SILENT_AUTH, L.FAILED_LOGIN_INVALID_EMAIL_USERNAME, L.FAILED_USERS_IMPORT, L.FAILED_VERIFICATION_EMAIL, L.FAILED_VERIFICATION_EMAIL_REQUEST, L.EMAIL_VERIFICATION_CONFIRMED, L.EMAIL_VERIFICATION_FAILED, L.MFA_AUTH_FAILED, L.MFA_AUTH_REJECTED, L.MFA_AUTH_SUCCESS, L.MFA_ENROLLMENT_COMPLETE, L.TOO_MANY_MFA_FAILURES, L.MFA_RECOVERY_FAILED, L.MFA_RECOVERY_RATE_LIMIT_EXCEED, L.MFA_RECOVERY_SUCCESS, L.MFA_EMAIL_SENT, L.EMAIL_VERIFICATION_SENT, L.EMAIL_VERIFICATION_SEND_FAILURE, L.PUSH_NOTIFICATION_SENT, L.ERROR_SENDING_MFA_PUSH_NOTIFICATION, L.MFA_SMS_SENT, L.ERROR_SENDING_MFA_SMS, L.MFA_VOICE_CALL_SUCCESS, L.MFA_VOICE_CALL_FAILED, L.SECOND_FACTOR_STARTED, L.MFA_ENROLL_STARTED, L.MFA_ENROLLMENT_FAILED, L.GUARDIAN_TENANT_UPDATE, L.UNENROLL_DEVICE_ACCOUNT, L.UPDATE_DEVICE_ACCOUNT, L.WEBAUTHN_CHALLENGE_FAILED, L.WEBAUTHN_ENROLLMENT_FAILED, L.FAILED_KMS_API_OPERATION, L.SUCCESS_KMS_API_OPERATION, L.KMS_KEY_STATE_CHANGED, L.TOO_MANY_CALLS_TO_DELEGATION, L.BLOCKED_IP_ADDRESS, L.BLOCKED_ACCOUNT_IP, L.BLOCKED_ACCOUNT_EMAIL, L.INFORMATION, L.MFA_REQUIRED, L.MANAGEMENT_API_READ_OPERATION, L.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, L.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, L.FAILED_OIDC_BACKCHANNEL_LOGOUT, L.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT, L.ORGANIZATION_MEMBER_ADDED, L.PASSKEY_CHALLENGE_FAILED, L.PASSKEY_CHALLENGE_STARTED, L.PRE_LOGIN_ASSESSMENT, L.BREACHED_PASSWORD, L.BREACHED_PASSWORD_ON_RESET, L.SUCCESS_RESOURCE_CLEANUP, L.RICH_CONSENTS_ACCESS_ERROR, L.SUCCESS_LOGIN, L.SUCCESS_API_OPERATION, L.FAILED_API_OPERATION, L.SUCCESS_CHANGE_EMAIL, L.SUCCESS_CROSS_ORIGIN_AUTHENTICATION, L.SUCCESS_CHANGE_PASSWORD, L.SUCCESS_CHANGE_PHONE_NUMBER, L.SUCCESS_CHANGE_PASSWORD_REQUEST, L.SUCCESS_CHANGE_USERNAME, L.SUCCESS_CREDENTIAL_VALIDATION, L.SUCCESS_DELEGATION, L.SUCCESS_USER_DELETION, L.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, L.SUCCESS_EXCHANGE_CUSTOM_TOKEN, L.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN, L.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, L.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, L.SUCCESS_IMPERSONATION, L.SUCCESSFULLY_ACCEPTED_USER_INVITE, L.BREACHED_PASSWORD_ON_SIGNUP, L.SUCCESS_LOGOUT, L.SUCCESS_HOOK, L.SUCCESS_PASSWORD_MIGRATION, L.SUCCESS_REVOCATION, L.SUCCESS_SIGNUP, L.FAILED_SS_SSO_OPERATION, L.INFORMATION_FROM_SS_SSO_OPERATION, L.SUCCESS_SS_SSO_OPERATION, L.SUCCESS_SILENT_AUTH, L.SUCCESSFUL_SCIM_OPERATION, L.SUCCESSFULLY_IMPORTED_USERS, L.SUCCESS_VERIFICATION_EMAIL, L.SUCCESS_VERIFICATION_EMAIL_REQUEST, L.MAX_AMOUNT_OF_AUTHENTICATORS, L.USER_LOGIN_BLOCK_RELEASED, L.FAILED_UNIVERSAL_LOGOUT, L.SUCCESSFUL_UNIVERSAL_LOGOUT, L.WARNING_DURING_LOGIN, L.WARNING_SENDING_NOTIFICATION, L.WARNING_USER_MANAGEMENT, (() => {
|
|
1669
1669
|
let e = {};
|
|
1670
|
-
for (let [t, n] of Object.entries(
|
|
1670
|
+
for (let [t, n] of Object.entries(L)) 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 Yt = e.object({
|
|
1674
1674
|
name: e.string(),
|
|
1675
1675
|
version: e.string(),
|
|
1676
1676
|
env: e.object({ node: e.string().optional() }).optional()
|
|
1677
|
-
}),
|
|
1677
|
+
}), Xt = 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 Xt = e.object({
|
|
|
1683
1683
|
continent_code: e.string()
|
|
1684
1684
|
});
|
|
1685
1685
|
e.object({
|
|
1686
|
-
type:
|
|
1686
|
+
type: Jt,
|
|
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: Yt.optional(),
|
|
1705
1705
|
log_id: e.string().optional(),
|
|
1706
|
-
location_info:
|
|
1706
|
+
location_info: Xt.optional()
|
|
1707
1707
|
}).extend({ log_id: e.string() });
|
|
1708
|
-
var
|
|
1708
|
+
var Zt = e.enum([
|
|
1709
1709
|
"http",
|
|
1710
1710
|
"eventbridge",
|
|
1711
1711
|
"eventgrid",
|
|
1712
1712
|
"splunk",
|
|
1713
1713
|
"datadog",
|
|
1714
1714
|
"sumo"
|
|
1715
|
-
]),
|
|
1715
|
+
]), Qt = e.enum([
|
|
1716
1716
|
"active",
|
|
1717
1717
|
"paused",
|
|
1718
1718
|
"suspended"
|
|
1719
|
-
]),
|
|
1719
|
+
]), $t = 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: Zt,
|
|
1726
|
+
status: Qt.optional(),
|
|
1727
1727
|
sink: e.record(e.string(), e.unknown()),
|
|
1728
|
-
filters: e.array(
|
|
1728
|
+
filters: e.array($t).optional(),
|
|
1729
1729
|
isPriority: e.boolean().optional()
|
|
1730
1730
|
}).extend({
|
|
1731
1731
|
id: e.string(),
|
|
1732
|
-
status:
|
|
1732
|
+
status: Qt,
|
|
1733
1733
|
created_at: e.string().optional(),
|
|
1734
1734
|
updated_at: e.string().optional()
|
|
1735
1735
|
});
|
|
1736
|
-
var
|
|
1736
|
+
var en = e.enum([
|
|
1737
1737
|
"auth0",
|
|
1738
1738
|
"cognito",
|
|
1739
1739
|
"okta",
|
|
1740
1740
|
"oidc"
|
|
1741
|
-
]),
|
|
1741
|
+
]), tn = 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
|
+
}), nn = e.object({
|
|
1748
1748
|
id: e.string().optional(),
|
|
1749
1749
|
name: e.string(),
|
|
1750
|
-
provider:
|
|
1750
|
+
provider: en,
|
|
1751
1751
|
connection: e.string(),
|
|
1752
1752
|
enabled: e.boolean().default(!0),
|
|
1753
|
-
credentials:
|
|
1753
|
+
credentials: tn
|
|
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(nn.shape);
|
|
1760
|
+
var rn = 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 an = 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
|
+
}), an = 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
|
+
}), on = 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 an = 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
|
+
}), sn = e.object({
|
|
1790
|
+
breached_password_detection: rn.optional(),
|
|
1791
|
+
brute_force_protection: an.optional(),
|
|
1792
|
+
suspicious_ip_throttling: on.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 cn = 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
|
+
}), ln = 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 ln = 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: cn.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(ln.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 un = 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 dn = 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: sn.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 dn = 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(un.shape).extend({
|
|
1995
1995
|
id: e.string(),
|
|
1996
1996
|
is_control_plane: e.boolean().optional()
|
|
1997
1997
|
});
|
|
1998
|
-
var
|
|
1998
|
+
var dn = e.enum([
|
|
1999
1999
|
"provision",
|
|
2000
2000
|
"seed",
|
|
2001
2001
|
"upgrade",
|
|
2002
2002
|
"backup",
|
|
2003
2003
|
"deprovision",
|
|
2004
2004
|
"users_import"
|
|
2005
|
-
]),
|
|
2005
|
+
]), fn = e.enum([
|
|
2006
2006
|
"pending",
|
|
2007
2007
|
"running",
|
|
2008
2008
|
"succeeded",
|
|
2009
2009
|
"failed",
|
|
2010
2010
|
"cancelled"
|
|
2011
|
-
]),
|
|
2011
|
+
]), pn = 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: dn,
|
|
2016
|
+
engine: pn,
|
|
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: fn,
|
|
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 mn = e.enum([
|
|
2046
2046
|
"started",
|
|
2047
2047
|
"succeeded",
|
|
2048
2048
|
"failed",
|
|
@@ -2053,14 +2053,14 @@ var hn = 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: mn,
|
|
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 R = 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: R.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: R,
|
|
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: R,
|
|
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 hn = e.enum([
|
|
2092
2092
|
"upgrade",
|
|
2093
2093
|
"reseed",
|
|
2094
2094
|
"backup"
|
|
2095
|
-
]),
|
|
2095
|
+
]), gn = e.enum([
|
|
2096
2096
|
"pending",
|
|
2097
2097
|
"canary",
|
|
2098
2098
|
"rolling",
|
|
@@ -2101,7 +2101,7 @@ var gn = e.enum([
|
|
|
2101
2101
|
"failed"
|
|
2102
2102
|
]);
|
|
2103
2103
|
e.object({
|
|
2104
|
-
kind:
|
|
2104
|
+
kind: hn,
|
|
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: gn,
|
|
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 _n = 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 vn = 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
|
+
}), vn = 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 vn = e.object({
|
|
|
2174
2174
|
success: e.string(),
|
|
2175
2175
|
widget_background: e.string(),
|
|
2176
2176
|
widget_border: e.string()
|
|
2177
|
-
}),
|
|
2177
|
+
}), z = e.object({
|
|
2178
2178
|
bold: e.boolean(),
|
|
2179
2179
|
size: e.number()
|
|
2180
|
-
}),
|
|
2181
|
-
body_text:
|
|
2182
|
-
buttons_text:
|
|
2180
|
+
}), yn = e.object({
|
|
2181
|
+
body_text: z,
|
|
2182
|
+
buttons_text: z,
|
|
2183
2183
|
font_url: e.string(),
|
|
2184
|
-
input_labels:
|
|
2185
|
-
links:
|
|
2184
|
+
input_labels: z,
|
|
2185
|
+
links: z,
|
|
2186
2186
|
links_style: e.enum(["normal", "underlined"]),
|
|
2187
2187
|
reference_text_size: e.number(),
|
|
2188
|
-
subtitle:
|
|
2189
|
-
title:
|
|
2190
|
-
}),
|
|
2188
|
+
subtitle: z,
|
|
2189
|
+
title: z
|
|
2190
|
+
}), bn = 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 vn = e.object({
|
|
|
2200
2200
|
"chip",
|
|
2201
2201
|
"none"
|
|
2202
2202
|
]).optional()
|
|
2203
|
-
}),
|
|
2203
|
+
}), xn = e.object({
|
|
2204
2204
|
header_text_alignment: e.enum([
|
|
2205
2205
|
"center",
|
|
2206
2206
|
"left",
|
|
@@ -2217,12 +2217,12 @@ var vn = e.object({
|
|
|
2217
2217
|
social_buttons_layout: e.enum(["bottom", "top"])
|
|
2218
2218
|
});
|
|
2219
2219
|
e.object({
|
|
2220
|
-
borders:
|
|
2221
|
-
colors:
|
|
2220
|
+
borders: _n,
|
|
2221
|
+
colors: vn,
|
|
2222
2222
|
displayName: e.string(),
|
|
2223
|
-
fonts:
|
|
2224
|
-
page_background:
|
|
2225
|
-
widget:
|
|
2223
|
+
fonts: yn,
|
|
2224
|
+
page_background: bn,
|
|
2225
|
+
widget: xn
|
|
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 Sn = 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
|
+
}), Cn = e.object({
|
|
2240
2240
|
type: e.string(),
|
|
2241
2241
|
options: e.record(e.string(), e.unknown()).default({})
|
|
2242
|
-
}),
|
|
2242
|
+
}), B = 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: Sn,
|
|
2247
|
+
handlers: e.array(Cn).min(1)
|
|
2248
|
+
}), wn = B.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
|
+
}), Tn = B.partial().omit({
|
|
2254
2254
|
id: !0,
|
|
2255
2255
|
custom_domain_id: !0
|
|
2256
|
-
}),
|
|
2256
|
+
}), En = e.object({
|
|
2257
2257
|
scim: e.string(),
|
|
2258
2258
|
auth0: e.string()
|
|
2259
|
-
}),
|
|
2259
|
+
}), Dn = 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(En).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(Dn.shape);
|
|
2268
|
+
var On = 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 kn = 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(On.shape);
|
|
2279
|
+
var kn = 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(kn.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 An = e.enum([
|
|
2292
2292
|
"verify_email",
|
|
2293
2293
|
"verify_email_by_code",
|
|
2294
2294
|
"reset_email",
|
|
@@ -2303,7 +2303,7 @@ var jn = e.enum([
|
|
|
2303
2303
|
"user_invitation"
|
|
2304
2304
|
]);
|
|
2305
2305
|
e.object({
|
|
2306
|
-
template:
|
|
2306
|
+
template: An,
|
|
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: I.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: cn,
|
|
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 jn = e.object({
|
|
2349
2349
|
value: e.string(),
|
|
2350
2350
|
description: e.string().optional()
|
|
2351
|
-
}),
|
|
2351
|
+
}), Mn = 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 Mn = 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
|
+
}), Nn = 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(jn).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 Mn = 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: Mn.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(Nn);
|
|
2379
|
+
var Pn = 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(Pn), 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(Fn), 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 Fn = 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 In = 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(Fn);
|
|
2407
|
+
var In = 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 Ln = 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(In);
|
|
2417
|
+
var Ln = 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 Rn = 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(Ln);
|
|
2426
|
+
var Rn = 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 zn = 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(Rn);
|
|
2438
|
+
var zn = 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(), Bn = 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
|
+
}), Vn = 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: zn,
|
|
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(Bn).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2461
|
+
token_quota: Vn
|
|
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 Hn = 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 Un = e.object({
|
|
|
2476
2476
|
created_at: e.string().optional(),
|
|
2477
2477
|
updated_at: e.string().optional()
|
|
2478
2478
|
});
|
|
2479
|
-
e.array(
|
|
2479
|
+
e.array(Hn), 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(Un), e.object({
|
|
|
2615
2615
|
"passwordless",
|
|
2616
2616
|
"enterprise"
|
|
2617
2617
|
]);
|
|
2618
|
-
var
|
|
2618
|
+
var Un = 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(Un)
|
|
2628
2628
|
});
|
|
2629
|
-
var
|
|
2629
|
+
var Wn = 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(Wn)
|
|
2639
2639
|
});
|
|
2640
|
-
var
|
|
2640
|
+
var Gn = e.object({
|
|
2641
2641
|
name: e.string(),
|
|
2642
2642
|
type: e.string()
|
|
2643
|
-
}),
|
|
2643
|
+
}), Kn = 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(Gn),
|
|
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: Kn.optional()
|
|
2654
2654
|
});
|
|
2655
|
-
var
|
|
2655
|
+
var qn = 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(".")), Jn = 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 Jn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.
|
|
|
2660
2660
|
}
|
|
2661
2661
|
});
|
|
2662
2662
|
e.object({
|
|
2663
|
-
prompt:
|
|
2663
|
+
prompt: qn,
|
|
2664
2664
|
language: e.string(),
|
|
2665
|
-
custom_text:
|
|
2665
|
+
custom_text: Jn
|
|
2666
2666
|
});
|
|
2667
|
-
var
|
|
2667
|
+
var Yn = e.enum([
|
|
2668
2668
|
"phone",
|
|
2669
2669
|
"totp",
|
|
2670
2670
|
"email",
|
|
@@ -2672,9 +2672,9 @@ var Xn = e.enum([
|
|
|
2672
2672
|
"webauthn-roaming",
|
|
2673
2673
|
"webauthn-platform",
|
|
2674
2674
|
"passkey"
|
|
2675
|
-
]),
|
|
2675
|
+
]), Xn = e.object({
|
|
2676
2676
|
user_id: e.string(),
|
|
2677
|
-
type:
|
|
2677
|
+
type: Yn,
|
|
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 Xn = e.enum([
|
|
|
2685
2685
|
friendly_name: e.string().optional(),
|
|
2686
2686
|
confirmed: e.boolean().default(!1)
|
|
2687
2687
|
});
|
|
2688
|
-
function
|
|
2688
|
+
function Zn(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,31 +2708,31 @@ function Qn(t, n) {
|
|
|
2708
2708
|
path: ["public_key"]
|
|
2709
2709
|
}));
|
|
2710
2710
|
}
|
|
2711
|
-
|
|
2711
|
+
Xn.superRefine(Zn), Xn.extend({
|
|
2712
2712
|
id: e.string(),
|
|
2713
2713
|
created_at: e.string(),
|
|
2714
2714
|
updated_at: e.string()
|
|
2715
|
-
}).superRefine(
|
|
2715
|
+
}).superRefine(Zn), 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
|
|
2720
|
+
var Qn = "x-authhero-preserve-location", V = class extends Error {
|
|
2721
2721
|
ms;
|
|
2722
2722
|
constructor(e, t) {
|
|
2723
2723
|
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2724
2724
|
}
|
|
2725
2725
|
};
|
|
2726
|
-
function
|
|
2727
|
-
return e instanceof
|
|
2726
|
+
function H(e) {
|
|
2727
|
+
return e instanceof V ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2728
2728
|
}
|
|
2729
|
-
function
|
|
2729
|
+
function U(e, t) {
|
|
2730
2730
|
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
2731
2731
|
return t(n.signal).finally(() => clearTimeout(r));
|
|
2732
2732
|
}
|
|
2733
|
-
function
|
|
2733
|
+
function W(e, t, n) {
|
|
2734
2734
|
let r, i = new Promise((e, i) => {
|
|
2735
|
-
r = setTimeout(() => i(new
|
|
2735
|
+
r = setTimeout(() => i(new V(t, n)), t);
|
|
2736
2736
|
});
|
|
2737
2737
|
return Promise.race([e, i]).finally(() => {
|
|
2738
2738
|
r && clearTimeout(r);
|
|
@@ -2740,12 +2740,12 @@ function U(e, t, n) {
|
|
|
2740
2740
|
}
|
|
2741
2741
|
//#endregion
|
|
2742
2742
|
//#region src/data-plane/cache.ts
|
|
2743
|
-
var
|
|
2744
|
-
function
|
|
2743
|
+
var $n = 1e4, er = 8e3;
|
|
2744
|
+
function G(e, t, n) {
|
|
2745
2745
|
let r = typeof t == "number" ? {
|
|
2746
2746
|
freshTtlMs: t,
|
|
2747
2747
|
maxEntries: n
|
|
2748
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ??
|
|
2748
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ?? $n, l = r.waitUntil, u = r.upstreamTimeoutMs ?? er, d = u > 0 ? u : 1e4, f = /* @__PURE__ */ new Map();
|
|
2749
2749
|
function p(e) {
|
|
2750
2750
|
for (let [t, n] of f) n.stale_if_error_until <= e && n.stale_until <= e && f.delete(t);
|
|
2751
2751
|
for (; f.size >= c;) {
|
|
@@ -2768,7 +2768,7 @@ function W(e, t, n) {
|
|
|
2768
2768
|
}
|
|
2769
2769
|
function g(t) {
|
|
2770
2770
|
let n = e.resolveHost(t);
|
|
2771
|
-
return u > 0 ?
|
|
2771
|
+
return u > 0 ? W(n, u, "resolveHost") : n;
|
|
2772
2772
|
}
|
|
2773
2773
|
async function _(e) {
|
|
2774
2774
|
let t = f.get(e);
|
|
@@ -2801,7 +2801,7 @@ function W(e, t, n) {
|
|
|
2801
2801
|
}
|
|
2802
2802
|
//#endregion
|
|
2803
2803
|
//#region src/data-plane/registry.ts
|
|
2804
|
-
var
|
|
2804
|
+
var tr = class {
|
|
2805
2805
|
definitions = /* @__PURE__ */ new Map();
|
|
2806
2806
|
bindings;
|
|
2807
2807
|
constructor(e = {}) {
|
|
@@ -2821,20 +2821,23 @@ var nr = class {
|
|
|
2821
2821
|
return n.build(r.data, { bindings: this.bindings });
|
|
2822
2822
|
}
|
|
2823
2823
|
};
|
|
2824
|
-
function
|
|
2824
|
+
function K(e) {
|
|
2825
2825
|
return e;
|
|
2826
2826
|
}
|
|
2827
2827
|
//#endregion
|
|
2828
2828
|
//#region src/data-plane/handlers/util.ts
|
|
2829
|
-
var
|
|
2830
|
-
function
|
|
2831
|
-
e.set(
|
|
2829
|
+
var nr = "__authhero_proxy_request__", rr = "__authhero_proxy_tenant_id__", ir = "__authhero_proxy_custom_domain_id__", ar = "__authhero_proxy_domain__", or = "x-authhero-proxy-mutability-probe";
|
|
2830
|
+
function sr(e, t) {
|
|
2831
|
+
e.set(nr, t);
|
|
2832
2832
|
}
|
|
2833
|
-
function
|
|
2834
|
-
return e.get(
|
|
2833
|
+
function q(e) {
|
|
2834
|
+
return e.get(nr) ?? e.req.raw;
|
|
2835
|
+
}
|
|
2836
|
+
function cr(e, t) {
|
|
2837
|
+
e.set(rr, t.tenant_id), e.set(ir, t.custom_domain_id), e.set(ar, t.domain);
|
|
2835
2838
|
}
|
|
2836
|
-
function lr(e
|
|
2837
|
-
|
|
2839
|
+
function lr(e) {
|
|
2840
|
+
return e.get(rr);
|
|
2838
2841
|
}
|
|
2839
2842
|
function ur(e) {
|
|
2840
2843
|
return e.get(ir);
|
|
@@ -2842,17 +2845,14 @@ function ur(e) {
|
|
|
2842
2845
|
function dr(e) {
|
|
2843
2846
|
return e.get(ar);
|
|
2844
2847
|
}
|
|
2845
|
-
function fr(e) {
|
|
2846
|
-
|
|
2848
|
+
function fr(e, t) {
|
|
2849
|
+
let n = q(e), r = new Headers(n.headers);
|
|
2850
|
+
t(r), sr(e, new Request(n, { headers: r }));
|
|
2847
2851
|
}
|
|
2848
|
-
function
|
|
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) {
|
|
2852
|
+
function J(e) {
|
|
2853
2853
|
let t = e.res;
|
|
2854
2854
|
try {
|
|
2855
|
-
t.headers.append(
|
|
2855
|
+
t.headers.append(or, "1"), t.headers.delete(or);
|
|
2856
2856
|
return;
|
|
2857
2857
|
} catch {
|
|
2858
2858
|
e.res = new Response(t.body, {
|
|
@@ -2864,7 +2864,7 @@ function q(e) {
|
|
|
2864
2864
|
}
|
|
2865
2865
|
//#endregion
|
|
2866
2866
|
//#region src/data-plane/handlers/cors.ts
|
|
2867
|
-
var
|
|
2867
|
+
var pr = e.object({
|
|
2868
2868
|
origins: e.array(e.string()).optional(),
|
|
2869
2869
|
allow_credentials: e.boolean().optional(),
|
|
2870
2870
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2872,44 +2872,44 @@ var mr = e.object({
|
|
|
2872
2872
|
expose_headers: e.array(e.string()).optional(),
|
|
2873
2873
|
max_age: e.number().int().optional()
|
|
2874
2874
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2875
|
-
function
|
|
2875
|
+
function mr(e, t) {
|
|
2876
2876
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2877
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;
|
|
2878
2878
|
}
|
|
2879
|
-
var
|
|
2879
|
+
var hr = K({
|
|
2880
2880
|
type: "cors",
|
|
2881
|
-
optionsSchema:
|
|
2881
|
+
optionsSchema: pr,
|
|
2882
2882
|
build(e) {
|
|
2883
2883
|
return async (t, n) => {
|
|
2884
2884
|
let r = t.req.header("origin") ?? null;
|
|
2885
2885
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2886
|
-
let t =
|
|
2886
|
+
let t = mr(e, r);
|
|
2887
2887
|
return new Response(null, {
|
|
2888
2888
|
status: 204,
|
|
2889
2889
|
headers: t
|
|
2890
2890
|
});
|
|
2891
2891
|
}
|
|
2892
2892
|
await n();
|
|
2893
|
-
let i =
|
|
2894
|
-
|
|
2893
|
+
let i = mr(e, r);
|
|
2894
|
+
J(t), i.forEach((e, n) => {
|
|
2895
2895
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2896
2896
|
});
|
|
2897
2897
|
};
|
|
2898
2898
|
}
|
|
2899
|
-
}),
|
|
2899
|
+
}), gr = e.object({
|
|
2900
2900
|
username: e.string(),
|
|
2901
2901
|
password: e.string(),
|
|
2902
2902
|
realm: e.string().optional()
|
|
2903
2903
|
});
|
|
2904
|
-
function
|
|
2904
|
+
function _r(e, t) {
|
|
2905
2905
|
let n = `${e}:${t}`;
|
|
2906
2906
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2907
2907
|
}
|
|
2908
|
-
var
|
|
2908
|
+
var vr = K({
|
|
2909
2909
|
type: "basic_auth",
|
|
2910
|
-
optionsSchema:
|
|
2910
|
+
optionsSchema: gr,
|
|
2911
2911
|
build(e) {
|
|
2912
|
-
let t =
|
|
2912
|
+
let t = _r(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2913
2913
|
return async (e, r) => {
|
|
2914
2914
|
let i = e.req.header("authorization");
|
|
2915
2915
|
if (i) {
|
|
@@ -2925,7 +2925,7 @@ var yr = G({
|
|
|
2925
2925
|
});
|
|
2926
2926
|
};
|
|
2927
2927
|
}
|
|
2928
|
-
}),
|
|
2928
|
+
}), yr = K({
|
|
2929
2929
|
type: "headers",
|
|
2930
2930
|
optionsSchema: e.object({
|
|
2931
2931
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2935,23 +2935,23 @@ var yr = G({
|
|
|
2935
2935
|
}),
|
|
2936
2936
|
build(e) {
|
|
2937
2937
|
return async (t, n) => {
|
|
2938
|
-
if ((e.request || e.remove_request) &&
|
|
2938
|
+
if ((e.request || e.remove_request) && fr(t, (t) => {
|
|
2939
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);
|
|
2940
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
2940
|
+
}), await n(), (e.response || e.remove_response) && (J(t), e.remove_response?.forEach((e) => t.res.headers.delete(e)), e.response)) for (let [n, r] of Object.entries(e.response)) t.res.headers.set(n, r);
|
|
2941
2941
|
};
|
|
2942
2942
|
}
|
|
2943
|
-
}),
|
|
2943
|
+
}), br = K({
|
|
2944
2944
|
type: "cache",
|
|
2945
2945
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2946
2946
|
build(e) {
|
|
2947
2947
|
return async (t, n) => {
|
|
2948
2948
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2949
2949
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2950
|
-
|
|
2950
|
+
J(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2951
2951
|
}
|
|
2952
2952
|
};
|
|
2953
2953
|
}
|
|
2954
|
-
}),
|
|
2954
|
+
}), xr = [
|
|
2955
2955
|
"173.245.48.0/20",
|
|
2956
2956
|
"103.21.244.0/22",
|
|
2957
2957
|
"103.22.200.0/22",
|
|
@@ -2975,7 +2975,7 @@ var yr = G({
|
|
|
2975
2975
|
"2a06:98c0::/29",
|
|
2976
2976
|
"2c0f:f248::/32"
|
|
2977
2977
|
];
|
|
2978
|
-
function
|
|
2978
|
+
function Sr(e) {
|
|
2979
2979
|
let t = e.split(".");
|
|
2980
2980
|
if (t.length !== 4) return null;
|
|
2981
2981
|
let n = [];
|
|
@@ -2987,14 +2987,14 @@ function Cr(e) {
|
|
|
2987
2987
|
}
|
|
2988
2988
|
return n;
|
|
2989
2989
|
}
|
|
2990
|
-
function
|
|
2990
|
+
function Cr(e) {
|
|
2991
2991
|
if (e === "") return [];
|
|
2992
2992
|
let t = e.split(":"), n = [];
|
|
2993
2993
|
for (let e = 0; e < t.length; e++) {
|
|
2994
2994
|
let r = t[e];
|
|
2995
2995
|
if (r.includes(".")) {
|
|
2996
2996
|
if (e !== t.length - 1) return null;
|
|
2997
|
-
let i =
|
|
2997
|
+
let i = Sr(r);
|
|
2998
2998
|
if (!i) return null;
|
|
2999
2999
|
n.push(i[0] << 8 | i[1], i[2] << 8 | i[3]);
|
|
3000
3000
|
continue;
|
|
@@ -3004,14 +3004,14 @@ function wr(e) {
|
|
|
3004
3004
|
}
|
|
3005
3005
|
return n;
|
|
3006
3006
|
}
|
|
3007
|
-
function
|
|
3007
|
+
function wr(e) {
|
|
3008
3008
|
let t = e.split("::");
|
|
3009
3009
|
if (t.length > 2) return null;
|
|
3010
|
-
let n =
|
|
3010
|
+
let n = Cr(t[0] ?? "");
|
|
3011
3011
|
if (!n) return null;
|
|
3012
3012
|
let r;
|
|
3013
3013
|
if (t.length === 2) {
|
|
3014
|
-
let e =
|
|
3014
|
+
let e = Cr(t[1] ?? "");
|
|
3015
3015
|
if (!e) return null;
|
|
3016
3016
|
let i = 8 - n.length - e.length;
|
|
3017
3017
|
if (i < 1) return null;
|
|
@@ -3026,25 +3026,25 @@ function Tr(e) {
|
|
|
3026
3026
|
for (let e of r) i.push(e >> 8 & 255, e & 255);
|
|
3027
3027
|
return i;
|
|
3028
3028
|
}
|
|
3029
|
-
function
|
|
3029
|
+
function Tr(e) {
|
|
3030
3030
|
let t = e.trim();
|
|
3031
3031
|
t.startsWith("[") && t.endsWith("]") && (t = t.slice(1, -1));
|
|
3032
3032
|
let n = t.indexOf("%");
|
|
3033
3033
|
if (n !== -1 && (t = t.slice(0, n)), t === "") return null;
|
|
3034
|
-
if (!t.includes(":")) return
|
|
3035
|
-
let r =
|
|
3034
|
+
if (!t.includes(":")) return Sr(t);
|
|
3035
|
+
let r = wr(t);
|
|
3036
3036
|
return r ? r.slice(0, 10).every((e) => e === 0) && r[10] === 255 && r[11] === 255 ? r.slice(12) : r : null;
|
|
3037
3037
|
}
|
|
3038
|
-
function
|
|
3039
|
-
let [t, n] = e.split("/"), r =
|
|
3038
|
+
function Er(e) {
|
|
3039
|
+
let [t, n] = e.split("/"), r = Tr(t ?? ""), i = Number(n);
|
|
3040
3040
|
if (!r || !Number.isInteger(i)) throw Error(`Invalid Cloudflare CIDR: ${e}`);
|
|
3041
3041
|
return {
|
|
3042
3042
|
bytes: r,
|
|
3043
3043
|
prefixBits: i
|
|
3044
3044
|
};
|
|
3045
3045
|
}
|
|
3046
|
-
var
|
|
3047
|
-
function
|
|
3046
|
+
var Dr = xr.map(Er);
|
|
3047
|
+
function Or(e, t) {
|
|
3048
3048
|
if (e.length !== t.bytes.length) return !1;
|
|
3049
3049
|
let n = t.prefixBits >> 3;
|
|
3050
3050
|
for (let r = 0; r < n; r++) if (e[r] !== t.bytes[r]) return !1;
|
|
@@ -3053,11 +3053,11 @@ function kr(e, t) {
|
|
|
3053
3053
|
let i = 255 << 8 - r & 255;
|
|
3054
3054
|
return (e[n] & i) === (t.bytes[n] & i);
|
|
3055
3055
|
}
|
|
3056
|
-
function
|
|
3057
|
-
let t =
|
|
3058
|
-
return t ?
|
|
3056
|
+
function kr(e) {
|
|
3057
|
+
let t = Tr(e);
|
|
3058
|
+
return t ? Dr.some((e) => Or(t, e)) : !1;
|
|
3059
3059
|
}
|
|
3060
|
-
var
|
|
3060
|
+
var Ar = K({
|
|
3061
3061
|
type: "forwarded_headers",
|
|
3062
3062
|
optionsSchema: e.object({
|
|
3063
3063
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -3068,46 +3068,46 @@ var jr = G({
|
|
|
3068
3068
|
build(e) {
|
|
3069
3069
|
return async (t, n) => {
|
|
3070
3070
|
let r = new URL(t.req.url);
|
|
3071
|
-
|
|
3071
|
+
fr(t, (n) => {
|
|
3072
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);
|
|
3073
|
-
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 && kr(i) ? null : i, o = (n.get("x-forwarded-for") ?? "").split(",").map((e) => e.trim()).filter(Boolean), s = a ?? o[o.length - 1] ?? "127.0.0.1", c = o.length === 0 || o[o.length - 1] !== s, l = o.length ? c ? `${o.join(", ")}, ${s}` : o.join(", ") : s;
|
|
3074
3074
|
n.set("x-forwarded-for", l), e.set_x_real_ip && n.set("x-real-ip", s);
|
|
3075
3075
|
}), await n();
|
|
3076
3076
|
};
|
|
3077
3077
|
}
|
|
3078
|
-
}),
|
|
3079
|
-
function
|
|
3078
|
+
}), jr = e.object({ upstream_host: e.string().optional() });
|
|
3079
|
+
function Mr(e) {
|
|
3080
3080
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3081
3081
|
}
|
|
3082
|
-
function
|
|
3082
|
+
function Nr(e) {
|
|
3083
3083
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
3084
3084
|
let t = [];
|
|
3085
3085
|
return e.forEach((e, n) => {
|
|
3086
3086
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
3087
3087
|
}), t;
|
|
3088
3088
|
}
|
|
3089
|
-
var
|
|
3089
|
+
var Pr = K({
|
|
3090
3090
|
type: "rewrite_cookies",
|
|
3091
|
-
optionsSchema:
|
|
3091
|
+
optionsSchema: jr,
|
|
3092
3092
|
build(e) {
|
|
3093
3093
|
return async (t, n) => {
|
|
3094
3094
|
await n();
|
|
3095
3095
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
3096
3096
|
if (!i) return;
|
|
3097
|
-
let a =
|
|
3097
|
+
let a = Nr(t.res.headers);
|
|
3098
3098
|
if (a.length === 0) return;
|
|
3099
|
-
let o =
|
|
3100
|
-
|
|
3099
|
+
let o = Mr(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
3100
|
+
J(t), t.res.headers.delete("set-cookie");
|
|
3101
3101
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
3102
3102
|
};
|
|
3103
3103
|
}
|
|
3104
|
-
}),
|
|
3104
|
+
}), Fr = K({
|
|
3105
3105
|
type: "rewrite_location",
|
|
3106
3106
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
3107
3107
|
build(e) {
|
|
3108
3108
|
return async (t, n) => {
|
|
3109
3109
|
if (await n(), t.res.headers.has("x-authhero-preserve-location")) {
|
|
3110
|
-
|
|
3110
|
+
J(t), t.res.headers.delete(Qn);
|
|
3111
3111
|
return;
|
|
3112
3112
|
}
|
|
3113
3113
|
let r = t.res.status;
|
|
@@ -3124,10 +3124,10 @@ var Fr = G({
|
|
|
3124
3124
|
}
|
|
3125
3125
|
if (o.origin !== a) return;
|
|
3126
3126
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
3127
|
-
|
|
3127
|
+
J(t), t.res.headers.set("location", c);
|
|
3128
3128
|
};
|
|
3129
3129
|
}
|
|
3130
|
-
}),
|
|
3130
|
+
}), Ir = new Set([
|
|
3131
3131
|
"connection",
|
|
3132
3132
|
"keep-alive",
|
|
3133
3133
|
"proxy-authenticate",
|
|
@@ -3136,113 +3136,166 @@ var Fr = G({
|
|
|
3136
3136
|
"trailers",
|
|
3137
3137
|
"transfer-encoding",
|
|
3138
3138
|
"upgrade"
|
|
3139
|
-
]),
|
|
3139
|
+
]), Lr = 3e4, Rr = e.object({
|
|
3140
3140
|
upstream_url: e.string(),
|
|
3141
3141
|
preserve_host: e.boolean().default(!1),
|
|
3142
3142
|
timeout_ms: e.number().int().positive().optional()
|
|
3143
3143
|
});
|
|
3144
|
-
function
|
|
3144
|
+
function zr(e, t) {
|
|
3145
3145
|
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function Br(e) {
|
|
3148
3148
|
return e !== "GET" && e !== "HEAD";
|
|
3149
3149
|
}
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3150
|
+
var Vr = 128 * 1024;
|
|
3151
|
+
function Hr(e) {
|
|
3152
|
+
let t = e.headers.get("content-length");
|
|
3153
|
+
if (t === null) return null;
|
|
3154
|
+
let n = Number(t);
|
|
3155
|
+
return Number.isInteger(n) && n >= 0 ? n : null;
|
|
3156
|
+
}
|
|
3157
|
+
async function Ur(e, t) {
|
|
3158
|
+
let n = e.getReader(), r = !1, i = setTimeout(() => {
|
|
3159
|
+
r = !0, n.cancel().catch(() => {});
|
|
3160
|
+
}, t), a = [], o = 0;
|
|
3161
|
+
try {
|
|
3162
|
+
for (;;) {
|
|
3163
|
+
let { done: e, value: i } = await n.read();
|
|
3164
|
+
if (r) throw new V(t, "Request body read");
|
|
3165
|
+
if (e) break;
|
|
3166
|
+
a.push(i), o += i.byteLength;
|
|
3167
|
+
}
|
|
3168
|
+
} finally {
|
|
3169
|
+
clearTimeout(i);
|
|
3170
|
+
}
|
|
3171
|
+
let s = new Uint8Array(o), c = 0;
|
|
3172
|
+
for (let e of a) s.set(e, c), c += e.byteLength;
|
|
3173
|
+
return s.buffer;
|
|
3174
|
+
}
|
|
3175
|
+
function Wr(e) {
|
|
3176
|
+
return H(e) ? new Response("Request body timeout", {
|
|
3177
|
+
status: 408,
|
|
3178
|
+
headers: { "x-authhero-proxy-error": "request_body_timeout" }
|
|
3179
|
+
}) : new Response("Bad request", {
|
|
3180
|
+
status: 400,
|
|
3181
|
+
headers: { "x-authhero-proxy-error": "request_body_failed" }
|
|
3182
|
+
});
|
|
3183
|
+
}
|
|
3184
|
+
async function Gr(e, t, n) {
|
|
3185
|
+
if (!Br(e.method) || !e.body) return;
|
|
3186
|
+
let r = Hr(e);
|
|
3187
|
+
if (r === null || r > Vr) return e.body;
|
|
3188
|
+
let i = await Ur(e.body, n);
|
|
3189
|
+
return t.set("content-length", String(i.byteLength)), i;
|
|
3190
|
+
}
|
|
3191
|
+
async function Kr(e, t, n) {
|
|
3192
|
+
let r = new URL(t.url), i = new URL(e.upstream_url);
|
|
3193
|
+
i.pathname = zr(i.pathname, r.pathname), i.search = r.search;
|
|
3194
|
+
let a = new Headers(t.headers);
|
|
3195
|
+
for (let e of Ir) a.delete(e);
|
|
3196
|
+
e.preserve_host || a.set("host", i.host), a.has("x-forwarded-host") || a.set("x-forwarded-host", r.host), a.has("x-forwarded-proto") || a.set("x-forwarded-proto", r.protocol.replace(":", ""));
|
|
3197
|
+
let o = await Gr(t, a, n), s = {
|
|
3157
3198
|
method: t.method,
|
|
3158
|
-
headers:
|
|
3159
|
-
body:
|
|
3199
|
+
headers: a,
|
|
3200
|
+
body: o,
|
|
3160
3201
|
redirect: "manual"
|
|
3161
3202
|
};
|
|
3162
|
-
return
|
|
3163
|
-
target:
|
|
3164
|
-
init:
|
|
3203
|
+
return o instanceof ReadableStream && (s.duplex = "half"), {
|
|
3204
|
+
target: i,
|
|
3205
|
+
init: s
|
|
3165
3206
|
};
|
|
3166
3207
|
}
|
|
3167
|
-
var
|
|
3208
|
+
var qr = K({
|
|
3168
3209
|
type: "http",
|
|
3169
|
-
optionsSchema:
|
|
3210
|
+
optionsSchema: Rr,
|
|
3170
3211
|
build(e) {
|
|
3171
|
-
let t = e.timeout_ms ??
|
|
3212
|
+
let t = e.timeout_ms ?? Lr;
|
|
3172
3213
|
return async (n) => {
|
|
3173
|
-
let
|
|
3174
|
-
n.set("__proxy_upstream_host__", r.hostname), n.set("__proxy_upstream_origin__", `${r.protocol}//${r.host}`);
|
|
3214
|
+
let r = q(n), i;
|
|
3175
3215
|
try {
|
|
3176
|
-
|
|
3177
|
-
|
|
3216
|
+
i = await Kr(e, r, t);
|
|
3217
|
+
} catch (e) {
|
|
3218
|
+
return Wr(e);
|
|
3219
|
+
}
|
|
3220
|
+
let { target: a, init: o } = i;
|
|
3221
|
+
n.set("__proxy_upstream_host__", a.hostname), n.set("__proxy_upstream_origin__", `${a.protocol}//${a.host}`);
|
|
3222
|
+
try {
|
|
3223
|
+
return await U(t, (e) => fetch(a.toString(), {
|
|
3224
|
+
...o,
|
|
3178
3225
|
signal: e
|
|
3179
3226
|
}));
|
|
3180
3227
|
} catch (e) {
|
|
3181
|
-
return
|
|
3228
|
+
return H(e) ? n.text("Upstream timeout", 504, { "x-authhero-proxy-error": "http_timeout" }) : n.text("Bad gateway", 502, { "x-authhero-proxy-error": "http_failed" });
|
|
3182
3229
|
}
|
|
3183
3230
|
};
|
|
3184
3231
|
}
|
|
3185
|
-
}),
|
|
3232
|
+
}), Jr = 3e4, Yr = e.object({
|
|
3186
3233
|
binding: e.string(),
|
|
3187
3234
|
upstream_url: e.string().optional(),
|
|
3188
3235
|
preserve_host: e.boolean().default(!0),
|
|
3189
3236
|
timeout_ms: e.number().int().positive().optional()
|
|
3190
3237
|
});
|
|
3191
|
-
function
|
|
3238
|
+
function Xr(e) {
|
|
3192
3239
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
3193
3240
|
}
|
|
3194
|
-
var
|
|
3241
|
+
var Zr = K({
|
|
3195
3242
|
type: "service_binding",
|
|
3196
|
-
optionsSchema:
|
|
3243
|
+
optionsSchema: Yr,
|
|
3197
3244
|
build(e, t) {
|
|
3198
3245
|
let n = t.bindings[e.binding];
|
|
3199
|
-
if (!
|
|
3200
|
-
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ??
|
|
3246
|
+
if (!Xr(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
3247
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ?? Jr;
|
|
3201
3248
|
return async (t) => {
|
|
3202
|
-
let a =
|
|
3203
|
-
upstream_url: r,
|
|
3204
|
-
preserve_host: e.preserve_host
|
|
3205
|
-
}, a);
|
|
3206
|
-
t.set("__proxy_upstream_host__", o.hostname), t.set("__proxy_upstream_origin__", `${o.protocol}//${o.host}`);
|
|
3249
|
+
let a = q(t), o;
|
|
3207
3250
|
try {
|
|
3208
|
-
|
|
3209
|
-
|
|
3251
|
+
o = await Kr({
|
|
3252
|
+
upstream_url: r,
|
|
3253
|
+
preserve_host: e.preserve_host
|
|
3254
|
+
}, a, i);
|
|
3255
|
+
} catch (e) {
|
|
3256
|
+
return Wr(e);
|
|
3257
|
+
}
|
|
3258
|
+
let { target: s, init: c } = o;
|
|
3259
|
+
t.set("__proxy_upstream_host__", s.hostname), t.set("__proxy_upstream_origin__", `${s.protocol}//${s.host}`);
|
|
3260
|
+
try {
|
|
3261
|
+
return await U(i, async (e) => n.fetch(new Request(s.toString(), {
|
|
3262
|
+
...c,
|
|
3210
3263
|
signal: e
|
|
3211
3264
|
})));
|
|
3212
3265
|
} catch (e) {
|
|
3213
|
-
return
|
|
3266
|
+
return H(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" });
|
|
3214
3267
|
}
|
|
3215
3268
|
};
|
|
3216
3269
|
}
|
|
3217
|
-
}),
|
|
3270
|
+
}), Qr = 3e4, $r = e.object({
|
|
3218
3271
|
binding: e.string(),
|
|
3219
3272
|
script_name: e.string(),
|
|
3220
3273
|
cpu_ms: e.number().int().positive().optional(),
|
|
3221
3274
|
subrequests: e.number().int().positive().optional(),
|
|
3222
3275
|
timeout_ms: e.number().int().positive().optional()
|
|
3223
3276
|
});
|
|
3224
|
-
function
|
|
3277
|
+
function ei(e) {
|
|
3225
3278
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
3226
3279
|
}
|
|
3227
|
-
var
|
|
3228
|
-
function
|
|
3229
|
-
return
|
|
3280
|
+
var Y = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
3281
|
+
function ti(e) {
|
|
3282
|
+
return Y.lastIndex = 0, Y.test(e);
|
|
3230
3283
|
}
|
|
3231
|
-
var
|
|
3284
|
+
var ni = K({
|
|
3232
3285
|
type: "dispatch_namespace",
|
|
3233
|
-
optionsSchema:
|
|
3286
|
+
optionsSchema: $r,
|
|
3234
3287
|
build(e, t) {
|
|
3235
3288
|
let n = t.bindings[e.binding];
|
|
3236
|
-
if (!
|
|
3237
|
-
let r =
|
|
3289
|
+
if (!ei(n)) throw Error(`Dispatch namespace binding "${e.binding}" is not configured or does not expose .get()`);
|
|
3290
|
+
let r = ti(e.script_name), i = e.timeout_ms ?? Qr, a = e.cpu_ms || e.subrequests ? { limits: {
|
|
3238
3291
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
3239
3292
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
3240
3293
|
} } : void 0;
|
|
3241
3294
|
return async (t) => {
|
|
3242
3295
|
let o = e.script_name;
|
|
3243
3296
|
if (r) {
|
|
3244
|
-
let n =
|
|
3245
|
-
if (o = o.replace(
|
|
3297
|
+
let n = lr(t), r = ur(t), i = dr(t), a = t.req.header("host") ?? t.req.header("x-forwarded-host") ?? "";
|
|
3298
|
+
if (o = o.replace(Y, (e, t) => {
|
|
3246
3299
|
switch (t) {
|
|
3247
3300
|
case "tenant_id": return n ?? "";
|
|
3248
3301
|
case "custom_domain_id": return r ?? "";
|
|
@@ -3252,19 +3305,19 @@ var Qr = G({
|
|
|
3252
3305
|
}
|
|
3253
3306
|
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
3254
3307
|
}
|
|
3255
|
-
let s =
|
|
3308
|
+
let s = q(t);
|
|
3256
3309
|
try {
|
|
3257
3310
|
let e = n.get(o, void 0, a);
|
|
3258
|
-
return await
|
|
3311
|
+
return await U(i, async (t) => {
|
|
3259
3312
|
let n = new Request(s, { signal: t });
|
|
3260
3313
|
return e.fetch(n);
|
|
3261
3314
|
});
|
|
3262
3315
|
} catch (e) {
|
|
3263
|
-
return
|
|
3316
|
+
return H(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" });
|
|
3264
3317
|
}
|
|
3265
3318
|
};
|
|
3266
3319
|
}
|
|
3267
|
-
}),
|
|
3320
|
+
}), ri = K({
|
|
3268
3321
|
type: "redirect",
|
|
3269
3322
|
optionsSchema: e.object({
|
|
3270
3323
|
upstream_url: e.string().refine((e) => {
|
|
@@ -3293,7 +3346,7 @@ var Qr = G({
|
|
|
3293
3346
|
});
|
|
3294
3347
|
};
|
|
3295
3348
|
}
|
|
3296
|
-
}),
|
|
3349
|
+
}), ii = K({
|
|
3297
3350
|
type: "static",
|
|
3298
3351
|
optionsSchema: e.object({
|
|
3299
3352
|
status: e.number().int().default(200),
|
|
@@ -3313,15 +3366,15 @@ var Qr = G({
|
|
|
3313
3366
|
});
|
|
3314
3367
|
//#endregion
|
|
3315
3368
|
//#region src/data-plane/handlers/index.ts
|
|
3316
|
-
function
|
|
3317
|
-
e.add(
|
|
3369
|
+
function ai(e) {
|
|
3370
|
+
e.add(hr).add(vr).add(yr).add(br).add(Ar).add(Pr).add(Fr).add(qr).add(Zr).add(ni).add(ri).add(ii);
|
|
3318
3371
|
}
|
|
3319
3372
|
//#endregion
|
|
3320
3373
|
//#region src/data-plane/matcher.ts
|
|
3321
|
-
function
|
|
3374
|
+
function oi(e) {
|
|
3322
3375
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
3323
3376
|
}
|
|
3324
|
-
function
|
|
3377
|
+
function si(e, t) {
|
|
3325
3378
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
3326
3379
|
if (n === r) return !0;
|
|
3327
3380
|
if (n.startsWith("*.")) {
|
|
@@ -3330,13 +3383,13 @@ function ri(e, t) {
|
|
|
3330
3383
|
}
|
|
3331
3384
|
return !1;
|
|
3332
3385
|
}
|
|
3333
|
-
function
|
|
3334
|
-
return !e || e.length === 0 ? !0 : e.some((e) =>
|
|
3386
|
+
function ci(e, t) {
|
|
3387
|
+
return !e || e.length === 0 ? !0 : e.some((e) => si(e, t));
|
|
3335
3388
|
}
|
|
3336
|
-
function
|
|
3389
|
+
function li(e) {
|
|
3337
3390
|
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;
|
|
3338
3391
|
return async (e, i) => {
|
|
3339
|
-
if (r && !
|
|
3392
|
+
if (r && !ci(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
3340
3393
|
for (let [n, r] of t) {
|
|
3341
3394
|
let t = e.req.header(n);
|
|
3342
3395
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -3353,17 +3406,17 @@ function ai(e) {
|
|
|
3353
3406
|
}
|
|
3354
3407
|
//#endregion
|
|
3355
3408
|
//#region src/data-plane/compile.ts
|
|
3356
|
-
var
|
|
3357
|
-
function
|
|
3409
|
+
var ui = "forwarded_headers";
|
|
3410
|
+
function di(e) {
|
|
3358
3411
|
return e.some((e) => e.type === "forwarded_headers") ? [...e] : [{
|
|
3359
|
-
type:
|
|
3412
|
+
type: ui,
|
|
3360
3413
|
options: {}
|
|
3361
3414
|
}, ...e];
|
|
3362
3415
|
}
|
|
3363
|
-
function
|
|
3364
|
-
return e.has("forwarded_headers") ?
|
|
3416
|
+
function X(e, t) {
|
|
3417
|
+
return e.has("forwarded_headers") ? di(t) : [...t];
|
|
3365
3418
|
}
|
|
3366
|
-
var
|
|
3419
|
+
var fi = [
|
|
3367
3420
|
"GET",
|
|
3368
3421
|
"POST",
|
|
3369
3422
|
"PUT",
|
|
@@ -3372,63 +3425,63 @@ var ci = [
|
|
|
3372
3425
|
"OPTIONS",
|
|
3373
3426
|
"HEAD"
|
|
3374
3427
|
];
|
|
3375
|
-
function
|
|
3428
|
+
function Z(e, n, r, i) {
|
|
3376
3429
|
let a = new t();
|
|
3377
3430
|
r && a.use("*", async (e, t) => {
|
|
3378
|
-
|
|
3431
|
+
cr(e, r), await t();
|
|
3379
3432
|
});
|
|
3380
|
-
let o =
|
|
3433
|
+
let o = oi(e);
|
|
3381
3434
|
for (let e of o) {
|
|
3382
3435
|
let t = [];
|
|
3383
|
-
t.push(
|
|
3384
|
-
for (let r of
|
|
3385
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3436
|
+
t.push(li(e.match));
|
|
3437
|
+
for (let r of X(n, e.handlers)) t.push(n.build(r.type, r.options));
|
|
3438
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : fi, i = e.match.path || "/*";
|
|
3386
3439
|
a.on(r, [i], ...t);
|
|
3387
3440
|
}
|
|
3388
|
-
return i && i.length > 0 ? a.on(
|
|
3389
|
-
let n =
|
|
3441
|
+
return i && i.length > 0 ? a.on(fi, ["*"], ...i) : a.all("*", (e) => e.text("No matching route", 404)), a.onError((e, t) => {
|
|
3442
|
+
let n = H(e);
|
|
3390
3443
|
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3391
3444
|
}), a;
|
|
3392
3445
|
}
|
|
3393
3446
|
//#endregion
|
|
3394
3447
|
//#region src/data-plane/router.ts
|
|
3395
|
-
var
|
|
3396
|
-
function
|
|
3397
|
-
return e.resolver ? e.resolver : e.cache ?
|
|
3448
|
+
var pi = 1e4;
|
|
3449
|
+
function mi(e) {
|
|
3450
|
+
return e.resolver ? e.resolver : e.cache ? G(e.data, e.cache) : G(e.data, e.cacheTtlMs ?? 3e4);
|
|
3398
3451
|
}
|
|
3399
|
-
function
|
|
3452
|
+
function hi(e) {
|
|
3400
3453
|
if (e.registry) return e.registry;
|
|
3401
|
-
let t = new
|
|
3402
|
-
return
|
|
3454
|
+
let t = new tr(e.bindings ?? {});
|
|
3455
|
+
return ai(t), t;
|
|
3403
3456
|
}
|
|
3404
|
-
function
|
|
3405
|
-
let t =
|
|
3457
|
+
function Q(e) {
|
|
3458
|
+
let t = mi(e), n = hi(e), r = /* @__PURE__ */ new WeakMap(), i = e.resolveHostTimeoutMs ?? pi, a = e.defaultHandlers && e.defaultHandlers.length > 0 ? X(n, e.defaultHandlers).map((e) => n.build(e.type, e.options)) : void 0, o = a ? Z([], n, void 0, a) : void 0;
|
|
3406
3459
|
return async (e) => {
|
|
3407
3460
|
let s = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3408
3461
|
if (!s) return e.text("Missing host", 400);
|
|
3409
3462
|
try {
|
|
3410
|
-
let c = await
|
|
3463
|
+
let c = await W(t.resolveHost(s), i, "resolveHost");
|
|
3411
3464
|
if (!c) return o ? await o.fetch(e.req.raw) : e.text("Unknown host", 404);
|
|
3412
3465
|
let l = r.get(c);
|
|
3413
|
-
return l || (l =
|
|
3466
|
+
return l || (l = Z(c.routes, n, {
|
|
3414
3467
|
tenant_id: c.tenant_id,
|
|
3415
3468
|
custom_domain_id: c.custom_domain_id,
|
|
3416
3469
|
domain: c.domain
|
|
3417
3470
|
}, a), r.set(c, l)), await l.fetch(e.req.raw);
|
|
3418
3471
|
} catch (t) {
|
|
3419
|
-
return o ? await o.fetch(e.req.raw) :
|
|
3472
|
+
return o ? await o.fetch(e.req.raw) : H(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" });
|
|
3420
3473
|
}
|
|
3421
3474
|
};
|
|
3422
3475
|
}
|
|
3423
|
-
function
|
|
3476
|
+
function gi(e) {
|
|
3424
3477
|
let n = new t();
|
|
3425
|
-
return n.all("*",
|
|
3478
|
+
return n.all("*", Q(e)), n;
|
|
3426
3479
|
}
|
|
3427
3480
|
//#endregion
|
|
3428
3481
|
//#region src/app.ts
|
|
3429
|
-
function
|
|
3482
|
+
function _i(e) {
|
|
3430
3483
|
let n = new t();
|
|
3431
|
-
return n.all("*",
|
|
3484
|
+
return n.all("*", Q({
|
|
3432
3485
|
data: e.data,
|
|
3433
3486
|
cacheTtlMs: e.cacheTtlMs,
|
|
3434
3487
|
cache: e.cache,
|
|
@@ -3438,76 +3491,76 @@ function pi(e) {
|
|
|
3438
3491
|
resolveHostTimeoutMs: e.resolveHostTimeoutMs,
|
|
3439
3492
|
defaultHandlers: e.defaultHandlers
|
|
3440
3493
|
})), n.onError((e, t) => {
|
|
3441
|
-
let n =
|
|
3494
|
+
let n = H(e);
|
|
3442
3495
|
return t.text(n ? "Proxy timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "proxy_timeout" : "proxy_error" });
|
|
3443
3496
|
}), n;
|
|
3444
3497
|
}
|
|
3445
3498
|
//#endregion
|
|
3446
3499
|
//#region src/data-plane/cache-api-cache.ts
|
|
3447
|
-
var
|
|
3448
|
-
function
|
|
3500
|
+
var vi = 1e3, yi = 1e3;
|
|
3501
|
+
function bi(e, t) {
|
|
3449
3502
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3450
3503
|
}
|
|
3451
|
-
function
|
|
3504
|
+
function xi() {
|
|
3452
3505
|
return globalThis.caches?.default;
|
|
3453
3506
|
}
|
|
3454
|
-
function
|
|
3455
|
-
let t = e.cache ??
|
|
3507
|
+
function Si(e) {
|
|
3508
|
+
let t = e.cache ?? xi();
|
|
3456
3509
|
if (!t) return e.upstream;
|
|
3457
|
-
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ??
|
|
3510
|
+
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ?? vi, c = e.cacheWriteTimeoutMs ?? yi;
|
|
3458
3511
|
async function l(e) {
|
|
3459
3512
|
try {
|
|
3460
|
-
return await
|
|
3513
|
+
return await W(Promise.resolve(n.match(e)), s, "cache.match");
|
|
3461
3514
|
} catch {
|
|
3462
3515
|
return;
|
|
3463
3516
|
}
|
|
3464
3517
|
}
|
|
3465
3518
|
return { async resolveHost(t) {
|
|
3466
|
-
let s =
|
|
3519
|
+
let s = bi(r, t), u = await l(s);
|
|
3467
3520
|
if (u) try {
|
|
3468
3521
|
return (await u.json()).value;
|
|
3469
3522
|
} catch {}
|
|
3470
3523
|
let d = await e.upstream.resolveHost(t), f = d === null ? a : i, p = new Response(JSON.stringify({ value: d }), { headers: {
|
|
3471
3524
|
"content-type": "application/json",
|
|
3472
3525
|
"cache-control": `public, max-age=${f}`
|
|
3473
|
-
} }), m =
|
|
3526
|
+
} }), m = W(Promise.resolve(n.put(s, p)), c, "cache.put").catch(() => void 0);
|
|
3474
3527
|
return o ? o(m) : await m, d;
|
|
3475
3528
|
} };
|
|
3476
3529
|
}
|
|
3477
|
-
function
|
|
3478
|
-
return
|
|
3530
|
+
function Ci(e, t) {
|
|
3531
|
+
return bi(e, t);
|
|
3479
3532
|
}
|
|
3480
3533
|
//#endregion
|
|
3481
3534
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3482
|
-
var
|
|
3483
|
-
function
|
|
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 =
|
|
3535
|
+
var wi = 1e3, Ti = 1e3, Ei = 5e3;
|
|
3536
|
+
function Di(e) {
|
|
3537
|
+
let { upstream: t, cache: n, freshTtlMs: r, staleTtlMs: i = 0, staleIfErrorTtlMs: a = 0, negativeTtlMs: o = r, keyPrefix: s = "authhero-proxy-host", waitUntil: c, cacheReadTimeoutMs: l = wi, cacheWriteTimeoutMs: u = Ti, upstreamTimeoutMs: d = Ei } = e, f = d > 0 ? d : 1e4, p = /* @__PURE__ */ new Map();
|
|
3485
3538
|
function m(e) {
|
|
3486
3539
|
return `${s}:${e.toLowerCase()}`;
|
|
3487
3540
|
}
|
|
3488
3541
|
async function h(e) {
|
|
3489
3542
|
try {
|
|
3490
|
-
return await
|
|
3543
|
+
return await W(n.get(e), l, "cache.get") ?? null;
|
|
3491
3544
|
} catch {
|
|
3492
3545
|
return null;
|
|
3493
3546
|
}
|
|
3494
3547
|
}
|
|
3495
3548
|
function g(e, t, r) {
|
|
3496
|
-
let i =
|
|
3549
|
+
let i = W(Promise.resolve().then(() => n.set(e, t, r)), u, "cache.set").catch(() => void 0);
|
|
3497
3550
|
return c ? (c(i), Promise.resolve()) : i;
|
|
3498
3551
|
}
|
|
3499
3552
|
function _(e, t) {
|
|
3500
3553
|
let n = p.get(e);
|
|
3501
3554
|
return n === void 0 ? !1 : t - n < f ? !0 : (p.delete(e), !1);
|
|
3502
3555
|
}
|
|
3503
|
-
function
|
|
3556
|
+
function v(e) {
|
|
3504
3557
|
let n = t.resolveHost(e);
|
|
3505
|
-
return d > 0 ?
|
|
3558
|
+
return d > 0 ? W(n, d, "resolveHost") : n;
|
|
3506
3559
|
}
|
|
3507
|
-
async function
|
|
3560
|
+
async function y(e) {
|
|
3508
3561
|
return p.set(e, Date.now()), (async () => {
|
|
3509
3562
|
try {
|
|
3510
|
-
let t = await
|
|
3563
|
+
let t = await v(e), n = Date.now(), s = t === null ? o : r, c = t === null ? 0 : i, l = t === null ? 0 : a, u = {
|
|
3511
3564
|
value: t,
|
|
3512
3565
|
freshUntilMs: n + s,
|
|
3513
3566
|
staleUntilMs: n + s + c,
|
|
@@ -3525,29 +3578,29 @@ function Ci(e) {
|
|
|
3525
3578
|
if (t.freshUntilMs > n) return t.value;
|
|
3526
3579
|
if (t.staleUntilMs > n) {
|
|
3527
3580
|
if (!_(e, n)) {
|
|
3528
|
-
let t =
|
|
3581
|
+
let t = y(e).catch(() => void 0);
|
|
3529
3582
|
c && c(t);
|
|
3530
3583
|
}
|
|
3531
3584
|
return t.value;
|
|
3532
3585
|
}
|
|
3533
3586
|
}
|
|
3534
3587
|
try {
|
|
3535
|
-
return await
|
|
3588
|
+
return await y(e);
|
|
3536
3589
|
} catch (e) {
|
|
3537
3590
|
if (t && (t.staleIfErrorUntilMs ?? t.staleUntilMs) > n) return t.value;
|
|
3538
3591
|
throw e;
|
|
3539
3592
|
}
|
|
3540
3593
|
} };
|
|
3541
3594
|
}
|
|
3542
|
-
function
|
|
3595
|
+
function Oi(e, t) {
|
|
3543
3596
|
return `${e}:${t.toLowerCase()}`;
|
|
3544
3597
|
}
|
|
3545
3598
|
//#endregion
|
|
3546
3599
|
//#region src/static/index.ts
|
|
3547
|
-
function
|
|
3600
|
+
function $() {
|
|
3548
3601
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3549
3602
|
}
|
|
3550
|
-
function
|
|
3603
|
+
function ki(e, t, n, r, i, a) {
|
|
3551
3604
|
return {
|
|
3552
3605
|
id: e.id ?? `${n}:${t}`,
|
|
3553
3606
|
tenant_id: r,
|
|
@@ -3562,10 +3615,10 @@ function Ti(e, t, n, r, i, a) {
|
|
|
3562
3615
|
updated_at: e.updated_at ?? a
|
|
3563
3616
|
};
|
|
3564
3617
|
}
|
|
3565
|
-
function
|
|
3618
|
+
function Ai(e) {
|
|
3566
3619
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3567
3620
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
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) =>
|
|
3621
|
+
let e = i.toLowerCase(), o = Array.isArray(a) ? { routes: a } : a, s = o.tenant_id ?? n, c = o.custom_domain_id ?? e, l = o.routes.map((n, r) => ki(n, r, e, s, c, t)).sort((e, t) => e.priority - t.priority);
|
|
3569
3622
|
r.set(e, {
|
|
3570
3623
|
tenant_id: s,
|
|
3571
3624
|
custom_domain_id: c,
|
|
@@ -3576,13 +3629,13 @@ function Ei(e) {
|
|
|
3576
3629
|
return {
|
|
3577
3630
|
proxyRoutes: {
|
|
3578
3631
|
async create() {
|
|
3579
|
-
return
|
|
3632
|
+
return $();
|
|
3580
3633
|
},
|
|
3581
3634
|
async update() {
|
|
3582
|
-
return
|
|
3635
|
+
return $();
|
|
3583
3636
|
},
|
|
3584
3637
|
async remove() {
|
|
3585
|
-
return
|
|
3638
|
+
return $();
|
|
3586
3639
|
},
|
|
3587
3640
|
async get(e, t) {
|
|
3588
3641
|
for (let n of r.values()) {
|
|
@@ -3609,7 +3662,7 @@ function Ei(e) {
|
|
|
3609
3662
|
}
|
|
3610
3663
|
};
|
|
3611
3664
|
}
|
|
3612
|
-
function
|
|
3665
|
+
function ji(e, t = {}) {
|
|
3613
3666
|
return {
|
|
3614
3667
|
priority: t.priority,
|
|
3615
3668
|
match: { path: t.path ?? "/*" },
|
|
@@ -3624,10 +3677,10 @@ function Di(e, t = {}) {
|
|
|
3624
3677
|
}
|
|
3625
3678
|
//#endregion
|
|
3626
3679
|
//#region src/constants.ts
|
|
3627
|
-
var
|
|
3680
|
+
var Mi = "proxy:resolve_host";
|
|
3628
3681
|
//#endregion
|
|
3629
3682
|
//#region src/http-adapter/index.ts
|
|
3630
|
-
function
|
|
3683
|
+
function Ni() {
|
|
3631
3684
|
let e = () => {
|
|
3632
3685
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3633
3686
|
};
|
|
@@ -3649,12 +3702,12 @@ function ki() {
|
|
|
3649
3702
|
}
|
|
3650
3703
|
};
|
|
3651
3704
|
}
|
|
3652
|
-
function
|
|
3705
|
+
function Pi(e) {
|
|
3653
3706
|
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;
|
|
3654
3707
|
function c(e) {
|
|
3655
3708
|
let t = new AbortController(), n, r = new Promise((e, r) => {
|
|
3656
3709
|
n = setTimeout(() => {
|
|
3657
|
-
t.abort(), r(new
|
|
3710
|
+
t.abort(), r(new V(s, "control plane"));
|
|
3658
3711
|
}, s);
|
|
3659
3712
|
});
|
|
3660
3713
|
return Promise.race([e(t.signal), r]).finally(() => clearTimeout(n));
|
|
@@ -3686,7 +3739,7 @@ function Ai(e) {
|
|
|
3686
3739
|
return l && l.expires_at > Date.now() ? l.value : u();
|
|
3687
3740
|
}
|
|
3688
3741
|
return {
|
|
3689
|
-
proxyRoutes:
|
|
3742
|
+
proxyRoutes: Ni(),
|
|
3690
3743
|
async resolveHost(e) {
|
|
3691
3744
|
let i = await d(), a = `${n}${r}${encodeURIComponent(e.toLowerCase())}`;
|
|
3692
3745
|
return c(async (e) => {
|
|
@@ -3703,7 +3756,7 @@ function Ai(e) {
|
|
|
3703
3756
|
}
|
|
3704
3757
|
//#endregion
|
|
3705
3758
|
//#region src/http-adapter/service-binding-fetch.ts
|
|
3706
|
-
function
|
|
3759
|
+
function Fi(e) {
|
|
3707
3760
|
return (t, n) => {
|
|
3708
3761
|
let r = t instanceof Request && n === void 0 ? t : new Request(t, n);
|
|
3709
3762
|
return e.fetch(r);
|
|
@@ -3711,11 +3764,11 @@ function ji(e) {
|
|
|
3711
3764
|
}
|
|
3712
3765
|
//#endregion
|
|
3713
3766
|
//#region src/kv-adapter/index.ts
|
|
3714
|
-
var
|
|
3715
|
-
function
|
|
3767
|
+
var Ii = "authhero-proxy-host:";
|
|
3768
|
+
function Li(e, t) {
|
|
3716
3769
|
return `${e}${t.toLowerCase()}`;
|
|
3717
3770
|
}
|
|
3718
|
-
function
|
|
3771
|
+
function Ri() {
|
|
3719
3772
|
let e = () => {
|
|
3720
3773
|
throw Error("KV proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3721
3774
|
};
|
|
@@ -3737,15 +3790,15 @@ function Ni() {
|
|
|
3737
3790
|
}
|
|
3738
3791
|
};
|
|
3739
3792
|
}
|
|
3740
|
-
function
|
|
3741
|
-
let { kv: t, keyPrefix: n =
|
|
3793
|
+
function zi(e) {
|
|
3794
|
+
let { kv: t, keyPrefix: n = Ii, timeoutMs: r } = e;
|
|
3742
3795
|
return {
|
|
3743
|
-
proxyRoutes:
|
|
3796
|
+
proxyRoutes: Ri(),
|
|
3744
3797
|
async resolveHost(e) {
|
|
3745
|
-
let i =
|
|
3746
|
-
return (r && r > 0 ? await
|
|
3798
|
+
let i = Li(n, e), a = t.get(i, "json");
|
|
3799
|
+
return (r && r > 0 ? await W(a, r, "kv.get") : await a) ?? null;
|
|
3747
3800
|
}
|
|
3748
3801
|
};
|
|
3749
3802
|
}
|
|
3750
3803
|
//#endregion
|
|
3751
|
-
export {
|
|
3804
|
+
export { Ii as DEFAULT_KV_HOST_KEY_PREFIX, ui as FORWARDED_HEADERS_HANDLER_TYPE, tr as HandlerRegistry, Mi as PROXY_RESOLVE_HOST_SCOPE, vr as basicAuthHandler, Oi as buildCacheAdapterKey, Ci as buildCacheApiKey, Li as buildKvHostKey, li as buildMatchFilter, br as cacheHandler, Z as compileHostApp, hr as corsHandler, Di as createCacheAdapterHostCache, Si as createCacheApiHostCache, Pi as createHttpProxyAdapter, G as createInMemoryHostCache, zi as createKvProxyAdapter, _i as createProxyApp, Q as createProxyDataPlaneHandler, gi as createProxyDataPlaneRouter, Fi as createServiceBindingFetch, Ai as createStaticProxyAdapter, K as defineHandler, ni as dispatchNamespaceHandler, Ar as forwardedHeadersHandler, Cn as handlerConfigSchema, yr as headersHandler, qr as httpHandler, ji as httpRoute, kr as isCloudflareIp, Sn as matchSchema, ci as matchesAnyHost, si as matchesHost, B as proxyRouteInsertSchema, wn as proxyRouteSchema, Tn as proxyRouteUpdateSchema, ri as redirectHandler, ai as registerBuiltinHandlers, Pr as rewriteCookiesHandler, Fr as rewriteLocationHandler, Zr as serviceBindingHandler, oi as sortRoutes, ii as staticHandler, di as withForwardedHeaders, X as withForwardedHeadersFor };
|