@authhero/proxy 0.10.13 → 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.d.ts +2 -0
- package/dist/proxy.mjs +726 -662
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/data-plane/cache-adapter-cache.d.ts +1 -0
- package/dist/types/data-plane/cache.d.ts +1 -0
- package/dist/types/data-plane/handlers/http.d.ts +7 -2
- package/package.json +1 -1
package/dist/proxy.mjs
CHANGED
|
@@ -98,7 +98,7 @@ var h = e.enum([
|
|
|
98
98
|
"admin_action",
|
|
99
99
|
"system",
|
|
100
100
|
"api"
|
|
101
|
-
]),
|
|
101
|
+
]), g = e.object({
|
|
102
102
|
type: e.enum([
|
|
103
103
|
"user",
|
|
104
104
|
"admin",
|
|
@@ -112,7 +112,7 @@ var h = e.enum([
|
|
|
112
112
|
org_name: e.string().optional(),
|
|
113
113
|
scopes: e.array(e.string()).optional(),
|
|
114
114
|
client_id: e.string().optional()
|
|
115
|
-
}),
|
|
115
|
+
}), _ = e.object({
|
|
116
116
|
type: e.string(),
|
|
117
117
|
id: e.string(),
|
|
118
118
|
before: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -121,7 +121,7 @@ var h = e.enum([
|
|
|
121
121
|
old: e.unknown(),
|
|
122
122
|
new: e.unknown()
|
|
123
123
|
})).optional()
|
|
124
|
-
}),
|
|
124
|
+
}), 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()
|
|
@@ -151,10 +151,10 @@ e.object({
|
|
|
151
151
|
log_type: e.string(),
|
|
152
152
|
description: e.string().optional(),
|
|
153
153
|
category: h,
|
|
154
|
-
actor:
|
|
155
|
-
target:
|
|
156
|
-
request:
|
|
157
|
-
response:
|
|
154
|
+
actor: g,
|
|
155
|
+
target: _,
|
|
156
|
+
request: 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 oe = 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 oe = 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 oe = e.object({
|
|
|
220
220
|
allow_failure: e.boolean().optional(),
|
|
221
221
|
mask_output: e.boolean().optional(),
|
|
222
222
|
params: e.object({
|
|
223
|
-
target:
|
|
223
|
+
target: 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
|
-
}),
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
}), se = e.union([
|
|
227
|
+
re,
|
|
228
|
+
ie,
|
|
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 fe = e.object({
|
|
|
256
256
|
phone_number: e.string().optional(),
|
|
257
257
|
phone_verified: e.boolean().optional(),
|
|
258
258
|
family_name: e.string().optional()
|
|
259
|
-
}).catchall(e.any()),
|
|
259
|
+
}).catchall(e.any()), le = e.object({
|
|
260
260
|
connection: e.string(),
|
|
261
261
|
user_id: e.string(),
|
|
262
262
|
provider: e.string(),
|
|
@@ -269,15 +269,15 @@ var fe = e.object({
|
|
|
269
269
|
access_token: e.string().optional(),
|
|
270
270
|
access_token_secret: e.string().optional(),
|
|
271
271
|
refresh_token: e.string().optional(),
|
|
272
|
-
profileData:
|
|
273
|
-
}),
|
|
272
|
+
profileData: 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 fe = e.object({
|
|
|
300
300
|
gender: e.string().optional(),
|
|
301
301
|
birthdate: e.string().optional(),
|
|
302
302
|
zoneinfo: e.string().optional(),
|
|
303
|
-
address:
|
|
303
|
+
address: 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 @@ he.extend({
|
|
|
323
323
|
is_social: e.boolean(),
|
|
324
324
|
email: e.string().optional(),
|
|
325
325
|
login_count: e.number().default(0),
|
|
326
|
-
identities: e.array(
|
|
327
|
-
}).omit({ registration_completed_at: !0 }),
|
|
326
|
+
identities: e.array(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 ge = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", _e
|
|
|
457
457
|
e.object({
|
|
458
458
|
created_at: e.string(),
|
|
459
459
|
updated_at: e.string()
|
|
460
|
-
}).extend(
|
|
461
|
-
var
|
|
460
|
+
}).extend(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 ye = e.object({
|
|
|
471
471
|
is_system: e.boolean().optional().openapi({ description: "If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly." }),
|
|
472
472
|
subject_type: e.enum(["client", "user"]).optional().openapi({ description: "The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement." }),
|
|
473
473
|
authorization_details_types: e.array(e.string()).optional().openapi({ description: "Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement." })
|
|
474
|
-
}),
|
|
474
|
+
}), 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 g = 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 g = 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(),
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
]),
|
|
547
|
+
}).passthrough(), Ee = e.union([
|
|
548
|
+
xe,
|
|
549
|
+
Se,
|
|
550
|
+
Ce,
|
|
551
|
+
we,
|
|
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 g = e.object({
|
|
|
583
583
|
custom_url: e.string().optional().openapi({ description: "Custom URL when target is 'custom'" }),
|
|
584
584
|
next_node: e.string().openapi({ description: "The next node to navigate to after action (for non-redirect actions)" })
|
|
585
585
|
}).passthrough()
|
|
586
|
-
}),
|
|
586
|
+
}), Ae = e.object({
|
|
587
587
|
id: e.string(),
|
|
588
588
|
type: e.string(),
|
|
589
|
-
coordinates:
|
|
590
|
-
}).passthrough(),
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
]),
|
|
589
|
+
coordinates: b
|
|
590
|
+
}).passthrough(), je = e.union([
|
|
591
|
+
De,
|
|
592
|
+
Oe,
|
|
593
|
+
ke,
|
|
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
|
-
})]).nullable(),
|
|
631
|
-
userinfo: e.record(e.string(),
|
|
632
|
-
id_token: e.record(e.string(),
|
|
633
|
-
}),
|
|
630
|
+
})]).nullable(), Le = e.object({
|
|
631
|
+
userinfo: e.record(e.string(), Ie).optional(),
|
|
632
|
+
id_token: e.record(e.string(), Ie).optional()
|
|
633
|
+
}), Re = e.object({
|
|
634
634
|
client_id: e.string(),
|
|
635
635
|
act_as: e.string().optional(),
|
|
636
|
-
response_type: e.nativeEnum(
|
|
637
|
-
response_mode: e.nativeEnum(
|
|
636
|
+
response_type: e.nativeEnum(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,13 +642,13 @@ var Re = /* @__PURE__ */ function(e) {
|
|
|
642
642
|
nonce: e.string().optional(),
|
|
643
643
|
scope: e.string().optional(),
|
|
644
644
|
prompt: e.string().optional(),
|
|
645
|
-
code_challenge_method: e.nativeEnum(
|
|
645
|
+
code_challenge_method: e.nativeEnum(Fe).optional(),
|
|
646
646
|
code_challenge: e.string().optional(),
|
|
647
647
|
username: e.string().optional(),
|
|
648
648
|
ui_locales: e.string().optional(),
|
|
649
649
|
max_age: e.number().optional(),
|
|
650
650
|
acr_values: e.string().optional(),
|
|
651
|
-
claims:
|
|
651
|
+
claims: Le.optional(),
|
|
652
652
|
vendor_id: e.string().optional()
|
|
653
653
|
});
|
|
654
654
|
e.object({
|
|
@@ -671,7 +671,7 @@ e.object({
|
|
|
671
671
|
"auto"
|
|
672
672
|
]).optional()
|
|
673
673
|
});
|
|
674
|
-
var
|
|
674
|
+
var ze = e.enum([
|
|
675
675
|
"password_reset",
|
|
676
676
|
"email_verification",
|
|
677
677
|
"otp",
|
|
@@ -685,7 +685,7 @@ e.object({
|
|
|
685
685
|
code_id: e.string().openapi({ description: "The code that will be used in for instance an email verification flow" }),
|
|
686
686
|
login_id: e.string().optional().openapi({ description: "The id of the login session that the code is connected to" }),
|
|
687
687
|
connection_id: e.string().optional().openapi({ description: "The connection that the code is connected to" }),
|
|
688
|
-
code_type:
|
|
688
|
+
code_type: ze,
|
|
689
689
|
code_verifier: e.string().optional().openapi({ description: "The code verifier used in PKCE in outbound flows" }),
|
|
690
690
|
code_challenge: e.string().optional().openapi({ description: "The code challenge used in PKCE in outbound flows" }),
|
|
691
691
|
code_challenge_method: e.enum(["plain", "S256"]).optional().openapi({ description: "The code challenge method used in PKCE in outbound flows" }),
|
|
@@ -697,7 +697,7 @@ e.object({
|
|
|
697
697
|
used_at: e.string().optional(),
|
|
698
698
|
user_id: e.string().optional()
|
|
699
699
|
}).extend({ created_at: e.string() });
|
|
700
|
-
var
|
|
700
|
+
var Be = e.object({
|
|
701
701
|
kid: e.string().optional(),
|
|
702
702
|
team_id: e.string().optional(),
|
|
703
703
|
realms: e.string().optional(),
|
|
@@ -817,26 +817,26 @@ var Ge = e.object({
|
|
|
817
817
|
"never_on_login"
|
|
818
818
|
]).optional()
|
|
819
819
|
});
|
|
820
|
-
function
|
|
820
|
+
function C(e) {
|
|
821
821
|
if (e !== null) {
|
|
822
|
-
if (Array.isArray(e)) return e.filter((e) => e !== null).map(
|
|
822
|
+
if (Array.isArray(e)) return e.filter((e) => e !== null).map(C);
|
|
823
823
|
if (e && typeof e == "object") {
|
|
824
824
|
let t = {};
|
|
825
|
-
for (let [n, r] of Object.entries(e)) r !== null && (t[n] =
|
|
825
|
+
for (let [n, r] of Object.entries(e)) r !== null && (t[n] = C(r));
|
|
826
826
|
return t;
|
|
827
827
|
}
|
|
828
828
|
return e;
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
|
-
var
|
|
831
|
+
var Ve = e.object({
|
|
832
832
|
id: e.string().optional(),
|
|
833
833
|
name: e.string(),
|
|
834
834
|
display_name: e.string().optional(),
|
|
835
835
|
strategy: e.string(),
|
|
836
|
-
options: e.preprocess((e) => e === null ? {} :
|
|
836
|
+
options: e.preprocess((e) => e === null ? {} : C(e), Be).default({}),
|
|
837
837
|
enabled_clients: e.array(e.string()).default([]).optional(),
|
|
838
|
-
response_type: e.nativeEnum(
|
|
839
|
-
response_mode: e.nativeEnum(
|
|
838
|
+
response_type: e.nativeEnum(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(),
|
|
@@ -846,8 +846,8 @@ e.object({
|
|
|
846
846
|
id: e.string(),
|
|
847
847
|
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
848
848
|
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
849
|
-
}).extend(
|
|
850
|
-
var
|
|
849
|
+
}).extend(Ve.shape);
|
|
850
|
+
var 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 qe = 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 qe = 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 qe = e.object({
|
|
|
879
879
|
"ready"
|
|
880
880
|
]),
|
|
881
881
|
origin_domain_name: e.string().optional(),
|
|
882
|
-
verification: e.object({ methods: e.array(
|
|
882
|
+
verification: e.object({ methods: e.array(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 y = 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 y = 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 y = 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 y = e.object({
|
|
|
985
985
|
multiple: e.boolean().optional(),
|
|
986
986
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
987
987
|
}).optional()
|
|
988
|
-
}),
|
|
988
|
+
}), 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 y = 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 y = 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 y = 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 y = e.object({
|
|
|
1030
1030
|
multiple: e.boolean().optional(),
|
|
1031
1031
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
1032
1032
|
}).optional()
|
|
1033
|
-
}),
|
|
1033
|
+
}), 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 y = 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 y = 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 y = 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 y = 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 y = 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,54 +1107,54 @@ var y = 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,
|
|
1124
|
+
Ge,
|
|
1125
|
+
Ke,
|
|
1126
|
+
qe,
|
|
1127
|
+
Je,
|
|
1128
|
+
Ye,
|
|
1123
1129
|
Xe,
|
|
1124
|
-
Ze
|
|
1130
|
+
Ze
|
|
1131
|
+
]), bt = e.discriminatedUnion("type", [
|
|
1125
1132
|
Qe,
|
|
1126
1133
|
$e,
|
|
1127
|
-
et
|
|
1134
|
+
et
|
|
1135
|
+
]), xt = e.discriminatedUnion("type", [
|
|
1128
1136
|
tt,
|
|
1129
1137
|
nt,
|
|
1130
|
-
rt
|
|
1131
|
-
]), Et = e.discriminatedUnion("type", [
|
|
1138
|
+
rt,
|
|
1132
1139
|
it,
|
|
1140
|
+
_t,
|
|
1133
1141
|
at,
|
|
1134
|
-
ot
|
|
1135
|
-
]), Dt = e.discriminatedUnion("type", [
|
|
1142
|
+
ot,
|
|
1136
1143
|
st,
|
|
1137
1144
|
ct,
|
|
1138
1145
|
lt,
|
|
1139
1146
|
ut,
|
|
1140
|
-
Ct,
|
|
1141
1147
|
dt,
|
|
1142
1148
|
ft,
|
|
1143
1149
|
pt,
|
|
1144
1150
|
mt,
|
|
1145
1151
|
ht,
|
|
1146
1152
|
gt,
|
|
1147
|
-
|
|
1148
|
-
|
|
1153
|
+
vt
|
|
1154
|
+
]), St = e.union([
|
|
1149
1155
|
yt,
|
|
1150
1156
|
bt,
|
|
1151
|
-
xt
|
|
1152
|
-
St,
|
|
1153
|
-
wt
|
|
1154
|
-
]), Ot = e.union([
|
|
1155
|
-
Tt,
|
|
1156
|
-
Et,
|
|
1157
|
-
Dt
|
|
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 C = 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
|
-
}),
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
]),
|
|
1219
|
+
}), Et = e.discriminatedUnion("type", [
|
|
1220
|
+
Ct,
|
|
1221
|
+
wt,
|
|
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 C = e.object({
|
|
|
1231
1231
|
default: e.string().optional()
|
|
1232
1232
|
}).optional(),
|
|
1233
1233
|
translations: e.record(e.string(), e.any()).optional(),
|
|
1234
|
-
nodes: e.array(
|
|
1234
|
+
nodes: e.array(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 C = e.object({
|
|
|
1246
1246
|
target: e.string().optional()
|
|
1247
1247
|
}).optional(),
|
|
1248
1248
|
after_submit: e.object({ flow_id: e.string().optional() }).optional(),
|
|
1249
|
-
coordinates:
|
|
1249
|
+
coordinates: 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 C = e.object({
|
|
|
1255
1255
|
sdk_src: e.string().optional()
|
|
1256
1256
|
}).optional()
|
|
1257
1257
|
}).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
|
|
1258
|
-
n.extend(
|
|
1259
|
-
var
|
|
1258
|
+
n.extend(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 Pt = 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 w = 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:
|
|
1315
|
+
}, Mt = e.object({
|
|
1316
|
+
...F,
|
|
1317
|
+
trigger_id: A,
|
|
1318
1318
|
url: e.string()
|
|
1319
|
-
}),
|
|
1320
|
-
...
|
|
1321
|
-
trigger_id:
|
|
1319
|
+
}), Nt = e.object({
|
|
1320
|
+
...F,
|
|
1321
|
+
trigger_id: j,
|
|
1322
1322
|
form_id: e.string()
|
|
1323
|
-
}),
|
|
1324
|
-
...
|
|
1325
|
-
trigger_id:
|
|
1326
|
-
template_id:
|
|
1327
|
-
}),
|
|
1328
|
-
...
|
|
1329
|
-
trigger_id:
|
|
1323
|
+
}), Pt = e.object({
|
|
1324
|
+
...F,
|
|
1325
|
+
trigger_id: M,
|
|
1326
|
+
template_id: jt
|
|
1327
|
+
}), Ft = e.object({
|
|
1328
|
+
...F,
|
|
1329
|
+
trigger_id: N,
|
|
1330
1330
|
code_id: e.string()
|
|
1331
|
-
}),
|
|
1332
|
-
...
|
|
1333
|
-
trigger_id:
|
|
1334
|
-
page_id:
|
|
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
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1338
|
+
Mt,
|
|
1339
|
+
Nt,
|
|
1340
|
+
Pt,
|
|
1341
|
+
Ft,
|
|
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
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1377
|
+
Lt,
|
|
1378
|
+
Rt,
|
|
1379
|
+
zt,
|
|
1380
|
+
Bt,
|
|
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 Yt = e.object({
|
|
|
1449
1449
|
message: `EC JWK is missing required member '${r}'`
|
|
1450
1450
|
});
|
|
1451
1451
|
});
|
|
1452
|
-
e.object({ keys: e.array(
|
|
1452
|
+
e.object({ keys: e.array(Gt) }), e.object({
|
|
1453
1453
|
issuer: e.string(),
|
|
1454
1454
|
authorization_endpoint: e.string(),
|
|
1455
1455
|
token_endpoint: e.string(),
|
|
@@ -1476,35 +1476,35 @@ e.object({ keys: e.array(Yt) }), e.object({
|
|
|
1476
1476
|
backchannel_logout_supported: e.boolean().optional(),
|
|
1477
1477
|
backchannel_logout_session_supported: e.boolean().optional()
|
|
1478
1478
|
});
|
|
1479
|
-
var
|
|
1479
|
+
var 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
|
});
|
|
1485
1485
|
e.object({
|
|
1486
1486
|
csrf_token: e.string(),
|
|
1487
1487
|
auth0Client: e.string().optional(),
|
|
1488
|
-
authParams:
|
|
1488
|
+
authParams: Re,
|
|
1489
1489
|
expires_at: e.string(),
|
|
1490
1490
|
deleted_at: e.string().optional(),
|
|
1491
1491
|
ip: e.string().optional(),
|
|
1492
1492
|
useragent: e.string().optional(),
|
|
1493
1493
|
session_id: e.string().optional(),
|
|
1494
1494
|
authorization_url: e.string().optional(),
|
|
1495
|
-
state:
|
|
1495
|
+
state: 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 M = {
|
|
|
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 en = 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 ln = e.object({
|
|
|
1766
1766
|
"pre-user-registration": e.object({ shields: e.array(e.string()).optional() }).optional(),
|
|
1767
1767
|
"pre-change-password": e.object({ shields: e.array(e.string()).optional() }).optional()
|
|
1768
1768
|
}).optional()
|
|
1769
|
-
}),
|
|
1769
|
+
}), 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 ln = e.object({
|
|
|
1786
1786
|
rate: e.number().optional()
|
|
1787
1787
|
}).optional()
|
|
1788
1788
|
}).optional()
|
|
1789
|
-
}),
|
|
1790
|
-
breached_password_detection:
|
|
1791
|
-
brute_force_protection:
|
|
1792
|
-
suspicious_ip_throttling:
|
|
1789
|
+
}), 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 pn = e.object({
|
|
|
1817
1817
|
expires_at: e.string().optional(),
|
|
1818
1818
|
login_session_id: e.string(),
|
|
1819
1819
|
idle_expires_at: e.string().optional(),
|
|
1820
|
-
device:
|
|
1820
|
+
device: 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 hn = e.object({
|
|
|
1960
1960
|
"shared_planetscale"
|
|
1961
1961
|
]).optional(),
|
|
1962
1962
|
d1_database_id: e.string().max(64).optional(),
|
|
1963
|
-
attack_protection:
|
|
1963
|
+
attack_protection: 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 hn = e.object({
|
|
|
1991
1991
|
e.object({
|
|
1992
1992
|
created_at: e.string().nullable().transform((e) => e ?? ""),
|
|
1993
1993
|
updated_at: e.string().nullable().transform((e) => e ?? "")
|
|
1994
|
-
}).extend(
|
|
1994
|
+
}).extend(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 yn = e.enum([
|
|
|
2053
2053
|
e.object({
|
|
2054
2054
|
operation_id: e.string().max(255),
|
|
2055
2055
|
step: e.string().max(255),
|
|
2056
|
-
outcome:
|
|
2056
|
+
outcome: 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 bn = 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 Sn = e.object({
|
|
|
2150
2150
|
show_widget_shadow: e.boolean(),
|
|
2151
2151
|
widget_border_weight: e.number(),
|
|
2152
2152
|
widget_corner_radius: e.number()
|
|
2153
|
-
}),
|
|
2153
|
+
}), 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 Sn = 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 Sn = 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 Sn = 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 Nn = e.object({
|
|
|
2275
2275
|
e.object({
|
|
2276
2276
|
created_at: e.string(),
|
|
2277
2277
|
last_used_at: e.string().optional()
|
|
2278
|
-
}).extend(
|
|
2279
|
-
var
|
|
2278
|
+
}).extend(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 Fn = 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 In = e.object({
|
|
|
2356
2356
|
persist_client_authorization: e.boolean().optional(),
|
|
2357
2357
|
enable_introspection_endpoint: e.boolean().optional(),
|
|
2358
2358
|
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2359
|
-
}),
|
|
2359
|
+
}), 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 In = e.object({
|
|
|
2368
2368
|
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2369
2369
|
allow_offline_access: e.boolean().optional(),
|
|
2370
2370
|
verificationKey: e.string().optional(),
|
|
2371
|
-
options:
|
|
2371
|
+
options: 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(zn), e.object({
|
|
|
2394
2394
|
failed_logins: e.array(e.string()).optional(),
|
|
2395
2395
|
last_password_reset: e.string().optional()
|
|
2396
2396
|
});
|
|
2397
|
-
var
|
|
2397
|
+
var 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 Bn = e.object({
|
|
|
2403
2403
|
tenant_id: e.string(),
|
|
2404
2404
|
created_at: e.string().optional()
|
|
2405
2405
|
});
|
|
2406
|
-
e.array(
|
|
2407
|
-
var
|
|
2406
|
+
e.array(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 Vn = e.object({
|
|
|
2413
2413
|
created_at: e.string().optional(),
|
|
2414
2414
|
organization_id: e.string().optional()
|
|
2415
2415
|
});
|
|
2416
|
-
e.array(
|
|
2417
|
-
var
|
|
2416
|
+
e.array(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 Hn = e.object({
|
|
|
2422
2422
|
tenant_id: e.string(),
|
|
2423
2423
|
created_at: e.string().optional()
|
|
2424
2424
|
});
|
|
2425
|
-
e.array(
|
|
2426
|
-
var
|
|
2425
|
+
e.array(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 Un = e.object({
|
|
|
2434
2434
|
created_at: e.string().optional(),
|
|
2435
2435
|
updated_at: e.string().optional()
|
|
2436
2436
|
});
|
|
2437
|
-
e.array(
|
|
2438
|
-
var
|
|
2437
|
+
e.array(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 qn = e.object({
|
|
|
2476
2476
|
created_at: e.string().optional(),
|
|
2477
2477
|
updated_at: e.string().optional()
|
|
2478
2478
|
});
|
|
2479
|
-
e.array(
|
|
2479
|
+
e.array(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(qn), 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 Qn = 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 er = 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 er = 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,69 +2708,91 @@ function I(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
|
|
2721
|
-
|
|
2720
|
+
var Qn = "x-authhero-preserve-location", V = class extends Error {
|
|
2721
|
+
ms;
|
|
2722
|
+
constructor(e, t) {
|
|
2723
|
+
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
function H(e) {
|
|
2727
|
+
return e instanceof V ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2728
|
+
}
|
|
2729
|
+
function U(e, t) {
|
|
2730
|
+
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
2731
|
+
return t(n.signal).finally(() => clearTimeout(r));
|
|
2732
|
+
}
|
|
2733
|
+
function W(e, t, n) {
|
|
2734
|
+
let r, i = new Promise((e, i) => {
|
|
2735
|
+
r = setTimeout(() => i(new V(t, n)), t);
|
|
2736
|
+
});
|
|
2737
|
+
return Promise.race([e, i]).finally(() => {
|
|
2738
|
+
r && clearTimeout(r);
|
|
2739
|
+
});
|
|
2740
|
+
}
|
|
2741
|
+
//#endregion
|
|
2742
|
+
//#region src/data-plane/cache.ts
|
|
2743
|
+
var $n = 1e4, er = 8e3;
|
|
2744
|
+
function G(e, t, n) {
|
|
2722
2745
|
let r = typeof t == "number" ? {
|
|
2723
2746
|
freshTtlMs: t,
|
|
2724
2747
|
maxEntries: n
|
|
2725
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ??
|
|
2726
|
-
function
|
|
2727
|
-
for (let [t, n] of
|
|
2728
|
-
for (;
|
|
2729
|
-
let e =
|
|
2748
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ?? $n, l = r.waitUntil, u = r.upstreamTimeoutMs ?? er, d = u > 0 ? u : 1e4, f = /* @__PURE__ */ new Map();
|
|
2749
|
+
function p(e) {
|
|
2750
|
+
for (let [t, n] of f) n.stale_if_error_until <= e && n.stale_until <= e && f.delete(t);
|
|
2751
|
+
for (; f.size >= c;) {
|
|
2752
|
+
let e = f.keys().next().value;
|
|
2730
2753
|
if (e === void 0) break;
|
|
2731
|
-
|
|
2754
|
+
f.delete(e);
|
|
2732
2755
|
}
|
|
2733
2756
|
}
|
|
2734
|
-
function
|
|
2757
|
+
function m(e, t, n) {
|
|
2735
2758
|
let r = n + (t === null ? s : i), c = t === null ? r : r + a, l = {
|
|
2736
2759
|
value: t,
|
|
2737
2760
|
fresh_until: r,
|
|
2738
2761
|
stale_until: c,
|
|
2739
2762
|
stale_if_error_until: t === null ? c : c + o
|
|
2740
2763
|
};
|
|
2741
|
-
return
|
|
2764
|
+
return f.delete(e), p(n), f.set(e, l), l;
|
|
2742
2765
|
}
|
|
2743
|
-
function
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
}
|
|
2760
|
-
return r.refreshing = i, n || (d(Date.now()), u.set(t, r)), i;
|
|
2766
|
+
function h(e, t) {
|
|
2767
|
+
return e.refresh_started_at === void 0 ? !1 : t - e.refresh_started_at < d ? !0 : (e.refresh_started_at = void 0, !1);
|
|
2768
|
+
}
|
|
2769
|
+
function g(t) {
|
|
2770
|
+
let n = e.resolveHost(t);
|
|
2771
|
+
return u > 0 ? W(n, u, "resolveHost") : n;
|
|
2772
|
+
}
|
|
2773
|
+
async function _(e) {
|
|
2774
|
+
let t = f.get(e);
|
|
2775
|
+
t && (t.refresh_started_at = Date.now());
|
|
2776
|
+
try {
|
|
2777
|
+
let t = await g(e);
|
|
2778
|
+
return m(e, t, Date.now()), t;
|
|
2779
|
+
} catch (t) {
|
|
2780
|
+
let n = f.get(e);
|
|
2781
|
+
throw n && (n.refresh_started_at = void 0, n.stale_if_error_until <= Date.now() && f.delete(e)), t;
|
|
2782
|
+
}
|
|
2761
2783
|
}
|
|
2762
2784
|
return { async resolveHost(e) {
|
|
2763
|
-
let t = Date.now(), n =
|
|
2764
|
-
if (n && n.fresh_until > t) return
|
|
2785
|
+
let t = Date.now(), n = f.get(e);
|
|
2786
|
+
if (n && n.fresh_until > t) return f.delete(e), f.set(e, n), n.value;
|
|
2765
2787
|
if (n && n.stale_until > t) {
|
|
2766
|
-
if (
|
|
2767
|
-
let t =
|
|
2788
|
+
if (f.delete(e), f.set(e, n), !h(n, t)) {
|
|
2789
|
+
let t = _(e).catch(() => void 0);
|
|
2768
2790
|
l && l(t);
|
|
2769
2791
|
}
|
|
2770
2792
|
return n.value;
|
|
2771
2793
|
}
|
|
2772
2794
|
try {
|
|
2773
|
-
return await
|
|
2795
|
+
return await _(e);
|
|
2774
2796
|
} catch (e) {
|
|
2775
2797
|
if (n && n.stale_if_error_until > t) return n.value;
|
|
2776
2798
|
throw e;
|
|
@@ -2779,7 +2801,7 @@ function L(e, t, n) {
|
|
|
2779
2801
|
}
|
|
2780
2802
|
//#endregion
|
|
2781
2803
|
//#region src/data-plane/registry.ts
|
|
2782
|
-
var
|
|
2804
|
+
var tr = class {
|
|
2783
2805
|
definitions = /* @__PURE__ */ new Map();
|
|
2784
2806
|
bindings;
|
|
2785
2807
|
constructor(e = {}) {
|
|
@@ -2799,38 +2821,38 @@ var R = class {
|
|
|
2799
2821
|
return n.build(r.data, { bindings: this.bindings });
|
|
2800
2822
|
}
|
|
2801
2823
|
};
|
|
2802
|
-
function
|
|
2824
|
+
function K(e) {
|
|
2803
2825
|
return e;
|
|
2804
2826
|
}
|
|
2805
2827
|
//#endregion
|
|
2806
2828
|
//#region src/data-plane/handlers/util.ts
|
|
2807
|
-
var
|
|
2808
|
-
function or(e, t) {
|
|
2809
|
-
e.set(B, t);
|
|
2810
|
-
}
|
|
2811
|
-
function U(e) {
|
|
2812
|
-
return e.get(B) ?? e.req.raw;
|
|
2813
|
-
}
|
|
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";
|
|
2814
2830
|
function sr(e, t) {
|
|
2815
|
-
e.set(
|
|
2831
|
+
e.set(nr, t);
|
|
2816
2832
|
}
|
|
2817
|
-
function
|
|
2818
|
-
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);
|
|
2819
2838
|
}
|
|
2820
2839
|
function lr(e) {
|
|
2821
|
-
return e.get(
|
|
2840
|
+
return e.get(rr);
|
|
2822
2841
|
}
|
|
2823
2842
|
function ur(e) {
|
|
2824
2843
|
return e.get(ir);
|
|
2825
2844
|
}
|
|
2826
|
-
function dr(e
|
|
2827
|
-
|
|
2828
|
-
|
|
2845
|
+
function dr(e) {
|
|
2846
|
+
return e.get(ar);
|
|
2847
|
+
}
|
|
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 }));
|
|
2829
2851
|
}
|
|
2830
|
-
function
|
|
2852
|
+
function J(e) {
|
|
2831
2853
|
let t = e.res;
|
|
2832
2854
|
try {
|
|
2833
|
-
t.headers.append(
|
|
2855
|
+
t.headers.append(or, "1"), t.headers.delete(or);
|
|
2834
2856
|
return;
|
|
2835
2857
|
} catch {
|
|
2836
2858
|
e.res = new Response(t.body, {
|
|
@@ -2842,7 +2864,7 @@ function W(e) {
|
|
|
2842
2864
|
}
|
|
2843
2865
|
//#endregion
|
|
2844
2866
|
//#region src/data-plane/handlers/cors.ts
|
|
2845
|
-
var
|
|
2867
|
+
var pr = e.object({
|
|
2846
2868
|
origins: e.array(e.string()).optional(),
|
|
2847
2869
|
allow_credentials: e.boolean().optional(),
|
|
2848
2870
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2850,44 +2872,44 @@ var fr = e.object({
|
|
|
2850
2872
|
expose_headers: e.array(e.string()).optional(),
|
|
2851
2873
|
max_age: e.number().int().optional()
|
|
2852
2874
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2853
|
-
function
|
|
2875
|
+
function mr(e, t) {
|
|
2854
2876
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2855
2877
|
return i && !e.allow_credentials ? n.set("Access-Control-Allow-Origin", "*") : t && (i || r.includes(t)) && (n.set("Access-Control-Allow-Origin", t), n.append("Vary", "Origin")), e.allow_credentials && n.set("Access-Control-Allow-Credentials", "true"), e.allow_methods?.length && n.set("Access-Control-Allow-Methods", e.allow_methods.join(", ")), e.allow_headers?.length && n.set("Access-Control-Allow-Headers", e.allow_headers.join(", ")), e.expose_headers?.length && n.set("Access-Control-Expose-Headers", e.expose_headers.join(", ")), e.max_age !== void 0 && n.set("Access-Control-Max-Age", String(e.max_age)), n;
|
|
2856
2878
|
}
|
|
2857
|
-
var
|
|
2879
|
+
var hr = K({
|
|
2858
2880
|
type: "cors",
|
|
2859
|
-
optionsSchema:
|
|
2881
|
+
optionsSchema: pr,
|
|
2860
2882
|
build(e) {
|
|
2861
2883
|
return async (t, n) => {
|
|
2862
2884
|
let r = t.req.header("origin") ?? null;
|
|
2863
2885
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2864
|
-
let t =
|
|
2886
|
+
let t = mr(e, r);
|
|
2865
2887
|
return new Response(null, {
|
|
2866
2888
|
status: 204,
|
|
2867
2889
|
headers: t
|
|
2868
2890
|
});
|
|
2869
2891
|
}
|
|
2870
2892
|
await n();
|
|
2871
|
-
let i =
|
|
2872
|
-
|
|
2893
|
+
let i = mr(e, r);
|
|
2894
|
+
J(t), i.forEach((e, n) => {
|
|
2873
2895
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2874
2896
|
});
|
|
2875
2897
|
};
|
|
2876
2898
|
}
|
|
2877
|
-
}),
|
|
2899
|
+
}), gr = e.object({
|
|
2878
2900
|
username: e.string(),
|
|
2879
2901
|
password: e.string(),
|
|
2880
2902
|
realm: e.string().optional()
|
|
2881
2903
|
});
|
|
2882
|
-
function
|
|
2904
|
+
function _r(e, t) {
|
|
2883
2905
|
let n = `${e}:${t}`;
|
|
2884
2906
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2885
2907
|
}
|
|
2886
|
-
var
|
|
2908
|
+
var vr = K({
|
|
2887
2909
|
type: "basic_auth",
|
|
2888
|
-
optionsSchema:
|
|
2910
|
+
optionsSchema: gr,
|
|
2889
2911
|
build(e) {
|
|
2890
|
-
let t =
|
|
2912
|
+
let t = _r(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2891
2913
|
return async (e, r) => {
|
|
2892
2914
|
let i = e.req.header("authorization");
|
|
2893
2915
|
if (i) {
|
|
@@ -2903,7 +2925,7 @@ var _r = z({
|
|
|
2903
2925
|
});
|
|
2904
2926
|
};
|
|
2905
2927
|
}
|
|
2906
|
-
}),
|
|
2928
|
+
}), yr = K({
|
|
2907
2929
|
type: "headers",
|
|
2908
2930
|
optionsSchema: e.object({
|
|
2909
2931
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2913,23 +2935,23 @@ var _r = z({
|
|
|
2913
2935
|
}),
|
|
2914
2936
|
build(e) {
|
|
2915
2937
|
return async (t, n) => {
|
|
2916
|
-
if ((e.request || e.remove_request) &&
|
|
2938
|
+
if ((e.request || e.remove_request) && fr(t, (t) => {
|
|
2917
2939
|
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2918
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
2940
|
+
}), await n(), (e.response || e.remove_response) && (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);
|
|
2919
2941
|
};
|
|
2920
2942
|
}
|
|
2921
|
-
}),
|
|
2943
|
+
}), br = K({
|
|
2922
2944
|
type: "cache",
|
|
2923
2945
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2924
2946
|
build(e) {
|
|
2925
2947
|
return async (t, n) => {
|
|
2926
2948
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2927
2949
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2928
|
-
|
|
2950
|
+
J(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2929
2951
|
}
|
|
2930
2952
|
};
|
|
2931
2953
|
}
|
|
2932
|
-
}),
|
|
2954
|
+
}), xr = [
|
|
2933
2955
|
"173.245.48.0/20",
|
|
2934
2956
|
"103.21.244.0/22",
|
|
2935
2957
|
"103.22.200.0/22",
|
|
@@ -2953,7 +2975,7 @@ var _r = z({
|
|
|
2953
2975
|
"2a06:98c0::/29",
|
|
2954
2976
|
"2c0f:f248::/32"
|
|
2955
2977
|
];
|
|
2956
|
-
function
|
|
2978
|
+
function Sr(e) {
|
|
2957
2979
|
let t = e.split(".");
|
|
2958
2980
|
if (t.length !== 4) return null;
|
|
2959
2981
|
let n = [];
|
|
@@ -2965,14 +2987,14 @@ function xr(e) {
|
|
|
2965
2987
|
}
|
|
2966
2988
|
return n;
|
|
2967
2989
|
}
|
|
2968
|
-
function
|
|
2990
|
+
function Cr(e) {
|
|
2969
2991
|
if (e === "") return [];
|
|
2970
2992
|
let t = e.split(":"), n = [];
|
|
2971
2993
|
for (let e = 0; e < t.length; e++) {
|
|
2972
2994
|
let r = t[e];
|
|
2973
2995
|
if (r.includes(".")) {
|
|
2974
2996
|
if (e !== t.length - 1) return null;
|
|
2975
|
-
let i =
|
|
2997
|
+
let i = Sr(r);
|
|
2976
2998
|
if (!i) return null;
|
|
2977
2999
|
n.push(i[0] << 8 | i[1], i[2] << 8 | i[3]);
|
|
2978
3000
|
continue;
|
|
@@ -2982,14 +3004,14 @@ function Sr(e) {
|
|
|
2982
3004
|
}
|
|
2983
3005
|
return n;
|
|
2984
3006
|
}
|
|
2985
|
-
function
|
|
3007
|
+
function wr(e) {
|
|
2986
3008
|
let t = e.split("::");
|
|
2987
3009
|
if (t.length > 2) return null;
|
|
2988
|
-
let n =
|
|
3010
|
+
let n = Cr(t[0] ?? "");
|
|
2989
3011
|
if (!n) return null;
|
|
2990
3012
|
let r;
|
|
2991
3013
|
if (t.length === 2) {
|
|
2992
|
-
let e =
|
|
3014
|
+
let e = Cr(t[1] ?? "");
|
|
2993
3015
|
if (!e) return null;
|
|
2994
3016
|
let i = 8 - n.length - e.length;
|
|
2995
3017
|
if (i < 1) return null;
|
|
@@ -3004,25 +3026,25 @@ function Cr(e) {
|
|
|
3004
3026
|
for (let e of r) i.push(e >> 8 & 255, e & 255);
|
|
3005
3027
|
return i;
|
|
3006
3028
|
}
|
|
3007
|
-
function
|
|
3029
|
+
function Tr(e) {
|
|
3008
3030
|
let t = e.trim();
|
|
3009
3031
|
t.startsWith("[") && t.endsWith("]") && (t = t.slice(1, -1));
|
|
3010
3032
|
let n = t.indexOf("%");
|
|
3011
3033
|
if (n !== -1 && (t = t.slice(0, n)), t === "") return null;
|
|
3012
|
-
if (!t.includes(":")) return
|
|
3013
|
-
let r =
|
|
3034
|
+
if (!t.includes(":")) return Sr(t);
|
|
3035
|
+
let r = wr(t);
|
|
3014
3036
|
return r ? r.slice(0, 10).every((e) => e === 0) && r[10] === 255 && r[11] === 255 ? r.slice(12) : r : null;
|
|
3015
3037
|
}
|
|
3016
|
-
function
|
|
3017
|
-
let [t, n] = e.split("/"), r =
|
|
3038
|
+
function Er(e) {
|
|
3039
|
+
let [t, n] = e.split("/"), r = Tr(t ?? ""), i = Number(n);
|
|
3018
3040
|
if (!r || !Number.isInteger(i)) throw Error(`Invalid Cloudflare CIDR: ${e}`);
|
|
3019
3041
|
return {
|
|
3020
3042
|
bytes: r,
|
|
3021
3043
|
prefixBits: i
|
|
3022
3044
|
};
|
|
3023
3045
|
}
|
|
3024
|
-
var
|
|
3025
|
-
function
|
|
3046
|
+
var Dr = xr.map(Er);
|
|
3047
|
+
function Or(e, t) {
|
|
3026
3048
|
if (e.length !== t.bytes.length) return !1;
|
|
3027
3049
|
let n = t.prefixBits >> 3;
|
|
3028
3050
|
for (let r = 0; r < n; r++) if (e[r] !== t.bytes[r]) return !1;
|
|
@@ -3031,11 +3053,11 @@ function Dr(e, t) {
|
|
|
3031
3053
|
let i = 255 << 8 - r & 255;
|
|
3032
3054
|
return (e[n] & i) === (t.bytes[n] & i);
|
|
3033
3055
|
}
|
|
3034
|
-
function
|
|
3035
|
-
let t =
|
|
3036
|
-
return t ?
|
|
3056
|
+
function kr(e) {
|
|
3057
|
+
let t = Tr(e);
|
|
3058
|
+
return t ? Dr.some((e) => Or(t, e)) : !1;
|
|
3037
3059
|
}
|
|
3038
|
-
var
|
|
3060
|
+
var Ar = K({
|
|
3039
3061
|
type: "forwarded_headers",
|
|
3040
3062
|
optionsSchema: e.object({
|
|
3041
3063
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -3046,46 +3068,46 @@ var kr = z({
|
|
|
3046
3068
|
build(e) {
|
|
3047
3069
|
return async (t, n) => {
|
|
3048
3070
|
let r = new URL(t.req.url);
|
|
3049
|
-
|
|
3071
|
+
fr(t, (n) => {
|
|
3050
3072
|
n.set("x-forwarded-host", r.host), n.set("x-forwarded-proto", r.protocol.replace(":", "")), e.set_x_original_url && n.set("x-original-url", t.req.url);
|
|
3051
|
-
let i = n.get(e.client_ip_header), a = i && e.skip_cloudflare_client_ip &&
|
|
3073
|
+
let i = n.get(e.client_ip_header), a = i && e.skip_cloudflare_client_ip && 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;
|
|
3052
3074
|
n.set("x-forwarded-for", l), e.set_x_real_ip && n.set("x-real-ip", s);
|
|
3053
3075
|
}), await n();
|
|
3054
3076
|
};
|
|
3055
3077
|
}
|
|
3056
|
-
}),
|
|
3057
|
-
function
|
|
3078
|
+
}), jr = e.object({ upstream_host: e.string().optional() });
|
|
3079
|
+
function Mr(e) {
|
|
3058
3080
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3059
3081
|
}
|
|
3060
|
-
function
|
|
3082
|
+
function Nr(e) {
|
|
3061
3083
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
3062
3084
|
let t = [];
|
|
3063
3085
|
return e.forEach((e, n) => {
|
|
3064
3086
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
3065
3087
|
}), t;
|
|
3066
3088
|
}
|
|
3067
|
-
var
|
|
3089
|
+
var Pr = K({
|
|
3068
3090
|
type: "rewrite_cookies",
|
|
3069
|
-
optionsSchema:
|
|
3091
|
+
optionsSchema: jr,
|
|
3070
3092
|
build(e) {
|
|
3071
3093
|
return async (t, n) => {
|
|
3072
3094
|
await n();
|
|
3073
3095
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
3074
3096
|
if (!i) return;
|
|
3075
|
-
let a =
|
|
3097
|
+
let a = Nr(t.res.headers);
|
|
3076
3098
|
if (a.length === 0) return;
|
|
3077
|
-
let o =
|
|
3078
|
-
|
|
3099
|
+
let o = Mr(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
3100
|
+
J(t), t.res.headers.delete("set-cookie");
|
|
3079
3101
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
3080
3102
|
};
|
|
3081
3103
|
}
|
|
3082
|
-
}),
|
|
3104
|
+
}), Fr = K({
|
|
3083
3105
|
type: "rewrite_location",
|
|
3084
3106
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
3085
3107
|
build(e) {
|
|
3086
3108
|
return async (t, n) => {
|
|
3087
3109
|
if (await n(), t.res.headers.has("x-authhero-preserve-location")) {
|
|
3088
|
-
|
|
3110
|
+
J(t), t.res.headers.delete(Qn);
|
|
3089
3111
|
return;
|
|
3090
3112
|
}
|
|
3091
3113
|
let r = t.res.status;
|
|
@@ -3102,33 +3124,10 @@ var Nr = z({
|
|
|
3102
3124
|
}
|
|
3103
3125
|
if (o.origin !== a) return;
|
|
3104
3126
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
3105
|
-
|
|
3127
|
+
J(t), t.res.headers.set("location", c);
|
|
3106
3128
|
};
|
|
3107
3129
|
}
|
|
3108
|
-
}),
|
|
3109
|
-
ms;
|
|
3110
|
-
constructor(e, t) {
|
|
3111
|
-
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
3112
|
-
}
|
|
3113
|
-
};
|
|
3114
|
-
function G(e) {
|
|
3115
|
-
return e instanceof Fr ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
3116
|
-
}
|
|
3117
|
-
function K(e, t) {
|
|
3118
|
-
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
3119
|
-
return t(n.signal).finally(() => clearTimeout(r));
|
|
3120
|
-
}
|
|
3121
|
-
function q(e, t, n) {
|
|
3122
|
-
let r, i = new Promise((e, i) => {
|
|
3123
|
-
r = setTimeout(() => i(new Fr(t, n)), t);
|
|
3124
|
-
});
|
|
3125
|
-
return Promise.race([e, i]).finally(() => {
|
|
3126
|
-
r && clearTimeout(r);
|
|
3127
|
-
});
|
|
3128
|
-
}
|
|
3129
|
-
//#endregion
|
|
3130
|
-
//#region src/data-plane/handlers/http.ts
|
|
3131
|
-
var Ir = new Set([
|
|
3130
|
+
}), Ir = new Set([
|
|
3132
3131
|
"connection",
|
|
3133
3132
|
"keep-alive",
|
|
3134
3133
|
"proxy-authenticate",
|
|
@@ -3148,102 +3147,155 @@ function zr(e, t) {
|
|
|
3148
3147
|
function Br(e) {
|
|
3149
3148
|
return e !== "GET" && e !== "HEAD";
|
|
3150
3149
|
}
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
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 = {
|
|
3158
3198
|
method: t.method,
|
|
3159
|
-
headers:
|
|
3160
|
-
body:
|
|
3199
|
+
headers: a,
|
|
3200
|
+
body: o,
|
|
3161
3201
|
redirect: "manual"
|
|
3162
3202
|
};
|
|
3163
|
-
return
|
|
3164
|
-
target:
|
|
3165
|
-
init:
|
|
3203
|
+
return o instanceof ReadableStream && (s.duplex = "half"), {
|
|
3204
|
+
target: i,
|
|
3205
|
+
init: s
|
|
3166
3206
|
};
|
|
3167
3207
|
}
|
|
3168
|
-
var
|
|
3208
|
+
var qr = K({
|
|
3169
3209
|
type: "http",
|
|
3170
3210
|
optionsSchema: Rr,
|
|
3171
3211
|
build(e) {
|
|
3172
3212
|
let t = e.timeout_ms ?? Lr;
|
|
3173
3213
|
return async (n) => {
|
|
3174
|
-
let
|
|
3175
|
-
|
|
3214
|
+
let r = q(n), i;
|
|
3215
|
+
try {
|
|
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}`);
|
|
3176
3222
|
try {
|
|
3177
|
-
return await
|
|
3178
|
-
...
|
|
3223
|
+
return await U(t, (e) => fetch(a.toString(), {
|
|
3224
|
+
...o,
|
|
3179
3225
|
signal: e
|
|
3180
3226
|
}));
|
|
3181
3227
|
} catch (e) {
|
|
3182
|
-
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" });
|
|
3183
3229
|
}
|
|
3184
3230
|
};
|
|
3185
3231
|
}
|
|
3186
|
-
}),
|
|
3232
|
+
}), Jr = 3e4, Yr = e.object({
|
|
3187
3233
|
binding: e.string(),
|
|
3188
3234
|
upstream_url: e.string().optional(),
|
|
3189
3235
|
preserve_host: e.boolean().default(!0),
|
|
3190
3236
|
timeout_ms: e.number().int().positive().optional()
|
|
3191
3237
|
});
|
|
3192
|
-
function
|
|
3238
|
+
function Xr(e) {
|
|
3193
3239
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
3194
3240
|
}
|
|
3195
|
-
var
|
|
3241
|
+
var Zr = K({
|
|
3196
3242
|
type: "service_binding",
|
|
3197
|
-
optionsSchema:
|
|
3243
|
+
optionsSchema: Yr,
|
|
3198
3244
|
build(e, t) {
|
|
3199
3245
|
let n = t.bindings[e.binding];
|
|
3200
|
-
if (!
|
|
3201
|
-
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;
|
|
3202
3248
|
return async (t) => {
|
|
3203
|
-
let a =
|
|
3204
|
-
upstream_url: r,
|
|
3205
|
-
preserve_host: e.preserve_host
|
|
3206
|
-
}, a);
|
|
3207
|
-
t.set("__proxy_upstream_host__", o.hostname), t.set("__proxy_upstream_origin__", `${o.protocol}//${o.host}`);
|
|
3249
|
+
let a = q(t), o;
|
|
3208
3250
|
try {
|
|
3209
|
-
|
|
3210
|
-
|
|
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,
|
|
3211
3263
|
signal: e
|
|
3212
3264
|
})));
|
|
3213
3265
|
} catch (e) {
|
|
3214
|
-
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" });
|
|
3215
3267
|
}
|
|
3216
3268
|
};
|
|
3217
3269
|
}
|
|
3218
|
-
}),
|
|
3270
|
+
}), Qr = 3e4, $r = e.object({
|
|
3219
3271
|
binding: e.string(),
|
|
3220
3272
|
script_name: e.string(),
|
|
3221
3273
|
cpu_ms: e.number().int().positive().optional(),
|
|
3222
3274
|
subrequests: e.number().int().positive().optional(),
|
|
3223
3275
|
timeout_ms: e.number().int().positive().optional()
|
|
3224
3276
|
});
|
|
3225
|
-
function
|
|
3277
|
+
function ei(e) {
|
|
3226
3278
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
3227
3279
|
}
|
|
3228
|
-
var
|
|
3229
|
-
function
|
|
3230
|
-
return
|
|
3280
|
+
var Y = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
3281
|
+
function ti(e) {
|
|
3282
|
+
return Y.lastIndex = 0, Y.test(e);
|
|
3231
3283
|
}
|
|
3232
|
-
var
|
|
3284
|
+
var ni = K({
|
|
3233
3285
|
type: "dispatch_namespace",
|
|
3234
|
-
optionsSchema:
|
|
3286
|
+
optionsSchema: $r,
|
|
3235
3287
|
build(e, t) {
|
|
3236
3288
|
let n = t.bindings[e.binding];
|
|
3237
|
-
if (!
|
|
3238
|
-
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: {
|
|
3239
3291
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
3240
3292
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
3241
3293
|
} } : void 0;
|
|
3242
3294
|
return async (t) => {
|
|
3243
3295
|
let o = e.script_name;
|
|
3244
3296
|
if (r) {
|
|
3245
|
-
let n =
|
|
3246
|
-
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) => {
|
|
3247
3299
|
switch (t) {
|
|
3248
3300
|
case "tenant_id": return n ?? "";
|
|
3249
3301
|
case "custom_domain_id": return r ?? "";
|
|
@@ -3253,19 +3305,19 @@ var Zr = z({
|
|
|
3253
3305
|
}
|
|
3254
3306
|
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
3255
3307
|
}
|
|
3256
|
-
let s =
|
|
3308
|
+
let s = q(t);
|
|
3257
3309
|
try {
|
|
3258
3310
|
let e = n.get(o, void 0, a);
|
|
3259
|
-
return await
|
|
3311
|
+
return await U(i, async (t) => {
|
|
3260
3312
|
let n = new Request(s, { signal: t });
|
|
3261
3313
|
return e.fetch(n);
|
|
3262
3314
|
});
|
|
3263
3315
|
} catch (e) {
|
|
3264
|
-
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" });
|
|
3265
3317
|
}
|
|
3266
3318
|
};
|
|
3267
3319
|
}
|
|
3268
|
-
}),
|
|
3320
|
+
}), ri = K({
|
|
3269
3321
|
type: "redirect",
|
|
3270
3322
|
optionsSchema: e.object({
|
|
3271
3323
|
upstream_url: e.string().refine((e) => {
|
|
@@ -3294,7 +3346,7 @@ var Zr = z({
|
|
|
3294
3346
|
});
|
|
3295
3347
|
};
|
|
3296
3348
|
}
|
|
3297
|
-
}),
|
|
3349
|
+
}), ii = K({
|
|
3298
3350
|
type: "static",
|
|
3299
3351
|
optionsSchema: e.object({
|
|
3300
3352
|
status: e.number().int().default(200),
|
|
@@ -3314,15 +3366,15 @@ var Zr = z({
|
|
|
3314
3366
|
});
|
|
3315
3367
|
//#endregion
|
|
3316
3368
|
//#region src/data-plane/handlers/index.ts
|
|
3317
|
-
function
|
|
3318
|
-
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);
|
|
3319
3371
|
}
|
|
3320
3372
|
//#endregion
|
|
3321
3373
|
//#region src/data-plane/matcher.ts
|
|
3322
|
-
function
|
|
3374
|
+
function oi(e) {
|
|
3323
3375
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
3324
3376
|
}
|
|
3325
|
-
function
|
|
3377
|
+
function si(e, t) {
|
|
3326
3378
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
3327
3379
|
if (n === r) return !0;
|
|
3328
3380
|
if (n.startsWith("*.")) {
|
|
@@ -3331,13 +3383,13 @@ function ni(e, t) {
|
|
|
3331
3383
|
}
|
|
3332
3384
|
return !1;
|
|
3333
3385
|
}
|
|
3334
|
-
function
|
|
3335
|
-
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));
|
|
3336
3388
|
}
|
|
3337
|
-
function
|
|
3389
|
+
function li(e) {
|
|
3338
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;
|
|
3339
3391
|
return async (e, i) => {
|
|
3340
|
-
if (r && !
|
|
3392
|
+
if (r && !ci(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
3341
3393
|
for (let [n, r] of t) {
|
|
3342
3394
|
let t = e.req.header(n);
|
|
3343
3395
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -3354,17 +3406,17 @@ function ii(e) {
|
|
|
3354
3406
|
}
|
|
3355
3407
|
//#endregion
|
|
3356
3408
|
//#region src/data-plane/compile.ts
|
|
3357
|
-
var
|
|
3358
|
-
function
|
|
3409
|
+
var ui = "forwarded_headers";
|
|
3410
|
+
function di(e) {
|
|
3359
3411
|
return e.some((e) => e.type === "forwarded_headers") ? [...e] : [{
|
|
3360
|
-
type:
|
|
3412
|
+
type: ui,
|
|
3361
3413
|
options: {}
|
|
3362
3414
|
}, ...e];
|
|
3363
3415
|
}
|
|
3364
3416
|
function X(e, t) {
|
|
3365
|
-
return e.has("forwarded_headers") ?
|
|
3417
|
+
return e.has("forwarded_headers") ? di(t) : [...t];
|
|
3366
3418
|
}
|
|
3367
|
-
var
|
|
3419
|
+
var fi = [
|
|
3368
3420
|
"GET",
|
|
3369
3421
|
"POST",
|
|
3370
3422
|
"PUT",
|
|
@@ -3376,39 +3428,39 @@ var oi = [
|
|
|
3376
3428
|
function Z(e, n, r, i) {
|
|
3377
3429
|
let a = new t();
|
|
3378
3430
|
r && a.use("*", async (e, t) => {
|
|
3379
|
-
|
|
3431
|
+
cr(e, r), await t();
|
|
3380
3432
|
});
|
|
3381
|
-
let o =
|
|
3433
|
+
let o = oi(e);
|
|
3382
3434
|
for (let e of o) {
|
|
3383
3435
|
let t = [];
|
|
3384
|
-
t.push(
|
|
3436
|
+
t.push(li(e.match));
|
|
3385
3437
|
for (let r of X(n, e.handlers)) t.push(n.build(r.type, r.options));
|
|
3386
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3438
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : fi, i = e.match.path || "/*";
|
|
3387
3439
|
a.on(r, [i], ...t);
|
|
3388
3440
|
}
|
|
3389
|
-
return i && i.length > 0 ? a.on(
|
|
3390
|
-
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);
|
|
3391
3443
|
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3392
3444
|
}), a;
|
|
3393
3445
|
}
|
|
3394
3446
|
//#endregion
|
|
3395
3447
|
//#region src/data-plane/router.ts
|
|
3396
|
-
var
|
|
3397
|
-
function
|
|
3398
|
-
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);
|
|
3399
3451
|
}
|
|
3400
|
-
function
|
|
3452
|
+
function hi(e) {
|
|
3401
3453
|
if (e.registry) return e.registry;
|
|
3402
|
-
let t = new
|
|
3403
|
-
return
|
|
3454
|
+
let t = new tr(e.bindings ?? {});
|
|
3455
|
+
return ai(t), t;
|
|
3404
3456
|
}
|
|
3405
3457
|
function Q(e) {
|
|
3406
|
-
let t =
|
|
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;
|
|
3407
3459
|
return async (e) => {
|
|
3408
3460
|
let s = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3409
3461
|
if (!s) return e.text("Missing host", 400);
|
|
3410
3462
|
try {
|
|
3411
|
-
let c = await
|
|
3463
|
+
let c = await W(t.resolveHost(s), i, "resolveHost");
|
|
3412
3464
|
if (!c) return o ? await o.fetch(e.req.raw) : e.text("Unknown host", 404);
|
|
3413
3465
|
let l = r.get(c);
|
|
3414
3466
|
return l || (l = Z(c.routes, n, {
|
|
@@ -3417,17 +3469,17 @@ function Q(e) {
|
|
|
3417
3469
|
domain: c.domain
|
|
3418
3470
|
}, a), r.set(c, l)), await l.fetch(e.req.raw);
|
|
3419
3471
|
} catch (t) {
|
|
3420
|
-
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" });
|
|
3421
3473
|
}
|
|
3422
3474
|
};
|
|
3423
3475
|
}
|
|
3424
|
-
function
|
|
3476
|
+
function gi(e) {
|
|
3425
3477
|
let n = new t();
|
|
3426
3478
|
return n.all("*", Q(e)), n;
|
|
3427
3479
|
}
|
|
3428
3480
|
//#endregion
|
|
3429
3481
|
//#region src/app.ts
|
|
3430
|
-
function
|
|
3482
|
+
function _i(e) {
|
|
3431
3483
|
let n = new t();
|
|
3432
3484
|
return n.all("*", Q({
|
|
3433
3485
|
data: e.data,
|
|
@@ -3439,103 +3491,108 @@ function di(e) {
|
|
|
3439
3491
|
resolveHostTimeoutMs: e.resolveHostTimeoutMs,
|
|
3440
3492
|
defaultHandlers: e.defaultHandlers
|
|
3441
3493
|
})), n.onError((e, t) => {
|
|
3442
|
-
let n =
|
|
3494
|
+
let n = H(e);
|
|
3443
3495
|
return t.text(n ? "Proxy timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "proxy_timeout" : "proxy_error" });
|
|
3444
3496
|
}), n;
|
|
3445
3497
|
}
|
|
3446
3498
|
//#endregion
|
|
3447
3499
|
//#region src/data-plane/cache-api-cache.ts
|
|
3448
|
-
var
|
|
3449
|
-
function
|
|
3500
|
+
var vi = 1e3, yi = 1e3;
|
|
3501
|
+
function bi(e, t) {
|
|
3450
3502
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3451
3503
|
}
|
|
3452
|
-
function
|
|
3504
|
+
function xi() {
|
|
3453
3505
|
return globalThis.caches?.default;
|
|
3454
3506
|
}
|
|
3455
|
-
function
|
|
3456
|
-
let t = e.cache ??
|
|
3507
|
+
function Si(e) {
|
|
3508
|
+
let t = e.cache ?? xi();
|
|
3457
3509
|
if (!t) return e.upstream;
|
|
3458
|
-
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ??
|
|
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;
|
|
3459
3511
|
async function l(e) {
|
|
3460
3512
|
try {
|
|
3461
|
-
return await
|
|
3513
|
+
return await W(Promise.resolve(n.match(e)), s, "cache.match");
|
|
3462
3514
|
} catch {
|
|
3463
3515
|
return;
|
|
3464
3516
|
}
|
|
3465
3517
|
}
|
|
3466
3518
|
return { async resolveHost(t) {
|
|
3467
|
-
let s =
|
|
3519
|
+
let s = bi(r, t), u = await l(s);
|
|
3468
3520
|
if (u) try {
|
|
3469
3521
|
return (await u.json()).value;
|
|
3470
3522
|
} catch {}
|
|
3471
3523
|
let d = await e.upstream.resolveHost(t), f = d === null ? a : i, p = new Response(JSON.stringify({ value: d }), { headers: {
|
|
3472
3524
|
"content-type": "application/json",
|
|
3473
3525
|
"cache-control": `public, max-age=${f}`
|
|
3474
|
-
} }), m =
|
|
3526
|
+
} }), m = W(Promise.resolve(n.put(s, p)), c, "cache.put").catch(() => void 0);
|
|
3475
3527
|
return o ? o(m) : await m, d;
|
|
3476
3528
|
} };
|
|
3477
3529
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return
|
|
3530
|
+
function Ci(e, t) {
|
|
3531
|
+
return bi(e, t);
|
|
3480
3532
|
}
|
|
3481
3533
|
//#endregion
|
|
3482
3534
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3483
|
-
var
|
|
3484
|
-
function
|
|
3485
|
-
let { upstream: t, cache: n, freshTtlMs: r, staleTtlMs: i = 0, staleIfErrorTtlMs: a = 0, negativeTtlMs: o = r, keyPrefix: s = "authhero-proxy-host", waitUntil: c, cacheReadTimeoutMs: l =
|
|
3486
|
-
function
|
|
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();
|
|
3538
|
+
function m(e) {
|
|
3487
3539
|
return `${s}:${e.toLowerCase()}`;
|
|
3488
3540
|
}
|
|
3489
|
-
async function
|
|
3541
|
+
async function h(e) {
|
|
3490
3542
|
try {
|
|
3491
|
-
return await
|
|
3543
|
+
return await W(n.get(e), l, "cache.get") ?? null;
|
|
3492
3544
|
} catch {
|
|
3493
3545
|
return null;
|
|
3494
3546
|
}
|
|
3495
3547
|
}
|
|
3496
|
-
function
|
|
3497
|
-
let i =
|
|
3548
|
+
function g(e, t, r) {
|
|
3549
|
+
let i = W(Promise.resolve().then(() => n.set(e, t, r)), u, "cache.set").catch(() => void 0);
|
|
3498
3550
|
return c ? (c(i), Promise.resolve()) : i;
|
|
3499
3551
|
}
|
|
3500
|
-
|
|
3501
|
-
let n =
|
|
3502
|
-
|
|
3503
|
-
|
|
3552
|
+
function _(e, t) {
|
|
3553
|
+
let n = p.get(e);
|
|
3554
|
+
return n === void 0 ? !1 : t - n < f ? !0 : (p.delete(e), !1);
|
|
3555
|
+
}
|
|
3556
|
+
function v(e) {
|
|
3557
|
+
let n = t.resolveHost(e);
|
|
3558
|
+
return d > 0 ? W(n, d, "resolveHost") : n;
|
|
3559
|
+
}
|
|
3560
|
+
async function y(e) {
|
|
3561
|
+
return p.set(e, Date.now()), (async () => {
|
|
3504
3562
|
try {
|
|
3505
|
-
let
|
|
3506
|
-
value:
|
|
3507
|
-
freshUntilMs:
|
|
3508
|
-
staleUntilMs:
|
|
3509
|
-
staleIfErrorUntilMs: s + c + l
|
|
3510
|
-
},
|
|
3511
|
-
return await m(
|
|
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 = {
|
|
3564
|
+
value: t,
|
|
3565
|
+
freshUntilMs: n + s,
|
|
3566
|
+
staleUntilMs: n + s + c,
|
|
3567
|
+
staleIfErrorUntilMs: n + s + c + l
|
|
3568
|
+
}, d = Math.max(1, Math.ceil((s + c + l) / 1e3));
|
|
3569
|
+
return await g(m(e), u, d), t;
|
|
3512
3570
|
} finally {
|
|
3513
|
-
|
|
3571
|
+
p.delete(e);
|
|
3514
3572
|
}
|
|
3515
3573
|
})();
|
|
3516
|
-
return d.set(e, s), s;
|
|
3517
3574
|
}
|
|
3518
3575
|
return { async resolveHost(e) {
|
|
3519
|
-
let t = await
|
|
3576
|
+
let t = await h(m(e)), n = Date.now();
|
|
3520
3577
|
if (t && typeof t.freshUntilMs == "number") {
|
|
3521
3578
|
if (t.freshUntilMs > n) return t.value;
|
|
3522
3579
|
if (t.staleUntilMs > n) {
|
|
3523
|
-
if (!
|
|
3524
|
-
let t =
|
|
3580
|
+
if (!_(e, n)) {
|
|
3581
|
+
let t = y(e).catch(() => void 0);
|
|
3525
3582
|
c && c(t);
|
|
3526
3583
|
}
|
|
3527
3584
|
return t.value;
|
|
3528
3585
|
}
|
|
3529
3586
|
}
|
|
3530
3587
|
try {
|
|
3531
|
-
return await
|
|
3588
|
+
return await y(e);
|
|
3532
3589
|
} catch (e) {
|
|
3533
3590
|
if (t && (t.staleIfErrorUntilMs ?? t.staleUntilMs) > n) return t.value;
|
|
3534
3591
|
throw e;
|
|
3535
3592
|
}
|
|
3536
3593
|
} };
|
|
3537
3594
|
}
|
|
3538
|
-
function
|
|
3595
|
+
function Oi(e, t) {
|
|
3539
3596
|
return `${e}:${t.toLowerCase()}`;
|
|
3540
3597
|
}
|
|
3541
3598
|
//#endregion
|
|
@@ -3543,7 +3600,7 @@ function xi(e, t) {
|
|
|
3543
3600
|
function $() {
|
|
3544
3601
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3545
3602
|
}
|
|
3546
|
-
function
|
|
3603
|
+
function ki(e, t, n, r, i, a) {
|
|
3547
3604
|
return {
|
|
3548
3605
|
id: e.id ?? `${n}:${t}`,
|
|
3549
3606
|
tenant_id: r,
|
|
@@ -3558,10 +3615,10 @@ function Si(e, t, n, r, i, a) {
|
|
|
3558
3615
|
updated_at: e.updated_at ?? a
|
|
3559
3616
|
};
|
|
3560
3617
|
}
|
|
3561
|
-
function
|
|
3618
|
+
function Ai(e) {
|
|
3562
3619
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3563
3620
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
3564
|
-
let e = i.toLowerCase(), o = Array.isArray(a) ? { routes: a } : a, s = o.tenant_id ?? n, c = o.custom_domain_id ?? e, l = o.routes.map((n, r) =>
|
|
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);
|
|
3565
3622
|
r.set(e, {
|
|
3566
3623
|
tenant_id: s,
|
|
3567
3624
|
custom_domain_id: c,
|
|
@@ -3605,7 +3662,7 @@ function Ci(e) {
|
|
|
3605
3662
|
}
|
|
3606
3663
|
};
|
|
3607
3664
|
}
|
|
3608
|
-
function
|
|
3665
|
+
function ji(e, t = {}) {
|
|
3609
3666
|
return {
|
|
3610
3667
|
priority: t.priority,
|
|
3611
3668
|
match: { path: t.path ?? "/*" },
|
|
@@ -3620,10 +3677,10 @@ function wi(e, t = {}) {
|
|
|
3620
3677
|
}
|
|
3621
3678
|
//#endregion
|
|
3622
3679
|
//#region src/constants.ts
|
|
3623
|
-
var
|
|
3680
|
+
var Mi = "proxy:resolve_host";
|
|
3624
3681
|
//#endregion
|
|
3625
3682
|
//#region src/http-adapter/index.ts
|
|
3626
|
-
function
|
|
3683
|
+
function Ni() {
|
|
3627
3684
|
let e = () => {
|
|
3628
3685
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3629
3686
|
};
|
|
@@ -3645,54 +3702,61 @@ function Ei() {
|
|
|
3645
3702
|
}
|
|
3646
3703
|
};
|
|
3647
3704
|
}
|
|
3648
|
-
function
|
|
3705
|
+
function Pi(e) {
|
|
3649
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;
|
|
3650
3707
|
function c(e) {
|
|
3651
|
-
let t = new AbortController(), n =
|
|
3652
|
-
|
|
3708
|
+
let t = new AbortController(), n, r = new Promise((e, r) => {
|
|
3709
|
+
n = setTimeout(() => {
|
|
3710
|
+
t.abort(), r(new V(s, "control plane"));
|
|
3711
|
+
}, s);
|
|
3712
|
+
});
|
|
3713
|
+
return Promise.race([e(t.signal), r]).finally(() => clearTimeout(n));
|
|
3653
3714
|
}
|
|
3654
|
-
let l = null
|
|
3655
|
-
async function
|
|
3656
|
-
let r = await c((r) =>
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3715
|
+
let l = null;
|
|
3716
|
+
async function u() {
|
|
3717
|
+
let r = await c(async (r) => {
|
|
3718
|
+
let o = await t(`${n}/oauth/token`, {
|
|
3719
|
+
method: "POST",
|
|
3720
|
+
headers: { "content-type": "application/json" },
|
|
3721
|
+
body: JSON.stringify({
|
|
3722
|
+
grant_type: "client_credentials",
|
|
3723
|
+
client_id: e.clientId,
|
|
3724
|
+
client_secret: e.clientSecret,
|
|
3725
|
+
audience: i,
|
|
3726
|
+
scope: a
|
|
3727
|
+
}),
|
|
3728
|
+
signal: r
|
|
3729
|
+
});
|
|
3730
|
+
if (!o.ok) throw Error(`Proxy adapter token request failed: ${o.status} ${await o.text().catch(() => "")}`);
|
|
3731
|
+
return await o.json();
|
|
3732
|
+
}), s = r.expires_in ?? 3600;
|
|
3670
3733
|
return l = {
|
|
3671
|
-
value:
|
|
3672
|
-
expires_at: Date.now() + (
|
|
3673
|
-
},
|
|
3734
|
+
value: r.access_token,
|
|
3735
|
+
expires_at: Date.now() + (s - o) * 1e3
|
|
3736
|
+
}, r.access_token;
|
|
3674
3737
|
}
|
|
3675
|
-
async function
|
|
3676
|
-
return l && l.expires_at > Date.now() ? l.value : u
|
|
3677
|
-
u = null;
|
|
3678
|
-
}), u);
|
|
3738
|
+
async function d() {
|
|
3739
|
+
return l && l.expires_at > Date.now() ? l.value : u();
|
|
3679
3740
|
}
|
|
3680
3741
|
return {
|
|
3681
|
-
proxyRoutes:
|
|
3742
|
+
proxyRoutes: Ni(),
|
|
3682
3743
|
async resolveHost(e) {
|
|
3683
|
-
let i = await
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3744
|
+
let i = await d(), a = `${n}${r}${encodeURIComponent(e.toLowerCase())}`;
|
|
3745
|
+
return c(async (e) => {
|
|
3746
|
+
let n = await t(a, {
|
|
3747
|
+
headers: { authorization: `Bearer ${i}` },
|
|
3748
|
+
signal: e
|
|
3749
|
+
});
|
|
3750
|
+
if (n.status === 404) return null;
|
|
3751
|
+
if (!n.ok) throw Error(`Proxy adapter resolveHost failed: ${n.status} ${await n.text().catch(() => "")}`);
|
|
3752
|
+
return await n.json();
|
|
3753
|
+
});
|
|
3690
3754
|
}
|
|
3691
3755
|
};
|
|
3692
3756
|
}
|
|
3693
3757
|
//#endregion
|
|
3694
3758
|
//#region src/http-adapter/service-binding-fetch.ts
|
|
3695
|
-
function
|
|
3759
|
+
function Fi(e) {
|
|
3696
3760
|
return (t, n) => {
|
|
3697
3761
|
let r = t instanceof Request && n === void 0 ? t : new Request(t, n);
|
|
3698
3762
|
return e.fetch(r);
|
|
@@ -3700,11 +3764,11 @@ function Oi(e) {
|
|
|
3700
3764
|
}
|
|
3701
3765
|
//#endregion
|
|
3702
3766
|
//#region src/kv-adapter/index.ts
|
|
3703
|
-
var
|
|
3704
|
-
function
|
|
3767
|
+
var Ii = "authhero-proxy-host:";
|
|
3768
|
+
function Li(e, t) {
|
|
3705
3769
|
return `${e}${t.toLowerCase()}`;
|
|
3706
3770
|
}
|
|
3707
|
-
function
|
|
3771
|
+
function Ri() {
|
|
3708
3772
|
let e = () => {
|
|
3709
3773
|
throw Error("KV proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3710
3774
|
};
|
|
@@ -3726,15 +3790,15 @@ function ji() {
|
|
|
3726
3790
|
}
|
|
3727
3791
|
};
|
|
3728
3792
|
}
|
|
3729
|
-
function
|
|
3730
|
-
let { kv: t, keyPrefix: n =
|
|
3793
|
+
function zi(e) {
|
|
3794
|
+
let { kv: t, keyPrefix: n = Ii, timeoutMs: r } = e;
|
|
3731
3795
|
return {
|
|
3732
|
-
proxyRoutes:
|
|
3796
|
+
proxyRoutes: Ri(),
|
|
3733
3797
|
async resolveHost(e) {
|
|
3734
|
-
let i =
|
|
3735
|
-
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;
|
|
3736
3800
|
}
|
|
3737
3801
|
};
|
|
3738
3802
|
}
|
|
3739
3803
|
//#endregion
|
|
3740
|
-
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 };
|