@authhero/proxy 0.5.0 → 0.6.0
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 +17 -5
- package/dist/proxy.mjs +574 -490
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/app.d.ts +1 -0
- package/dist/types/data-plane/cache-adapter-cache.d.ts +8 -3
- package/dist/types/data-plane/cache-api-cache.d.ts +4 -2
- package/dist/types/data-plane/cache.d.ts +1 -0
- package/dist/types/data-plane/handlers/dispatch-namespace.d.ts +1 -0
- package/dist/types/data-plane/handlers/service-binding.d.ts +1 -0
- package/dist/types/data-plane/router.d.ts +1 -0
- package/dist/types/data-plane/timeout.d.ts +7 -0
- package/package.json +2 -2
package/dist/proxy.mjs
CHANGED
|
@@ -91,12 +91,12 @@ e.object({
|
|
|
91
91
|
tenant_id: e.string(),
|
|
92
92
|
number: e.number().int()
|
|
93
93
|
}).extend(n.shape);
|
|
94
|
-
var
|
|
94
|
+
var p = e.enum([
|
|
95
95
|
"user_action",
|
|
96
96
|
"admin_action",
|
|
97
97
|
"system",
|
|
98
98
|
"api"
|
|
99
|
-
]),
|
|
99
|
+
]), m = e.object({
|
|
100
100
|
type: e.enum([
|
|
101
101
|
"user",
|
|
102
102
|
"admin",
|
|
@@ -110,7 +110,7 @@ var ee = e.enum([
|
|
|
110
110
|
org_name: e.string().optional(),
|
|
111
111
|
scopes: e.array(e.string()).optional(),
|
|
112
112
|
client_id: e.string().optional()
|
|
113
|
-
}),
|
|
113
|
+
}), h = e.object({
|
|
114
114
|
type: e.string(),
|
|
115
115
|
id: e.string(),
|
|
116
116
|
before: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -119,7 +119,7 @@ var ee = e.enum([
|
|
|
119
119
|
old: e.unknown(),
|
|
120
120
|
new: e.unknown()
|
|
121
121
|
})).optional()
|
|
122
|
-
}),
|
|
122
|
+
}), ee = e.object({
|
|
123
123
|
method: e.string(),
|
|
124
124
|
path: e.string(),
|
|
125
125
|
query: e.record(e.string(), e.string()).optional(),
|
|
@@ -127,17 +127,17 @@ var ee = e.enum([
|
|
|
127
127
|
ip: e.string(),
|
|
128
128
|
user_agent: e.string().optional(),
|
|
129
129
|
correlation_id: e.string().optional()
|
|
130
|
-
}),
|
|
130
|
+
}), te = e.object({
|
|
131
131
|
status_code: e.number(),
|
|
132
132
|
body: e.unknown().optional()
|
|
133
|
-
}),
|
|
133
|
+
}), ne = e.object({
|
|
134
134
|
country_code: e.string(),
|
|
135
135
|
city_name: e.string(),
|
|
136
136
|
latitude: e.string(),
|
|
137
137
|
longitude: e.string(),
|
|
138
138
|
time_zone: e.string(),
|
|
139
139
|
continent_code: e.string()
|
|
140
|
-
}),
|
|
140
|
+
}), re = e.object({
|
|
141
141
|
name: e.string(),
|
|
142
142
|
version: e.string(),
|
|
143
143
|
env: e.record(e.string(), e.string()).optional()
|
|
@@ -147,18 +147,18 @@ e.object({
|
|
|
147
147
|
event_type: e.string(),
|
|
148
148
|
log_type: e.string(),
|
|
149
149
|
description: e.string().optional(),
|
|
150
|
-
category:
|
|
151
|
-
actor:
|
|
152
|
-
target:
|
|
153
|
-
request:
|
|
154
|
-
response:
|
|
150
|
+
category: p,
|
|
151
|
+
actor: m,
|
|
152
|
+
target: h,
|
|
153
|
+
request: ee,
|
|
154
|
+
response: te.optional(),
|
|
155
155
|
connection: e.string().optional(),
|
|
156
156
|
strategy: e.string().optional(),
|
|
157
157
|
strategy_type: e.string().optional(),
|
|
158
158
|
audience: e.string().optional(),
|
|
159
159
|
scope: e.string().optional(),
|
|
160
|
-
location:
|
|
161
|
-
auth0_client:
|
|
160
|
+
location: ne.optional(),
|
|
161
|
+
auth0_client: re.optional(),
|
|
162
162
|
hostname: e.string(),
|
|
163
163
|
is_mobile: e.boolean().optional(),
|
|
164
164
|
timestamp: e.string()
|
|
@@ -173,14 +173,14 @@ e.object({
|
|
|
173
173
|
"SEND_REQUEST",
|
|
174
174
|
"SEND_EMAIL"
|
|
175
175
|
]), e.enum(["VERIFY_EMAIL"]);
|
|
176
|
-
var
|
|
176
|
+
var ie = e.object({
|
|
177
177
|
require_mx_record: e.boolean().optional(),
|
|
178
178
|
block_aliases: e.boolean().optional(),
|
|
179
179
|
block_free_emails: e.boolean().optional(),
|
|
180
180
|
block_disposable_emails: e.boolean().optional(),
|
|
181
181
|
blocklist: e.array(e.string()).optional(),
|
|
182
182
|
allowlist: e.array(e.string()).optional()
|
|
183
|
-
}),
|
|
183
|
+
}), ae = e.object({
|
|
184
184
|
id: e.string(),
|
|
185
185
|
alias: e.string().max(100).optional(),
|
|
186
186
|
type: e.literal("AUTH0"),
|
|
@@ -192,7 +192,7 @@ var se = e.object({
|
|
|
192
192
|
user_id: e.string(),
|
|
193
193
|
changes: e.record(e.string(), e.any())
|
|
194
194
|
})
|
|
195
|
-
}),
|
|
195
|
+
}), oe = e.object({
|
|
196
196
|
id: e.string(),
|
|
197
197
|
alias: e.string().max(100).optional(),
|
|
198
198
|
type: e.literal("EMAIL"),
|
|
@@ -201,13 +201,13 @@ var se = e.object({
|
|
|
201
201
|
mask_output: e.boolean().optional(),
|
|
202
202
|
params: e.object({
|
|
203
203
|
email: e.string(),
|
|
204
|
-
rules:
|
|
204
|
+
rules: ie.optional()
|
|
205
205
|
})
|
|
206
|
-
}),
|
|
206
|
+
}), se = e.enum([
|
|
207
207
|
"change-email",
|
|
208
208
|
"account",
|
|
209
209
|
"custom"
|
|
210
|
-
]),
|
|
210
|
+
]), ce = e.object({
|
|
211
211
|
id: e.string(),
|
|
212
212
|
alias: e.string().max(100).optional(),
|
|
213
213
|
type: e.literal("REDIRECT"),
|
|
@@ -215,17 +215,17 @@ var se = e.object({
|
|
|
215
215
|
allow_failure: e.boolean().optional(),
|
|
216
216
|
mask_output: e.boolean().optional(),
|
|
217
217
|
params: e.object({
|
|
218
|
-
target:
|
|
218
|
+
target: se.openapi({ description: "The predefined target to redirect to, or 'custom' for a custom URL" }),
|
|
219
219
|
custom_url: e.string().optional().openapi({ description: "Custom URL to redirect to when target is 'custom'" })
|
|
220
220
|
})
|
|
221
|
-
}),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
}), le = e.union([
|
|
222
|
+
ae,
|
|
223
|
+
oe,
|
|
224
|
+
ce
|
|
225
225
|
]);
|
|
226
226
|
e.object({
|
|
227
227
|
name: e.string().min(1).max(150).openapi({ description: "The name of the flow" }),
|
|
228
|
-
actions: e.array(
|
|
228
|
+
actions: e.array(le).optional().default([]).openapi({ description: "The list of actions to execute in sequence" })
|
|
229
229
|
}).extend(n.shape).extend({ id: e.string().openapi({
|
|
230
230
|
description: "Unique identifier for the flow",
|
|
231
231
|
example: "af_12tMpdJ3iek7svMyZkSh5M"
|
|
@@ -241,7 +241,7 @@ e.object({
|
|
|
241
241
|
length: e.number(),
|
|
242
242
|
total: e.number().optional()
|
|
243
243
|
});
|
|
244
|
-
var
|
|
244
|
+
var ue = e.object({
|
|
245
245
|
email: e.string().optional(),
|
|
246
246
|
email_verified: e.boolean().optional(),
|
|
247
247
|
name: e.string().optional(),
|
|
@@ -250,7 +250,7 @@ var pe = e.object({
|
|
|
250
250
|
phone_number: e.string().optional(),
|
|
251
251
|
phone_verified: e.boolean().optional(),
|
|
252
252
|
family_name: e.string().optional()
|
|
253
|
-
}).catchall(e.any()),
|
|
253
|
+
}).catchall(e.any()), de = e.object({
|
|
254
254
|
connection: e.string(),
|
|
255
255
|
user_id: e.string(),
|
|
256
256
|
provider: e.string(),
|
|
@@ -263,15 +263,15 @@ var pe = e.object({
|
|
|
263
263
|
access_token: e.string().optional(),
|
|
264
264
|
access_token_secret: e.string().optional(),
|
|
265
265
|
refresh_token: e.string().optional(),
|
|
266
|
-
profileData:
|
|
267
|
-
}),
|
|
266
|
+
profileData: ue.optional()
|
|
267
|
+
}), fe = e.object({
|
|
268
268
|
formatted: e.string().optional(),
|
|
269
269
|
street_address: e.string().optional(),
|
|
270
270
|
locality: e.string().optional(),
|
|
271
271
|
region: e.string().optional(),
|
|
272
272
|
postal_code: e.string().optional(),
|
|
273
273
|
country: e.string().optional()
|
|
274
|
-
}).optional(),
|
|
274
|
+
}).optional(), pe = e.object({
|
|
275
275
|
email: e.string().transform((e) => e.toLowerCase()).optional(),
|
|
276
276
|
username: e.string().refine((e) => !e.includes("@"), { message: "Usernames must not contain \"@\". Use the email field for email addresses." }).optional(),
|
|
277
277
|
phone_number: e.string().optional(),
|
|
@@ -294,9 +294,9 @@ var pe = e.object({
|
|
|
294
294
|
gender: e.string().optional(),
|
|
295
295
|
birthdate: e.string().optional(),
|
|
296
296
|
zoneinfo: e.string().optional(),
|
|
297
|
-
address:
|
|
297
|
+
address: fe
|
|
298
298
|
});
|
|
299
|
-
|
|
299
|
+
pe.extend({
|
|
300
300
|
email_verified: e.boolean().default(!1),
|
|
301
301
|
verify_email: e.boolean().optional(),
|
|
302
302
|
last_ip: e.string().optional(),
|
|
@@ -316,24 +316,24 @@ ge.extend({
|
|
|
316
316
|
is_social: e.boolean(),
|
|
317
317
|
email: e.string().optional(),
|
|
318
318
|
login_count: e.number().default(0),
|
|
319
|
-
identities: e.array(
|
|
320
|
-
}).omit({ registration_completed_at: !0 }),
|
|
319
|
+
identities: e.array(de).optional()
|
|
320
|
+
}).omit({ registration_completed_at: !0 }), pe.extend({
|
|
321
321
|
login_count: e.number(),
|
|
322
322
|
multifactor: e.array(e.string()).optional(),
|
|
323
323
|
last_ip: e.string().optional(),
|
|
324
324
|
last_login: e.string().optional(),
|
|
325
325
|
user_id: e.string()
|
|
326
326
|
}).catchall(e.any());
|
|
327
|
-
var
|
|
327
|
+
var me = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", he = (e = 21) => {
|
|
328
328
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
329
|
-
for (; e--;) t +=
|
|
329
|
+
for (; e--;) t += me[n[e] & 63];
|
|
330
330
|
return t;
|
|
331
|
-
},
|
|
331
|
+
}, ge = e.object({
|
|
332
332
|
client_id: e.string().optional().openapi({ description: "ID of this client. Generated server-side if omitted (Auth0 behavior)." }),
|
|
333
333
|
name: e.string().min(1).openapi({ description: "Name of this client (min length: 1 character, does not allow < or >)." }),
|
|
334
334
|
description: e.string().max(140).optional().openapi({ description: "Free text description of this client (max length: 140 characters)." }),
|
|
335
335
|
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)." }),
|
|
336
|
-
client_secret: e.string().default(() =>
|
|
336
|
+
client_secret: e.string().default(() => he()).optional().openapi({ description: "Client secret (which you must not make public)." }),
|
|
337
337
|
app_type: e.enum([
|
|
338
338
|
"native",
|
|
339
339
|
"spa",
|
|
@@ -444,8 +444,8 @@ var _e = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", ve
|
|
|
444
444
|
e.object({
|
|
445
445
|
created_at: e.string(),
|
|
446
446
|
updated_at: e.string()
|
|
447
|
-
}).extend(
|
|
448
|
-
var
|
|
447
|
+
}).extend(ge.shape).extend({ client_id: e.string() });
|
|
448
|
+
var _e = e.object({
|
|
449
449
|
client_id: e.string().min(1).openapi({ description: "ID of the client." }),
|
|
450
450
|
audience: e.string().min(1).openapi({ description: "The audience (API identifier) of this client grant." }),
|
|
451
451
|
scope: e.array(e.string()).optional().openapi({ description: "Scopes allowed for this client grant." }),
|
|
@@ -458,15 +458,15 @@ var be = e.object({
|
|
|
458
458
|
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." }),
|
|
459
459
|
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." }),
|
|
460
460
|
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." })
|
|
461
|
-
}),
|
|
461
|
+
}), ve = e.object({ id: e.string().openapi({ description: "ID of the client grant." }) }).extend(_e.shape).extend({
|
|
462
462
|
created_at: e.string().optional(),
|
|
463
463
|
updated_at: e.string().optional()
|
|
464
464
|
});
|
|
465
|
-
e.array(
|
|
466
|
-
var
|
|
465
|
+
e.array(ve);
|
|
466
|
+
var ye = e.enum(["iat", "rat"]), be = e.object({
|
|
467
467
|
id: e.string(),
|
|
468
468
|
token_hash: e.string(),
|
|
469
|
-
type:
|
|
469
|
+
type: ye,
|
|
470
470
|
client_id: e.string().optional(),
|
|
471
471
|
sub: e.string().optional(),
|
|
472
472
|
constraints: e.record(e.string(), e.unknown()).optional(),
|
|
@@ -477,23 +477,23 @@ e.object({
|
|
|
477
477
|
created_at: e.string(),
|
|
478
478
|
used_at: e.string().optional(),
|
|
479
479
|
revoked_at: e.string().optional()
|
|
480
|
-
}).extend(
|
|
481
|
-
var
|
|
480
|
+
}).extend(be.shape);
|
|
481
|
+
var g = e.object({
|
|
482
482
|
x: e.number(),
|
|
483
483
|
y: e.number()
|
|
484
|
-
}),
|
|
484
|
+
}), xe = /* @__PURE__ */ function(e) {
|
|
485
485
|
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;
|
|
486
|
-
}({}),
|
|
486
|
+
}({}), Se = /* @__PURE__ */ function(e) {
|
|
487
487
|
return e.BLOCK = "BLOCK", e.FIELD = "FIELD", e;
|
|
488
|
-
}({}),
|
|
488
|
+
}({}), _ = e.object({
|
|
489
489
|
id: e.string(),
|
|
490
|
-
category: e.nativeEnum(
|
|
491
|
-
type: e.nativeEnum(
|
|
492
|
-
}),
|
|
490
|
+
category: e.nativeEnum(Se),
|
|
491
|
+
type: e.nativeEnum(xe)
|
|
492
|
+
}), Ce = _.extend({
|
|
493
493
|
category: e.literal("BLOCK"),
|
|
494
494
|
type: e.literal("RICH_TEXT"),
|
|
495
495
|
config: e.object({ content: e.string() }).passthrough()
|
|
496
|
-
}),
|
|
496
|
+
}), we = _.extend({
|
|
497
497
|
category: e.literal("BLOCK"),
|
|
498
498
|
type: e.union([
|
|
499
499
|
e.literal("NEXT_BUTTON"),
|
|
@@ -501,13 +501,13 @@ var p = e.object({
|
|
|
501
501
|
e.literal("SUBMIT_BUTTON")
|
|
502
502
|
]),
|
|
503
503
|
config: e.object({ text: e.string() }).passthrough()
|
|
504
|
-
}),
|
|
504
|
+
}), Te = _.extend({
|
|
505
505
|
category: e.literal("FIELD"),
|
|
506
506
|
type: e.literal("LEGAL"),
|
|
507
507
|
required: e.boolean().optional(),
|
|
508
508
|
sensitive: e.boolean().optional(),
|
|
509
509
|
config: e.object({ text: e.string() }).passthrough()
|
|
510
|
-
}),
|
|
510
|
+
}), Ee = _.extend({
|
|
511
511
|
category: e.literal("FIELD"),
|
|
512
512
|
type: e.union([
|
|
513
513
|
e.literal("TEXT"),
|
|
@@ -527,38 +527,38 @@ var p = e.object({
|
|
|
527
527
|
label: e.string().optional(),
|
|
528
528
|
placeholder: e.string().optional()
|
|
529
529
|
}).passthrough()
|
|
530
|
-
}),
|
|
530
|
+
}), De = e.object({
|
|
531
531
|
id: e.string(),
|
|
532
532
|
category: e.string(),
|
|
533
533
|
type: e.string()
|
|
534
|
-
}).passthrough(),
|
|
534
|
+
}).passthrough(), Oe = e.union([
|
|
535
|
+
Ce,
|
|
536
|
+
we,
|
|
537
|
+
Te,
|
|
535
538
|
Ee,
|
|
536
|
-
De
|
|
537
|
-
|
|
538
|
-
ke,
|
|
539
|
-
Ae
|
|
540
|
-
]), Me = e.object({
|
|
539
|
+
De
|
|
540
|
+
]), ke = e.object({
|
|
541
541
|
id: e.string(),
|
|
542
542
|
type: e.literal("STEP"),
|
|
543
|
-
coordinates:
|
|
543
|
+
coordinates: g,
|
|
544
544
|
alias: e.string().optional(),
|
|
545
545
|
config: e.object({
|
|
546
|
-
components: e.array(
|
|
546
|
+
components: e.array(Oe),
|
|
547
547
|
next_node: e.string()
|
|
548
548
|
}).passthrough()
|
|
549
|
-
}),
|
|
549
|
+
}), Ae = e.object({
|
|
550
550
|
id: e.string(),
|
|
551
551
|
type: e.literal("FLOW"),
|
|
552
|
-
coordinates:
|
|
552
|
+
coordinates: g,
|
|
553
553
|
alias: e.string().optional(),
|
|
554
554
|
config: e.object({
|
|
555
555
|
flow_id: e.string(),
|
|
556
556
|
next_node: e.string()
|
|
557
557
|
})
|
|
558
|
-
}),
|
|
558
|
+
}), je = e.object({
|
|
559
559
|
id: e.string(),
|
|
560
560
|
type: e.literal("ACTION"),
|
|
561
|
-
coordinates:
|
|
561
|
+
coordinates: g,
|
|
562
562
|
alias: e.string().optional(),
|
|
563
563
|
config: e.object({
|
|
564
564
|
action_type: e.enum(["REDIRECT"]).openapi({ description: "The type of action to perform" }),
|
|
@@ -570,29 +570,29 @@ var p = e.object({
|
|
|
570
570
|
custom_url: e.string().optional().openapi({ description: "Custom URL when target is 'custom'" }),
|
|
571
571
|
next_node: e.string().openapi({ description: "The next node to navigate to after action (for non-redirect actions)" })
|
|
572
572
|
}).passthrough()
|
|
573
|
-
}),
|
|
573
|
+
}), Me = e.object({
|
|
574
574
|
id: e.string(),
|
|
575
575
|
type: e.string(),
|
|
576
|
-
coordinates:
|
|
577
|
-
}).passthrough(),
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
]),
|
|
576
|
+
coordinates: g
|
|
577
|
+
}).passthrough(), Ne = e.union([
|
|
578
|
+
ke,
|
|
579
|
+
Ae,
|
|
580
|
+
je,
|
|
581
|
+
Me
|
|
582
|
+
]), Pe = e.object({
|
|
583
583
|
next_node: e.string(),
|
|
584
|
-
coordinates:
|
|
585
|
-
}).passthrough(),
|
|
584
|
+
coordinates: g
|
|
585
|
+
}).passthrough(), Fe = e.object({
|
|
586
586
|
resume_flow: e.boolean().optional(),
|
|
587
|
-
coordinates:
|
|
587
|
+
coordinates: g
|
|
588
588
|
}).passthrough();
|
|
589
589
|
e.object({
|
|
590
590
|
id: e.string(),
|
|
591
591
|
name: e.string(),
|
|
592
592
|
languages: e.object({ primary: e.string() }).passthrough(),
|
|
593
|
-
nodes: e.array(
|
|
594
|
-
start:
|
|
595
|
-
ending:
|
|
593
|
+
nodes: e.array(Ne),
|
|
594
|
+
start: Pe,
|
|
595
|
+
ending: Fe,
|
|
596
596
|
created_at: e.string(),
|
|
597
597
|
updated_at: e.string(),
|
|
598
598
|
links: e.object({
|
|
@@ -604,24 +604,24 @@ e.object({
|
|
|
604
604
|
created_at: !0,
|
|
605
605
|
updated_at: !0
|
|
606
606
|
});
|
|
607
|
-
var
|
|
607
|
+
var Ie = /* @__PURE__ */ function(e) {
|
|
608
608
|
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;
|
|
609
|
-
}({}),
|
|
609
|
+
}({}), Le = /* @__PURE__ */ function(e) {
|
|
610
610
|
return e.QUERY = "query", e.FRAGMENT = "fragment", e.FORM_POST = "form_post", e.WEB_MESSAGE = "web_message", e.SAML_POST = "saml_post", e;
|
|
611
|
-
}({}),
|
|
611
|
+
}({}), Re = /* @__PURE__ */ function(e) {
|
|
612
612
|
return e.S256 = "S256", e.Plain = "plain", e;
|
|
613
|
-
}({}),
|
|
613
|
+
}({}), ze = e.union([e.null(), e.object({
|
|
614
614
|
essential: e.boolean().optional(),
|
|
615
615
|
value: e.unknown().optional(),
|
|
616
616
|
values: e.array(e.unknown()).optional()
|
|
617
|
-
})]).nullable(),
|
|
618
|
-
userinfo: e.record(e.string(),
|
|
619
|
-
id_token: e.record(e.string(),
|
|
620
|
-
}),
|
|
617
|
+
})]).nullable(), Be = e.object({
|
|
618
|
+
userinfo: e.record(e.string(), ze).optional(),
|
|
619
|
+
id_token: e.record(e.string(), ze).optional()
|
|
620
|
+
}), Ve = e.object({
|
|
621
621
|
client_id: e.string(),
|
|
622
622
|
act_as: e.string().optional(),
|
|
623
|
-
response_type: e.nativeEnum(
|
|
624
|
-
response_mode: e.nativeEnum(
|
|
623
|
+
response_type: e.nativeEnum(Ie).optional(),
|
|
624
|
+
response_mode: e.nativeEnum(Le).optional(),
|
|
625
625
|
redirect_uri: e.string().optional(),
|
|
626
626
|
audience: e.string().optional(),
|
|
627
627
|
organization: e.string().optional(),
|
|
@@ -629,13 +629,13 @@ var ze = /* @__PURE__ */ function(e) {
|
|
|
629
629
|
nonce: e.string().optional(),
|
|
630
630
|
scope: e.string().optional(),
|
|
631
631
|
prompt: e.string().optional(),
|
|
632
|
-
code_challenge_method: e.nativeEnum(
|
|
632
|
+
code_challenge_method: e.nativeEnum(Re).optional(),
|
|
633
633
|
code_challenge: e.string().optional(),
|
|
634
634
|
username: e.string().optional(),
|
|
635
635
|
ui_locales: e.string().optional(),
|
|
636
636
|
max_age: e.number().optional(),
|
|
637
637
|
acr_values: e.string().optional(),
|
|
638
|
-
claims:
|
|
638
|
+
claims: Be.optional(),
|
|
639
639
|
vendor_id: e.string().optional()
|
|
640
640
|
});
|
|
641
641
|
e.object({
|
|
@@ -658,7 +658,7 @@ e.object({
|
|
|
658
658
|
"auto"
|
|
659
659
|
]).optional()
|
|
660
660
|
});
|
|
661
|
-
var
|
|
661
|
+
var He = e.enum([
|
|
662
662
|
"password_reset",
|
|
663
663
|
"email_verification",
|
|
664
664
|
"otp",
|
|
@@ -671,7 +671,7 @@ e.object({
|
|
|
671
671
|
code_id: e.string().openapi({ description: "The code that will be used in for instance an email verification flow" }),
|
|
672
672
|
login_id: e.string().openapi({ description: "The id of the login session that the code is connected to" }),
|
|
673
673
|
connection_id: e.string().optional().openapi({ description: "The connection that the code is connected to" }),
|
|
674
|
-
code_type:
|
|
674
|
+
code_type: He,
|
|
675
675
|
code_verifier: e.string().optional().openapi({ description: "The code verifier used in PKCE in outbound flows" }),
|
|
676
676
|
code_challenge: e.string().optional().openapi({ description: "The code challenge used in PKCE in outbound flows" }),
|
|
677
677
|
code_challenge_method: e.enum(["plain", "S256"]).optional().openapi({ description: "The code challenge method used in PKCE in outbound flows" }),
|
|
@@ -683,7 +683,7 @@ e.object({
|
|
|
683
683
|
used_at: e.string().optional(),
|
|
684
684
|
user_id: e.string().optional()
|
|
685
685
|
}).extend({ created_at: e.string() });
|
|
686
|
-
var
|
|
686
|
+
var Ue = e.object({
|
|
687
687
|
kid: e.string().optional(),
|
|
688
688
|
team_id: e.string().optional(),
|
|
689
689
|
realms: e.string().optional(),
|
|
@@ -799,23 +799,23 @@ var Ge = e.object({
|
|
|
799
799
|
"never_on_login"
|
|
800
800
|
]).optional()
|
|
801
801
|
});
|
|
802
|
-
function
|
|
802
|
+
function v(e) {
|
|
803
803
|
if (e !== null) {
|
|
804
|
-
if (Array.isArray(e)) return e.filter((e) => e !== null).map(
|
|
804
|
+
if (Array.isArray(e)) return e.filter((e) => e !== null).map(v);
|
|
805
805
|
if (e && typeof e == "object") {
|
|
806
806
|
let t = {};
|
|
807
|
-
for (let [n, r] of Object.entries(e)) r !== null && (t[n] =
|
|
807
|
+
for (let [n, r] of Object.entries(e)) r !== null && (t[n] = v(r));
|
|
808
808
|
return t;
|
|
809
809
|
}
|
|
810
810
|
return e;
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
var
|
|
813
|
+
var We = e.object({
|
|
814
814
|
id: e.string().optional(),
|
|
815
815
|
name: e.string(),
|
|
816
816
|
display_name: e.string().optional(),
|
|
817
817
|
strategy: e.string(),
|
|
818
|
-
options: e.preprocess((e) => e === null ? {} :
|
|
818
|
+
options: e.preprocess((e) => e === null ? {} : v(e), Ue).default({}),
|
|
819
819
|
enabled_clients: e.array(e.string()).default([]).optional(),
|
|
820
820
|
response_type: e.custom().optional(),
|
|
821
821
|
response_mode: e.custom().optional(),
|
|
@@ -828,8 +828,8 @@ e.object({
|
|
|
828
828
|
id: e.string(),
|
|
829
829
|
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
830
830
|
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
831
|
-
}).extend(
|
|
832
|
-
var
|
|
831
|
+
}).extend(We.shape);
|
|
832
|
+
var Ge = e.object({
|
|
833
833
|
domain: e.string(),
|
|
834
834
|
custom_domain_id: e.string().optional(),
|
|
835
835
|
type: e.enum(["auth0_managed_certs", "self_managed_certs"]),
|
|
@@ -843,7 +843,7 @@ var qe = e.object({
|
|
|
843
843
|
"null"
|
|
844
844
|
]).optional(),
|
|
845
845
|
domain_metadata: e.record(e.string(), e.string().max(255)).optional()
|
|
846
|
-
}),
|
|
846
|
+
}), Ke = e.discriminatedUnion("name", [e.object({
|
|
847
847
|
name: e.literal("txt"),
|
|
848
848
|
record: e.string(),
|
|
849
849
|
domain: e.string()
|
|
@@ -851,8 +851,7 @@ var qe = e.object({
|
|
|
851
851
|
name: e.literal("http"),
|
|
852
852
|
http_body: e.string(),
|
|
853
853
|
http_url: e.string()
|
|
854
|
-
})])
|
|
855
|
-
qe.extend({
|
|
854
|
+
})]), qe = Ge.extend({
|
|
856
855
|
custom_domain_id: e.string(),
|
|
857
856
|
primary: e.boolean(),
|
|
858
857
|
status: e.enum([
|
|
@@ -862,23 +861,28 @@ qe.extend({
|
|
|
862
861
|
"ready"
|
|
863
862
|
]),
|
|
864
863
|
origin_domain_name: e.string().optional(),
|
|
865
|
-
verification: e.object({ methods: e.array(
|
|
864
|
+
verification: e.object({ methods: e.array(Ke) }).optional(),
|
|
866
865
|
tls_policy: e.string().optional()
|
|
867
|
-
})
|
|
866
|
+
});
|
|
867
|
+
Ge.pick({
|
|
868
|
+
tls_policy: !0,
|
|
869
|
+
custom_client_ip_header: !0,
|
|
870
|
+
domain_metadata: !0
|
|
871
|
+
}).strict(), qe.extend({ tenant_id: e.string() }), e.object({
|
|
868
872
|
certificate: e.string().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/, "must be PEM-encoded; include the full certificate chain in leaf-first order"),
|
|
869
873
|
private_key: e.string().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/, "must be a PEM-encoded private key")
|
|
870
874
|
});
|
|
871
|
-
var
|
|
875
|
+
var y = e.object({
|
|
872
876
|
id: e.string(),
|
|
873
877
|
order: e.number().optional(),
|
|
874
878
|
visible: e.boolean().optional().default(!0)
|
|
875
|
-
}),
|
|
879
|
+
}), b = y.extend({ category: e.literal("BLOCK").optional() }), Je = b.extend({
|
|
876
880
|
type: e.literal("DIVIDER"),
|
|
877
881
|
config: e.object({ text: e.string().optional() }).optional()
|
|
878
|
-
}),
|
|
882
|
+
}), Ye = b.extend({
|
|
879
883
|
type: e.literal("HTML"),
|
|
880
884
|
config: e.object({ content: e.string().optional() }).optional()
|
|
881
|
-
}),
|
|
885
|
+
}), Xe = b.extend({
|
|
882
886
|
type: e.literal("IMAGE"),
|
|
883
887
|
config: e.object({
|
|
884
888
|
src: e.string().optional(),
|
|
@@ -886,43 +890,43 @@ var _ = e.object({
|
|
|
886
890
|
width: e.number().optional(),
|
|
887
891
|
height: e.number().optional()
|
|
888
892
|
}).optional()
|
|
889
|
-
}),
|
|
893
|
+
}), Ze = b.extend({
|
|
890
894
|
type: e.literal("JUMP_BUTTON"),
|
|
891
895
|
config: e.object({
|
|
892
896
|
text: e.string().optional(),
|
|
893
897
|
target_step: e.string().optional()
|
|
894
898
|
})
|
|
895
|
-
}),
|
|
899
|
+
}), Qe = b.extend({
|
|
896
900
|
type: e.literal("RESEND_BUTTON"),
|
|
897
901
|
config: e.object({
|
|
898
902
|
text: e.string().optional(),
|
|
899
903
|
resend_action: e.string().optional()
|
|
900
904
|
})
|
|
901
|
-
}),
|
|
905
|
+
}), $e = b.extend({
|
|
902
906
|
type: e.literal("NEXT_BUTTON"),
|
|
903
907
|
config: e.object({ text: e.string().optional() })
|
|
904
|
-
}),
|
|
908
|
+
}), et = b.extend({
|
|
905
909
|
type: e.literal("PREVIOUS_BUTTON"),
|
|
906
910
|
config: e.object({ text: e.string().optional() })
|
|
907
|
-
}),
|
|
911
|
+
}), tt = b.extend({
|
|
908
912
|
type: e.literal("RICH_TEXT"),
|
|
909
913
|
config: e.object({ content: e.string().optional() }).optional()
|
|
910
|
-
}),
|
|
914
|
+
}), x = y.extend({
|
|
911
915
|
category: e.literal("WIDGET").optional(),
|
|
912
916
|
label: e.string().min(1).optional(),
|
|
913
917
|
hint: e.string().min(1).max(500).optional(),
|
|
914
918
|
required: e.boolean().optional(),
|
|
915
919
|
sensitive: e.boolean().optional()
|
|
916
|
-
}),
|
|
920
|
+
}), nt = x.extend({
|
|
917
921
|
type: e.literal("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
918
922
|
config: e.object({ credential_type: e.string().optional() })
|
|
919
|
-
}),
|
|
923
|
+
}), rt = x.extend({
|
|
920
924
|
type: e.literal("GMAPS_ADDRESS"),
|
|
921
925
|
config: e.object({ api_key: e.string().optional() })
|
|
922
|
-
}),
|
|
926
|
+
}), it = x.extend({
|
|
923
927
|
type: e.literal("RECAPTCHA"),
|
|
924
928
|
config: e.object({ site_key: e.string().optional() })
|
|
925
|
-
}),
|
|
929
|
+
}), S = y.extend({
|
|
926
930
|
category: e.literal("FIELD").optional(),
|
|
927
931
|
label: e.string().min(1).optional(),
|
|
928
932
|
hint: e.string().min(1).max(500).optional(),
|
|
@@ -938,10 +942,10 @@ var _ = e.object({
|
|
|
938
942
|
})).optional(),
|
|
939
943
|
required: e.boolean().optional(),
|
|
940
944
|
sensitive: e.boolean().optional()
|
|
941
|
-
}),
|
|
945
|
+
}), at = S.extend({
|
|
942
946
|
type: e.literal("BOOLEAN"),
|
|
943
947
|
config: e.object({ default_value: e.boolean().optional() }).optional()
|
|
944
|
-
}),
|
|
948
|
+
}), ot = S.extend({
|
|
945
949
|
type: e.literal("CARDS"),
|
|
946
950
|
config: e.object({
|
|
947
951
|
options: e.array(e.object({
|
|
@@ -952,7 +956,7 @@ var _ = e.object({
|
|
|
952
956
|
})).optional(),
|
|
953
957
|
multi_select: e.boolean().optional()
|
|
954
958
|
}).optional()
|
|
955
|
-
}),
|
|
959
|
+
}), st = S.extend({
|
|
956
960
|
type: e.literal("CHOICE"),
|
|
957
961
|
config: e.object({
|
|
958
962
|
options: e.array(e.object({
|
|
@@ -963,7 +967,7 @@ var _ = e.object({
|
|
|
963
967
|
multiple: e.boolean().optional(),
|
|
964
968
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
965
969
|
}).optional()
|
|
966
|
-
}),
|
|
970
|
+
}), ct = S.extend({
|
|
967
971
|
type: e.literal("CUSTOM"),
|
|
968
972
|
config: e.object({
|
|
969
973
|
component: e.string().optional(),
|
|
@@ -971,7 +975,7 @@ var _ = e.object({
|
|
|
971
975
|
schema: e.record(e.string(), e.any()).optional(),
|
|
972
976
|
code: e.string().optional()
|
|
973
977
|
})
|
|
974
|
-
}),
|
|
978
|
+
}), lt = S.extend({
|
|
975
979
|
type: e.literal("DATE"),
|
|
976
980
|
config: e.object({
|
|
977
981
|
format: e.string().optional(),
|
|
@@ -979,7 +983,7 @@ var _ = e.object({
|
|
|
979
983
|
max: e.string().optional(),
|
|
980
984
|
default_value: e.string().optional()
|
|
981
985
|
}).optional()
|
|
982
|
-
}),
|
|
986
|
+
}), ut = S.extend({
|
|
983
987
|
type: e.literal("DROPDOWN"),
|
|
984
988
|
config: e.object({
|
|
985
989
|
options: e.array(e.object({
|
|
@@ -991,26 +995,26 @@ var _ = e.object({
|
|
|
991
995
|
multiple: e.boolean().optional(),
|
|
992
996
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
993
997
|
}).optional()
|
|
994
|
-
}),
|
|
998
|
+
}), dt = S.extend({
|
|
995
999
|
type: e.literal("EMAIL"),
|
|
996
1000
|
config: e.object({
|
|
997
1001
|
placeholder: e.string().optional(),
|
|
998
1002
|
default_value: e.string().optional()
|
|
999
1003
|
}).optional()
|
|
1000
|
-
}),
|
|
1004
|
+
}), ft = S.extend({
|
|
1001
1005
|
type: e.literal("FILE"),
|
|
1002
1006
|
config: e.object({
|
|
1003
1007
|
accept: e.string().optional(),
|
|
1004
1008
|
max_size: e.number().optional(),
|
|
1005
1009
|
multiple: e.boolean().optional()
|
|
1006
1010
|
}).optional()
|
|
1007
|
-
}),
|
|
1011
|
+
}), pt = S.extend({
|
|
1008
1012
|
type: e.literal("LEGAL"),
|
|
1009
1013
|
config: e.object({
|
|
1010
1014
|
text: e.string(),
|
|
1011
1015
|
html: e.boolean().optional()
|
|
1012
1016
|
}).optional()
|
|
1013
|
-
}),
|
|
1017
|
+
}), mt = S.extend({
|
|
1014
1018
|
type: e.literal("NUMBER"),
|
|
1015
1019
|
config: e.object({
|
|
1016
1020
|
placeholder: e.string().optional(),
|
|
@@ -1019,7 +1023,7 @@ var _ = e.object({
|
|
|
1019
1023
|
step: e.number().optional(),
|
|
1020
1024
|
default_value: e.string().optional()
|
|
1021
1025
|
}).optional()
|
|
1022
|
-
}),
|
|
1026
|
+
}), ht = S.extend({
|
|
1023
1027
|
type: e.literal("PASSWORD"),
|
|
1024
1028
|
config: e.object({
|
|
1025
1029
|
placeholder: e.string().optional(),
|
|
@@ -1028,13 +1032,13 @@ var _ = e.object({
|
|
|
1028
1032
|
forgot_password_link: e.string().optional(),
|
|
1029
1033
|
default_value: e.string().optional()
|
|
1030
1034
|
}).optional()
|
|
1031
|
-
}),
|
|
1035
|
+
}), gt = S.extend({
|
|
1032
1036
|
type: e.literal("PAYMENT"),
|
|
1033
1037
|
config: e.object({
|
|
1034
1038
|
provider: e.string().optional(),
|
|
1035
1039
|
currency: e.string().optional()
|
|
1036
1040
|
}).optional()
|
|
1037
|
-
}),
|
|
1041
|
+
}), _t = S.extend({
|
|
1038
1042
|
type: e.literal("SOCIAL"),
|
|
1039
1043
|
config: e.object({
|
|
1040
1044
|
providers: e.array(e.string()).optional(),
|
|
@@ -1046,7 +1050,7 @@ var _ = e.object({
|
|
|
1046
1050
|
href: e.string().optional()
|
|
1047
1051
|
})).optional()
|
|
1048
1052
|
}).optional()
|
|
1049
|
-
}),
|
|
1053
|
+
}), vt = S.extend({
|
|
1050
1054
|
type: e.literal("TEL"),
|
|
1051
1055
|
config: e.object({
|
|
1052
1056
|
placeholder: e.string().optional(),
|
|
@@ -1054,7 +1058,7 @@ var _ = e.object({
|
|
|
1054
1058
|
default_value: e.string().optional(),
|
|
1055
1059
|
allow_email: e.boolean().optional()
|
|
1056
1060
|
}).optional()
|
|
1057
|
-
}),
|
|
1061
|
+
}), yt = S.extend({
|
|
1058
1062
|
type: e.literal("TEXT"),
|
|
1059
1063
|
config: e.object({
|
|
1060
1064
|
placeholder: e.string().optional(),
|
|
@@ -1062,36 +1066,37 @@ var _ = e.object({
|
|
|
1062
1066
|
max_length: e.number().optional(),
|
|
1063
1067
|
default_value: e.string().optional()
|
|
1064
1068
|
}).optional()
|
|
1065
|
-
}),
|
|
1069
|
+
}), bt = S.extend({
|
|
1066
1070
|
type: e.literal("COUNTRY"),
|
|
1067
1071
|
config: e.object({
|
|
1068
1072
|
placeholder: e.string().optional(),
|
|
1069
1073
|
default_value: e.string().optional()
|
|
1070
1074
|
}).optional()
|
|
1071
|
-
}),
|
|
1075
|
+
}), xt = S.extend({
|
|
1072
1076
|
type: e.literal("URL"),
|
|
1073
1077
|
config: e.object({
|
|
1074
1078
|
placeholder: e.string().optional(),
|
|
1075
1079
|
default_value: e.string().optional()
|
|
1076
1080
|
}).optional()
|
|
1077
|
-
}),
|
|
1081
|
+
}), St = e.discriminatedUnion("type", [
|
|
1082
|
+
Je,
|
|
1078
1083
|
Ye,
|
|
1079
1084
|
Xe,
|
|
1080
1085
|
Ze,
|
|
1081
1086
|
Qe,
|
|
1082
1087
|
$e,
|
|
1083
1088
|
et,
|
|
1084
|
-
tt
|
|
1085
|
-
|
|
1086
|
-
|
|
1089
|
+
tt
|
|
1090
|
+
]), Ct = e.discriminatedUnion("type", [
|
|
1091
|
+
nt,
|
|
1087
1092
|
rt,
|
|
1088
|
-
it
|
|
1089
|
-
|
|
1090
|
-
|
|
1093
|
+
it
|
|
1094
|
+
]), wt = e.discriminatedUnion("type", [
|
|
1095
|
+
at,
|
|
1091
1096
|
ot,
|
|
1092
1097
|
st,
|
|
1098
|
+
bt,
|
|
1093
1099
|
ct,
|
|
1094
|
-
xt,
|
|
1095
1100
|
lt,
|
|
1096
1101
|
ut,
|
|
1097
1102
|
dt,
|
|
@@ -1103,12 +1108,11 @@ var _ = e.object({
|
|
|
1103
1108
|
_t,
|
|
1104
1109
|
vt,
|
|
1105
1110
|
yt,
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1111
|
+
xt
|
|
1112
|
+
]), Tt = e.union([
|
|
1113
|
+
St,
|
|
1109
1114
|
Ct,
|
|
1110
|
-
wt
|
|
1111
|
-
Tt
|
|
1115
|
+
wt
|
|
1112
1116
|
]);
|
|
1113
1117
|
new Set([
|
|
1114
1118
|
"BOOLEAN",
|
|
@@ -1134,13 +1138,13 @@ new Set([
|
|
|
1134
1138
|
visible: e.boolean().optional().default(!0),
|
|
1135
1139
|
customizations: e.record(e.string(), e.any()).optional()
|
|
1136
1140
|
});
|
|
1137
|
-
var
|
|
1141
|
+
var C = e.object({
|
|
1138
1142
|
x: e.number(),
|
|
1139
1143
|
y: e.number()
|
|
1140
1144
|
}), Et = e.object({
|
|
1141
1145
|
id: e.string(),
|
|
1142
1146
|
type: e.literal("FLOW"),
|
|
1143
|
-
coordinates:
|
|
1147
|
+
coordinates: C,
|
|
1144
1148
|
alias: e.string().min(1).max(150).optional(),
|
|
1145
1149
|
config: e.object({
|
|
1146
1150
|
flow_id: e.string().max(30),
|
|
@@ -1149,7 +1153,7 @@ var S = e.object({
|
|
|
1149
1153
|
}), Dt = e.object({
|
|
1150
1154
|
id: e.string(),
|
|
1151
1155
|
type: e.literal("ROUTER"),
|
|
1152
|
-
coordinates:
|
|
1156
|
+
coordinates: C,
|
|
1153
1157
|
alias: e.string().min(1).max(150),
|
|
1154
1158
|
config: e.object({
|
|
1155
1159
|
rules: e.array(e.object({
|
|
@@ -1163,10 +1167,10 @@ var S = e.object({
|
|
|
1163
1167
|
}), Ot = e.object({
|
|
1164
1168
|
id: e.string(),
|
|
1165
1169
|
type: e.literal("STEP"),
|
|
1166
|
-
coordinates:
|
|
1170
|
+
coordinates: C,
|
|
1167
1171
|
alias: e.string().min(1).max(150).optional(),
|
|
1168
1172
|
config: e.object({
|
|
1169
|
-
components: e.array(
|
|
1173
|
+
components: e.array(Tt),
|
|
1170
1174
|
next_node: e.string().optional()
|
|
1171
1175
|
})
|
|
1172
1176
|
}), kt = e.discriminatedUnion("type", [
|
|
@@ -1191,7 +1195,7 @@ var S = e.object({
|
|
|
1191
1195
|
value: e.string()
|
|
1192
1196
|
})).optional(),
|
|
1193
1197
|
next_node: e.string().optional(),
|
|
1194
|
-
coordinates:
|
|
1198
|
+
coordinates: C.optional()
|
|
1195
1199
|
}).optional(),
|
|
1196
1200
|
ending: e.object({
|
|
1197
1201
|
redirection: e.object({
|
|
@@ -1199,7 +1203,7 @@ var S = e.object({
|
|
|
1199
1203
|
target: e.string().optional()
|
|
1200
1204
|
}).optional(),
|
|
1201
1205
|
after_submit: e.object({ flow_id: e.string().optional() }).optional(),
|
|
1202
|
-
coordinates:
|
|
1206
|
+
coordinates: C.optional(),
|
|
1203
1207
|
resume_flow: e.boolean().optional()
|
|
1204
1208
|
}).optional(),
|
|
1205
1209
|
style: e.object({ css: e.string().optional() }).optional(),
|
|
@@ -1230,12 +1234,12 @@ e.object({
|
|
|
1230
1234
|
method: e.enum(["POST", "GET"]),
|
|
1231
1235
|
title: e.string().optional(),
|
|
1232
1236
|
description: e.string().optional(),
|
|
1233
|
-
components: e.array(
|
|
1237
|
+
components: e.array(Tt),
|
|
1234
1238
|
messages: e.array(jt).optional(),
|
|
1235
1239
|
links: e.array(Mt).optional(),
|
|
1236
1240
|
footer: e.string().optional()
|
|
1237
1241
|
});
|
|
1238
|
-
var
|
|
1242
|
+
var w = e.enum([
|
|
1239
1243
|
"pre-user-registration",
|
|
1240
1244
|
"post-user-registration",
|
|
1241
1245
|
"post-user-login",
|
|
@@ -1243,48 +1247,48 @@ var C = e.enum([
|
|
|
1243
1247
|
"validate-registration-username",
|
|
1244
1248
|
"pre-user-deletion",
|
|
1245
1249
|
"post-user-deletion"
|
|
1246
|
-
]),
|
|
1250
|
+
]), T = e.enum([
|
|
1247
1251
|
"pre-user-registration",
|
|
1248
1252
|
"post-user-registration",
|
|
1249
1253
|
"post-user-login",
|
|
1250
1254
|
"validate-registration-username",
|
|
1251
1255
|
"pre-user-deletion",
|
|
1252
1256
|
"post-user-deletion"
|
|
1253
|
-
]),
|
|
1257
|
+
]), E = e.enum([
|
|
1254
1258
|
"post-user-login",
|
|
1255
1259
|
"post-user-registration",
|
|
1256
1260
|
"post-user-update",
|
|
1257
1261
|
"credentials-exchange"
|
|
1258
|
-
]),
|
|
1262
|
+
]), D = e.enum([
|
|
1259
1263
|
"post-user-login",
|
|
1260
1264
|
"credentials-exchange",
|
|
1261
1265
|
"pre-user-registration",
|
|
1262
1266
|
"post-user-registration"
|
|
1263
|
-
]),
|
|
1267
|
+
]), O = e.enum([
|
|
1264
1268
|
"ensure-username",
|
|
1265
1269
|
"set-preferred-username",
|
|
1266
1270
|
"account-linking"
|
|
1267
|
-
]),
|
|
1271
|
+
]), k = {
|
|
1268
1272
|
enabled: e.boolean().default(!1),
|
|
1269
1273
|
synchronous: e.boolean().default(!1),
|
|
1270
1274
|
priority: e.number().optional(),
|
|
1271
1275
|
hook_id: e.string().optional(),
|
|
1272
1276
|
metadata: e.record(e.string(), e.unknown()).optional()
|
|
1273
1277
|
}, Nt = e.object({
|
|
1274
|
-
...
|
|
1275
|
-
trigger_id:
|
|
1278
|
+
...k,
|
|
1279
|
+
trigger_id: w,
|
|
1276
1280
|
url: e.string()
|
|
1277
1281
|
}), Pt = e.object({
|
|
1278
|
-
...
|
|
1279
|
-
trigger_id:
|
|
1282
|
+
...k,
|
|
1283
|
+
trigger_id: T,
|
|
1280
1284
|
form_id: e.string()
|
|
1281
1285
|
}), Ft = e.object({
|
|
1282
|
-
...
|
|
1283
|
-
trigger_id: T,
|
|
1284
|
-
template_id: D
|
|
1285
|
-
}), It = e.object({
|
|
1286
|
-
...O,
|
|
1286
|
+
...k,
|
|
1287
1287
|
trigger_id: E,
|
|
1288
|
+
template_id: O
|
|
1289
|
+
}), It = e.object({
|
|
1290
|
+
...k,
|
|
1291
|
+
trigger_id: D,
|
|
1288
1292
|
code_id: e.string()
|
|
1289
1293
|
});
|
|
1290
1294
|
e.union([
|
|
@@ -1294,26 +1298,26 @@ e.union([
|
|
|
1294
1298
|
It
|
|
1295
1299
|
]);
|
|
1296
1300
|
var Lt = e.object({
|
|
1297
|
-
...
|
|
1298
|
-
trigger_id:
|
|
1301
|
+
...k,
|
|
1302
|
+
trigger_id: w
|
|
1299
1303
|
}).extend(n.shape).extend({
|
|
1300
1304
|
hook_id: e.string(),
|
|
1301
1305
|
url: e.string()
|
|
1302
1306
|
}), Rt = e.object({
|
|
1303
|
-
...
|
|
1304
|
-
trigger_id:
|
|
1307
|
+
...k,
|
|
1308
|
+
trigger_id: T
|
|
1305
1309
|
}).extend(n.shape).extend({
|
|
1306
1310
|
hook_id: e.string(),
|
|
1307
1311
|
form_id: e.string()
|
|
1308
1312
|
}), zt = e.object({
|
|
1309
|
-
...
|
|
1310
|
-
trigger_id:
|
|
1313
|
+
...k,
|
|
1314
|
+
trigger_id: E
|
|
1311
1315
|
}).extend(n.shape).extend({
|
|
1312
1316
|
hook_id: e.string(),
|
|
1313
|
-
template_id:
|
|
1317
|
+
template_id: O
|
|
1314
1318
|
}), Bt = e.object({
|
|
1315
|
-
...
|
|
1316
|
-
trigger_id:
|
|
1319
|
+
...k,
|
|
1320
|
+
trigger_id: D
|
|
1317
1321
|
}).extend(n.shape).extend({
|
|
1318
1322
|
hook_id: e.string(),
|
|
1319
1323
|
code_id: e.string()
|
|
@@ -1427,7 +1431,7 @@ var Gt = /* @__PURE__ */ function(e) {
|
|
|
1427
1431
|
e.object({
|
|
1428
1432
|
csrf_token: e.string(),
|
|
1429
1433
|
auth0Client: e.string().optional(),
|
|
1430
|
-
authParams:
|
|
1434
|
+
authParams: Ve,
|
|
1431
1435
|
expires_at: e.string(),
|
|
1432
1436
|
deleted_at: e.string().optional(),
|
|
1433
1437
|
ip: e.string().optional(),
|
|
@@ -1446,7 +1450,7 @@ e.object({
|
|
|
1446
1450
|
created_at: e.string(),
|
|
1447
1451
|
updated_at: e.string()
|
|
1448
1452
|
});
|
|
1449
|
-
var
|
|
1453
|
+
var A = {
|
|
1450
1454
|
ACLS_SUMMARY: "acls_summary",
|
|
1451
1455
|
ACTIONS_EXECUTION_FAILED: "actions_execution_failed",
|
|
1452
1456
|
API_LIMIT: "api_limit",
|
|
@@ -1606,10 +1610,10 @@ var k = {
|
|
|
1606
1610
|
WARNING_DURING_LOGIN: "w",
|
|
1607
1611
|
WARNING_SENDING_NOTIFICATION: "wn",
|
|
1608
1612
|
WARNING_USER_MANAGEMENT: "wum"
|
|
1609
|
-
}, Jt = e.string().refine((e) => Object.values(
|
|
1610
|
-
|
|
1613
|
+
}, Jt = e.string().refine((e) => Object.values(A).includes(e), { message: "Invalid log type" });
|
|
1614
|
+
A.ACLS_SUMMARY, A.ACTIONS_EXECUTION_FAILED, A.API_LIMIT, A.API_LIMIT_WARNING, A.APPI, A.CIBA_EXCHANGE_FAILED, A.CIBA_EXCHANGE_SUCCEEDED, A.CIBA_START_FAILED, A.CIBA_START_SUCCEEDED, A.CODE_LINK_SENT, A.CODE_SENT, A.DEPRECATION_NOTICE, A.FAILED_LOGIN, A.FAILED_BY_CONNECTOR, A.FAILED_CHANGE_EMAIL, A.FAILED_BY_CORS, A.FAILED_CROSS_ORIGIN_AUTHENTICATION, A.FAILED_CHANGE_PASSWORD, A.FAILED_POST_CHANGE_PASSWORD_HOOK, A.FAILED_CHANGE_PHONE_NUMBER, A.FAILED_CHANGE_PASSWORD_REQUEST, A.FAILED_CONNECTOR_PROVISIONING, A.FAILED_CHANGE_USERNAME, A.FAILED_DELEGATION, A.FAILED_DEVICE_ACTIVATION, A.FAILED_DEVICE_AUTHORIZATION_REQUEST, A.USER_CANCELED_DEVICE_CONFIRMATION, A.FAILED_USER_DELETION, A.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, A.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, A.FAILED_EXCHANGE_CUSTOM_TOKEN, A.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, A.FAILED_FEDERATED_LOGOUT, A.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN, A.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, A.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, A.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, A.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, A.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, A.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN, A.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, A.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, A.FAILED_HOOK, A.FAILED_IMPERSONATION, A.FAILED_INVITE_ACCEPT, A.FAILED_LOGOUT, A.FLOWS_EXECUTION_COMPLETED, A.FLOWS_EXECUTION_FAILED, A.FAILED_SENDING_NOTIFICATION, A.FORMS_SUBMISSION_FAILED, A.FORMS_SUBMISSION_SUCCEEDED, A.FAILED_LOGIN_INCORRECT_PASSWORD, A.FAILED_PUSHED_AUTHORIZATION_REQUEST, A.FAILED_POST_USER_REGISTRATION_HOOK, A.FAILED_SIGNUP, A.FAILED_SILENT_AUTH, A.FAILED_LOGIN_INVALID_EMAIL_USERNAME, A.FAILED_USERS_IMPORT, A.FAILED_VERIFICATION_EMAIL, A.FAILED_VERIFICATION_EMAIL_REQUEST, A.EMAIL_VERIFICATION_CONFIRMED, A.EMAIL_VERIFICATION_FAILED, A.MFA_AUTH_FAILED, A.MFA_AUTH_REJECTED, A.MFA_AUTH_SUCCESS, A.MFA_ENROLLMENT_COMPLETE, A.TOO_MANY_MFA_FAILURES, A.MFA_RECOVERY_FAILED, A.MFA_RECOVERY_RATE_LIMIT_EXCEED, A.MFA_RECOVERY_SUCCESS, A.MFA_EMAIL_SENT, A.EMAIL_VERIFICATION_SENT, A.EMAIL_VERIFICATION_SEND_FAILURE, A.PUSH_NOTIFICATION_SENT, A.ERROR_SENDING_MFA_PUSH_NOTIFICATION, A.MFA_SMS_SENT, A.ERROR_SENDING_MFA_SMS, A.MFA_VOICE_CALL_SUCCESS, A.MFA_VOICE_CALL_FAILED, A.SECOND_FACTOR_STARTED, A.MFA_ENROLL_STARTED, A.MFA_ENROLLMENT_FAILED, A.GUARDIAN_TENANT_UPDATE, A.UNENROLL_DEVICE_ACCOUNT, A.UPDATE_DEVICE_ACCOUNT, A.WEBAUTHN_CHALLENGE_FAILED, A.WEBAUTHN_ENROLLMENT_FAILED, A.FAILED_KMS_API_OPERATION, A.SUCCESS_KMS_API_OPERATION, A.KMS_KEY_STATE_CHANGED, A.TOO_MANY_CALLS_TO_DELEGATION, A.BLOCKED_IP_ADDRESS, A.BLOCKED_ACCOUNT_IP, A.BLOCKED_ACCOUNT_EMAIL, A.INFORMATION, A.MFA_REQUIRED, A.MANAGEMENT_API_READ_OPERATION, A.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, A.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, A.FAILED_OIDC_BACKCHANNEL_LOGOUT, A.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT, A.ORGANIZATION_MEMBER_ADDED, A.PASSKEY_CHALLENGE_FAILED, A.PASSKEY_CHALLENGE_STARTED, A.PRE_LOGIN_ASSESSMENT, A.BREACHED_PASSWORD, A.BREACHED_PASSWORD_ON_RESET, A.SUCCESS_RESOURCE_CLEANUP, A.RICH_CONSENTS_ACCESS_ERROR, A.SUCCESS_LOGIN, A.SUCCESS_API_OPERATION, A.FAILED_API_OPERATION, A.SUCCESS_CHANGE_EMAIL, A.SUCCESS_CROSS_ORIGIN_AUTHENTICATION, A.SUCCESS_CHANGE_PASSWORD, A.SUCCESS_CHANGE_PHONE_NUMBER, A.SUCCESS_CHANGE_PASSWORD_REQUEST, A.SUCCESS_CHANGE_USERNAME, A.SUCCESS_CREDENTIAL_VALIDATION, A.SUCCESS_DELEGATION, A.SUCCESS_USER_DELETION, A.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, A.SUCCESS_EXCHANGE_CUSTOM_TOKEN, A.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN, A.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, A.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, A.SUCCESS_IMPERSONATION, A.SUCCESSFULLY_ACCEPTED_USER_INVITE, A.BREACHED_PASSWORD_ON_SIGNUP, A.SUCCESS_LOGOUT, A.SUCCESS_HOOK, A.SUCCESS_PASSWORD_MIGRATION, A.SUCCESS_REVOCATION, A.SUCCESS_SIGNUP, A.FAILED_SS_SSO_OPERATION, A.INFORMATION_FROM_SS_SSO_OPERATION, A.SUCCESS_SS_SSO_OPERATION, A.SUCCESS_SILENT_AUTH, A.SUCCESSFUL_SCIM_OPERATION, A.SUCCESSFULLY_IMPORTED_USERS, A.SUCCESS_VERIFICATION_EMAIL, A.SUCCESS_VERIFICATION_EMAIL_REQUEST, A.MAX_AMOUNT_OF_AUTHENTICATORS, A.USER_LOGIN_BLOCK_RELEASED, A.FAILED_UNIVERSAL_LOGOUT, A.SUCCESSFUL_UNIVERSAL_LOGOUT, A.WARNING_DURING_LOGIN, A.WARNING_SENDING_NOTIFICATION, A.WARNING_USER_MANAGEMENT, (() => {
|
|
1611
1615
|
let e = {};
|
|
1612
|
-
for (let [t, n] of Object.entries(
|
|
1616
|
+
for (let [t, n] of Object.entries(A)) 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";
|
|
1613
1617
|
return e;
|
|
1614
1618
|
})();
|
|
1615
1619
|
var Yt = e.object({
|
|
@@ -1654,52 +1658,52 @@ var Zt = e.enum([
|
|
|
1654
1658
|
"splunk",
|
|
1655
1659
|
"datadog",
|
|
1656
1660
|
"sumo"
|
|
1657
|
-
]),
|
|
1661
|
+
]), Qt = e.enum([
|
|
1658
1662
|
"active",
|
|
1659
1663
|
"paused",
|
|
1660
1664
|
"suspended"
|
|
1661
|
-
]),
|
|
1665
|
+
]), $t = e.object({
|
|
1662
1666
|
type: e.string(),
|
|
1663
1667
|
name: e.string()
|
|
1664
1668
|
});
|
|
1665
1669
|
e.object({
|
|
1666
1670
|
name: e.string(),
|
|
1667
1671
|
type: Zt,
|
|
1668
|
-
status:
|
|
1672
|
+
status: Qt.optional(),
|
|
1669
1673
|
sink: e.record(e.string(), e.unknown()),
|
|
1670
|
-
filters: e.array(
|
|
1674
|
+
filters: e.array($t).optional(),
|
|
1671
1675
|
isPriority: e.boolean().optional()
|
|
1672
1676
|
}).extend({
|
|
1673
1677
|
id: e.string(),
|
|
1674
|
-
status:
|
|
1678
|
+
status: Qt,
|
|
1675
1679
|
created_at: e.string().optional(),
|
|
1676
1680
|
updated_at: e.string().optional()
|
|
1677
1681
|
});
|
|
1678
|
-
var
|
|
1682
|
+
var en = e.enum([
|
|
1679
1683
|
"auth0",
|
|
1680
1684
|
"cognito",
|
|
1681
1685
|
"okta",
|
|
1682
1686
|
"oidc"
|
|
1683
|
-
]),
|
|
1687
|
+
]), tn = e.object({
|
|
1684
1688
|
domain: e.string(),
|
|
1685
1689
|
client_id: e.string(),
|
|
1686
1690
|
client_secret: e.string(),
|
|
1687
1691
|
audience: e.string().optional(),
|
|
1688
1692
|
scope: e.string().optional()
|
|
1689
|
-
}),
|
|
1693
|
+
}), nn = e.object({
|
|
1690
1694
|
id: e.string().optional(),
|
|
1691
1695
|
name: e.string(),
|
|
1692
|
-
provider:
|
|
1696
|
+
provider: en,
|
|
1693
1697
|
connection: e.string(),
|
|
1694
1698
|
enabled: e.boolean().default(!0),
|
|
1695
|
-
credentials:
|
|
1699
|
+
credentials: tn
|
|
1696
1700
|
});
|
|
1697
1701
|
e.object({
|
|
1698
1702
|
id: e.string(),
|
|
1699
1703
|
created_at: e.string(),
|
|
1700
1704
|
updated_at: e.string()
|
|
1701
|
-
}).extend(
|
|
1702
|
-
var
|
|
1705
|
+
}).extend(nn.shape);
|
|
1706
|
+
var rn = e.object({
|
|
1703
1707
|
enabled: e.boolean().optional(),
|
|
1704
1708
|
shields: e.array(e.string()).optional(),
|
|
1705
1709
|
admin_notification_frequency: e.array(e.string()).optional(),
|
|
@@ -1708,13 +1712,13 @@ var nn = e.object({
|
|
|
1708
1712
|
"pre-user-registration": e.object({ shields: e.array(e.string()).optional() }).optional(),
|
|
1709
1713
|
"pre-change-password": e.object({ shields: e.array(e.string()).optional() }).optional()
|
|
1710
1714
|
}).optional()
|
|
1711
|
-
}),
|
|
1715
|
+
}), an = e.object({
|
|
1712
1716
|
enabled: e.boolean().optional(),
|
|
1713
1717
|
shields: e.array(e.string()).optional(),
|
|
1714
1718
|
allowlist: e.array(e.string()).optional(),
|
|
1715
1719
|
mode: e.string().optional(),
|
|
1716
1720
|
max_attempts: e.number().optional()
|
|
1717
|
-
}),
|
|
1721
|
+
}), on = e.object({
|
|
1718
1722
|
enabled: e.boolean().optional(),
|
|
1719
1723
|
shields: e.array(e.string()).optional(),
|
|
1720
1724
|
allowlist: e.array(e.string()).optional(),
|
|
@@ -1728,10 +1732,10 @@ var nn = e.object({
|
|
|
1728
1732
|
rate: e.number().optional()
|
|
1729
1733
|
}).optional()
|
|
1730
1734
|
}).optional()
|
|
1731
|
-
}),
|
|
1732
|
-
breached_password_detection:
|
|
1733
|
-
brute_force_protection:
|
|
1734
|
-
suspicious_ip_throttling:
|
|
1735
|
+
}), sn = e.object({
|
|
1736
|
+
breached_password_detection: rn.optional(),
|
|
1737
|
+
brute_force_protection: an.optional(),
|
|
1738
|
+
suspicious_ip_throttling: on.optional()
|
|
1735
1739
|
});
|
|
1736
1740
|
e.object({
|
|
1737
1741
|
id: e.string().optional(),
|
|
@@ -1744,14 +1748,14 @@ e.object({
|
|
|
1744
1748
|
created_at: e.string(),
|
|
1745
1749
|
updated_at: e.string()
|
|
1746
1750
|
});
|
|
1747
|
-
var
|
|
1751
|
+
var cn = e.object({
|
|
1748
1752
|
initial_user_agent: e.string().describe("First user agent of the device from which this user logged in"),
|
|
1749
1753
|
initial_ip: e.string().describe("First IP address associated with this session"),
|
|
1750
1754
|
initial_asn: e.string().describe("First autonomous system number associated with this session"),
|
|
1751
1755
|
last_user_agent: e.string().describe("Last user agent of the device from which this user logged in"),
|
|
1752
1756
|
last_ip: e.string().describe("Last IP address from which this user logged in"),
|
|
1753
1757
|
last_asn: e.string().describe("Last autonomous system number from which this user logged in")
|
|
1754
|
-
}),
|
|
1758
|
+
}), ln = e.object({
|
|
1755
1759
|
id: e.string(),
|
|
1756
1760
|
revoked_at: e.string().optional(),
|
|
1757
1761
|
used_at: e.string().optional(),
|
|
@@ -1759,7 +1763,7 @@ var j = e.object({
|
|
|
1759
1763
|
expires_at: e.string().optional(),
|
|
1760
1764
|
login_session_id: e.string(),
|
|
1761
1765
|
idle_expires_at: e.string().optional(),
|
|
1762
|
-
device:
|
|
1766
|
+
device: cn.describe("Metadata related to the device used in the session"),
|
|
1763
1767
|
clients: e.array(e.string()).describe("List of client details for the session")
|
|
1764
1768
|
});
|
|
1765
1769
|
e.object({
|
|
@@ -1767,7 +1771,7 @@ e.object({
|
|
|
1767
1771
|
updated_at: e.string(),
|
|
1768
1772
|
authenticated_at: e.string(),
|
|
1769
1773
|
last_interaction_at: e.string()
|
|
1770
|
-
}).extend(
|
|
1774
|
+
}).extend(ln.shape), e.object({
|
|
1771
1775
|
kid: e.string().openapi({ description: "The key id of the signing key" }),
|
|
1772
1776
|
tenant_id: e.string().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
|
|
1773
1777
|
cert: e.string().openapi({ description: "The public certificate of the signing key" }),
|
|
@@ -1784,7 +1788,7 @@ e.object({
|
|
|
1784
1788
|
connection: e.string().optional().openapi({ description: "The connection identifier associated with the key" }),
|
|
1785
1789
|
type: e.enum(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
|
|
1786
1790
|
});
|
|
1787
|
-
var
|
|
1791
|
+
var un = e.object({
|
|
1788
1792
|
id: e.string().optional(),
|
|
1789
1793
|
audience: e.string().optional(),
|
|
1790
1794
|
friendly_name: e.string(),
|
|
@@ -1901,7 +1905,7 @@ var cn = e.object({
|
|
|
1901
1905
|
"shared_planetscale"
|
|
1902
1906
|
]).optional(),
|
|
1903
1907
|
d1_database_id: e.string().max(64).optional(),
|
|
1904
|
-
attack_protection:
|
|
1908
|
+
attack_protection: sn.optional(),
|
|
1905
1909
|
mfa: e.object({
|
|
1906
1910
|
policy: e.enum(["never", "always"]).default("never").optional(),
|
|
1907
1911
|
factors: e.object({
|
|
@@ -1932,7 +1936,7 @@ var cn = e.object({
|
|
|
1932
1936
|
e.object({
|
|
1933
1937
|
created_at: e.string().nullable().transform((e) => e ?? ""),
|
|
1934
1938
|
updated_at: e.string().nullable().transform((e) => e ?? "")
|
|
1935
|
-
}).extend(
|
|
1939
|
+
}).extend(un.shape).extend({
|
|
1936
1940
|
id: e.string(),
|
|
1937
1941
|
is_control_plane: e.boolean().optional()
|
|
1938
1942
|
}), e.object({
|
|
@@ -1947,7 +1951,7 @@ e.object({
|
|
|
1947
1951
|
code: e.string(),
|
|
1948
1952
|
state: e.string().optional()
|
|
1949
1953
|
});
|
|
1950
|
-
var
|
|
1954
|
+
var dn = e.object({
|
|
1951
1955
|
button_border_radius: e.number(),
|
|
1952
1956
|
button_border_weight: e.number(),
|
|
1953
1957
|
buttons_style: e.enum([
|
|
@@ -1965,7 +1969,7 @@ var ln = e.object({
|
|
|
1965
1969
|
show_widget_shadow: e.boolean(),
|
|
1966
1970
|
widget_border_weight: e.number(),
|
|
1967
1971
|
widget_corner_radius: e.number()
|
|
1968
|
-
}),
|
|
1972
|
+
}), fn = e.object({
|
|
1969
1973
|
base_focus_color: e.string(),
|
|
1970
1974
|
base_hover_color: e.string(),
|
|
1971
1975
|
body_text: e.string(),
|
|
@@ -1989,20 +1993,20 @@ var ln = e.object({
|
|
|
1989
1993
|
success: e.string(),
|
|
1990
1994
|
widget_background: e.string(),
|
|
1991
1995
|
widget_border: e.string()
|
|
1992
|
-
}),
|
|
1996
|
+
}), j = e.object({
|
|
1993
1997
|
bold: e.boolean(),
|
|
1994
1998
|
size: e.number()
|
|
1995
|
-
}),
|
|
1996
|
-
body_text:
|
|
1997
|
-
buttons_text:
|
|
1999
|
+
}), pn = e.object({
|
|
2000
|
+
body_text: j,
|
|
2001
|
+
buttons_text: j,
|
|
1998
2002
|
font_url: e.string(),
|
|
1999
|
-
input_labels:
|
|
2000
|
-
links:
|
|
2003
|
+
input_labels: j,
|
|
2004
|
+
links: j,
|
|
2001
2005
|
links_style: e.enum(["normal", "underlined"]),
|
|
2002
2006
|
reference_text_size: e.number(),
|
|
2003
|
-
subtitle:
|
|
2004
|
-
title:
|
|
2005
|
-
}),
|
|
2007
|
+
subtitle: j,
|
|
2008
|
+
title: j
|
|
2009
|
+
}), mn = e.object({
|
|
2006
2010
|
background_color: e.string(),
|
|
2007
2011
|
background_image_url: e.string(),
|
|
2008
2012
|
page_layout: e.enum([
|
|
@@ -2015,7 +2019,7 @@ var ln = e.object({
|
|
|
2015
2019
|
"chip",
|
|
2016
2020
|
"none"
|
|
2017
2021
|
]).optional()
|
|
2018
|
-
}),
|
|
2022
|
+
}), hn = e.object({
|
|
2019
2023
|
header_text_alignment: e.enum([
|
|
2020
2024
|
"center",
|
|
2021
2025
|
"left",
|
|
@@ -2032,39 +2036,39 @@ var ln = e.object({
|
|
|
2032
2036
|
social_buttons_layout: e.enum(["bottom", "top"])
|
|
2033
2037
|
});
|
|
2034
2038
|
e.object({
|
|
2035
|
-
borders:
|
|
2036
|
-
colors:
|
|
2039
|
+
borders: dn,
|
|
2040
|
+
colors: fn,
|
|
2037
2041
|
displayName: e.string(),
|
|
2038
|
-
fonts:
|
|
2039
|
-
page_background:
|
|
2040
|
-
widget:
|
|
2042
|
+
fonts: pn,
|
|
2043
|
+
page_background: mn,
|
|
2044
|
+
widget: hn
|
|
2041
2045
|
}).extend({ themeId: e.string() }), e.object({
|
|
2042
2046
|
universal_login_experience: e.enum(["new", "classic"]).default("new"),
|
|
2043
2047
|
identifier_first: e.boolean().default(!0),
|
|
2044
2048
|
password_first: e.boolean().default(!1),
|
|
2045
2049
|
webauthn_platform_first_factor: e.boolean()
|
|
2046
2050
|
});
|
|
2047
|
-
var
|
|
2051
|
+
var gn = e.object({
|
|
2048
2052
|
hosts: e.array(e.string()).optional(),
|
|
2049
2053
|
methods: e.array(e.string()).optional(),
|
|
2050
2054
|
path: e.string().default("/*"),
|
|
2051
2055
|
headers: e.record(e.string(), e.string()).optional(),
|
|
2052
2056
|
query: e.record(e.string(), e.string()).optional()
|
|
2053
|
-
}),
|
|
2057
|
+
}), _n = e.object({
|
|
2054
2058
|
type: e.string(),
|
|
2055
2059
|
options: e.record(e.string(), e.unknown()).default({})
|
|
2056
|
-
}),
|
|
2060
|
+
}), M = e.object({
|
|
2057
2061
|
id: e.string().optional(),
|
|
2058
2062
|
custom_domain_id: e.string(),
|
|
2059
2063
|
priority: e.number().int().default(100),
|
|
2060
|
-
match:
|
|
2061
|
-
handlers: e.array(
|
|
2062
|
-
}),
|
|
2064
|
+
match: gn,
|
|
2065
|
+
handlers: e.array(_n).min(1)
|
|
2066
|
+
}), vn = M.extend({
|
|
2063
2067
|
id: e.string(),
|
|
2064
2068
|
tenant_id: e.string(),
|
|
2065
2069
|
created_at: e.string(),
|
|
2066
2070
|
updated_at: e.string()
|
|
2067
|
-
}),
|
|
2071
|
+
}), yn = M.partial().omit({
|
|
2068
2072
|
id: !0,
|
|
2069
2073
|
custom_domain_id: !0
|
|
2070
2074
|
});
|
|
@@ -2075,7 +2079,7 @@ e.object({
|
|
|
2075
2079
|
credentials: e.record(e.string(), e.unknown()),
|
|
2076
2080
|
settings: e.object({}).optional()
|
|
2077
2081
|
});
|
|
2078
|
-
var
|
|
2082
|
+
var bn = e.enum([
|
|
2079
2083
|
"verify_email",
|
|
2080
2084
|
"verify_email_by_code",
|
|
2081
2085
|
"reset_email",
|
|
@@ -2090,7 +2094,7 @@ var gn = e.enum([
|
|
|
2090
2094
|
"user_invitation"
|
|
2091
2095
|
]);
|
|
2092
2096
|
e.object({
|
|
2093
|
-
template:
|
|
2097
|
+
template: bn,
|
|
2094
2098
|
body: e.string(),
|
|
2095
2099
|
from: e.string(),
|
|
2096
2100
|
subject: e.string(),
|
|
@@ -2107,7 +2111,7 @@ e.object({
|
|
|
2107
2111
|
expires_at: e.string().optional(),
|
|
2108
2112
|
idle_expires_at: e.string().optional(),
|
|
2109
2113
|
last_exchanged_at: e.string().optional(),
|
|
2110
|
-
device:
|
|
2114
|
+
device: cn,
|
|
2111
2115
|
resource_servers: e.array(e.object({
|
|
2112
2116
|
audience: e.string(),
|
|
2113
2117
|
scopes: e.string()
|
|
@@ -2128,10 +2132,10 @@ e.object({
|
|
|
2128
2132
|
name: e.string(),
|
|
2129
2133
|
options: e.object({})
|
|
2130
2134
|
});
|
|
2131
|
-
var
|
|
2135
|
+
var xn = e.object({
|
|
2132
2136
|
value: e.string(),
|
|
2133
2137
|
description: e.string().optional()
|
|
2134
|
-
}),
|
|
2138
|
+
}), Sn = e.object({
|
|
2135
2139
|
token_dialect: e.enum(["access_token", "access_token_authz"]).optional(),
|
|
2136
2140
|
enforce_policies: e.boolean().optional(),
|
|
2137
2141
|
allow_skipping_userinfo: e.boolean().optional(),
|
|
@@ -2139,11 +2143,11 @@ var _n = e.object({
|
|
|
2139
2143
|
persist_client_authorization: e.boolean().optional(),
|
|
2140
2144
|
enable_introspection_endpoint: e.boolean().optional(),
|
|
2141
2145
|
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2142
|
-
}),
|
|
2146
|
+
}), Cn = e.object({
|
|
2143
2147
|
id: e.string().optional(),
|
|
2144
2148
|
name: e.string(),
|
|
2145
2149
|
identifier: e.string(),
|
|
2146
|
-
scopes: e.array(
|
|
2150
|
+
scopes: e.array(xn).optional(),
|
|
2147
2151
|
signing_alg: e.string().optional(),
|
|
2148
2152
|
signing_secret: e.string().optional(),
|
|
2149
2153
|
token_lifetime: e.number().default(86400),
|
|
@@ -2151,26 +2155,26 @@ var _n = e.object({
|
|
|
2151
2155
|
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2152
2156
|
allow_offline_access: e.boolean().optional(),
|
|
2153
2157
|
verificationKey: e.string().optional(),
|
|
2154
|
-
options:
|
|
2158
|
+
options: Sn.optional(),
|
|
2155
2159
|
is_system: e.boolean().optional(),
|
|
2156
2160
|
metadata: e.record(e.string(), e.any()).optional()
|
|
2157
2161
|
}).extend({
|
|
2158
2162
|
created_at: e.string().optional(),
|
|
2159
2163
|
updated_at: e.string().optional()
|
|
2160
2164
|
});
|
|
2161
|
-
e.array(
|
|
2162
|
-
var
|
|
2165
|
+
e.array(Cn);
|
|
2166
|
+
var wn = e.object({
|
|
2163
2167
|
role_id: e.string(),
|
|
2164
2168
|
resource_server_identifier: e.string(),
|
|
2165
2169
|
permission_name: e.string()
|
|
2166
2170
|
}).extend({ created_at: e.string() });
|
|
2167
|
-
e.array(
|
|
2171
|
+
e.array(wn), e.object({
|
|
2168
2172
|
user_id: e.string().openapi({ description: "The id of the user that granted the consent" }),
|
|
2169
2173
|
clientID: e.string().openapi({ description: "The id of the client the grant was issued to" }),
|
|
2170
2174
|
audience: e.string().optional().openapi({ description: "The audience the grant applies to" }),
|
|
2171
2175
|
scope: e.array(e.string()).default([]).openapi({ description: "The list of OAuth scopes the user has consented to" })
|
|
2172
2176
|
}).extend({ id: e.string() });
|
|
2173
|
-
var
|
|
2177
|
+
var Tn = e.object({
|
|
2174
2178
|
user_id: e.string(),
|
|
2175
2179
|
resource_server_identifier: e.string(),
|
|
2176
2180
|
permission_name: e.string(),
|
|
@@ -2179,8 +2183,8 @@ var xn = e.object({
|
|
|
2179
2183
|
tenant_id: e.string(),
|
|
2180
2184
|
created_at: e.string().optional()
|
|
2181
2185
|
});
|
|
2182
|
-
e.array(
|
|
2183
|
-
var
|
|
2186
|
+
e.array(Tn);
|
|
2187
|
+
var En = e.object({
|
|
2184
2188
|
user_id: e.string(),
|
|
2185
2189
|
resource_server_identifier: e.string(),
|
|
2186
2190
|
resource_server_name: e.string(),
|
|
@@ -2189,8 +2193,8 @@ var Sn = e.object({
|
|
|
2189
2193
|
created_at: e.string().optional(),
|
|
2190
2194
|
organization_id: e.string().optional()
|
|
2191
2195
|
});
|
|
2192
|
-
e.array(
|
|
2193
|
-
var
|
|
2196
|
+
e.array(En);
|
|
2197
|
+
var Dn = e.object({
|
|
2194
2198
|
user_id: e.string(),
|
|
2195
2199
|
role_id: e.string(),
|
|
2196
2200
|
organization_id: e.string().optional()
|
|
@@ -2198,8 +2202,8 @@ var Cn = e.object({
|
|
|
2198
2202
|
tenant_id: e.string(),
|
|
2199
2203
|
created_at: e.string().optional()
|
|
2200
2204
|
});
|
|
2201
|
-
e.array(
|
|
2202
|
-
var
|
|
2205
|
+
e.array(Dn);
|
|
2206
|
+
var On = e.object({
|
|
2203
2207
|
id: e.string().optional().openapi({ description: "The unique identifier of the role. If not provided, one will be generated." }),
|
|
2204
2208
|
name: e.string().min(1).max(50).openapi({ description: "The name of the role. Cannot include '<' or '>'" }),
|
|
2205
2209
|
description: e.string().max(255).optional().openapi({ description: "The description of the role" }),
|
|
@@ -2210,19 +2214,19 @@ var wn = e.object({
|
|
|
2210
2214
|
created_at: e.string().optional(),
|
|
2211
2215
|
updated_at: e.string().optional()
|
|
2212
2216
|
});
|
|
2213
|
-
e.array(
|
|
2214
|
-
var
|
|
2217
|
+
e.array(On);
|
|
2218
|
+
var kn = e.object({
|
|
2215
2219
|
logo_url: e.string().optional().openapi({ description: "URL of the organization's logo" }),
|
|
2216
2220
|
colors: e.object({
|
|
2217
2221
|
primary: e.string().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
2218
2222
|
page_background: e.string().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
2219
2223
|
}).optional()
|
|
2220
|
-
}).optional(),
|
|
2224
|
+
}).optional(), An = e.object({
|
|
2221
2225
|
connection_id: e.string().openapi({ description: "ID of the connection" }),
|
|
2222
2226
|
assign_membership_on_login: e.boolean().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
2223
2227
|
show_as_button: e.boolean().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
2224
2228
|
is_signup_enabled: e.boolean().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
2225
|
-
}),
|
|
2229
|
+
}), jn = e.object({ client_credentials: e.object({
|
|
2226
2230
|
enforce: e.boolean().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
2227
2231
|
per_day: e.number().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
2228
2232
|
per_hour: e.number().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
@@ -2231,15 +2235,15 @@ e.object({
|
|
|
2231
2235
|
id: e.string().optional(),
|
|
2232
2236
|
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." }),
|
|
2233
2237
|
display_name: e.string().optional().openapi({ description: "The display name of the organization" }),
|
|
2234
|
-
branding:
|
|
2238
|
+
branding: kn,
|
|
2235
2239
|
metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
2236
|
-
enabled_connections: e.array(
|
|
2237
|
-
token_quota:
|
|
2240
|
+
enabled_connections: e.array(An).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2241
|
+
token_quota: jn
|
|
2238
2242
|
}).extend(n.shape).extend({
|
|
2239
2243
|
id: e.string(),
|
|
2240
2244
|
name: e.string().min(1).openapi({ description: "The name of the organization" })
|
|
2241
2245
|
});
|
|
2242
|
-
var
|
|
2246
|
+
var Mn = e.object({
|
|
2243
2247
|
connection_id: e.string().openapi({ description: "ID of the tenant-level connection to enable for the org." }),
|
|
2244
2248
|
assign_membership_on_login: e.boolean().optional().default(!1),
|
|
2245
2249
|
show_as_button: e.boolean().optional().default(!0),
|
|
@@ -2252,7 +2256,7 @@ var On = e.object({
|
|
|
2252
2256
|
created_at: e.string().optional(),
|
|
2253
2257
|
updated_at: e.string().optional()
|
|
2254
2258
|
});
|
|
2255
|
-
e.array(
|
|
2259
|
+
e.array(Mn), e.object({
|
|
2256
2260
|
user_id: e.string().openapi({ description: "ID of the user" }),
|
|
2257
2261
|
organization_id: e.string().openapi({ description: "ID of the organization" })
|
|
2258
2262
|
}).extend(n.shape).extend({ id: e.string() }), e.object({
|
|
@@ -2385,22 +2389,22 @@ e.array(On), e.object({
|
|
|
2385
2389
|
"passwordless",
|
|
2386
2390
|
"enterprise"
|
|
2387
2391
|
]);
|
|
2388
|
-
var
|
|
2392
|
+
var Nn = e.object({
|
|
2389
2393
|
name: e.string(),
|
|
2390
2394
|
type: e.string()
|
|
2391
|
-
}),
|
|
2395
|
+
}), Pn = e.object({
|
|
2392
2396
|
elapsed: e.number(),
|
|
2393
2397
|
rows_read: e.number().optional(),
|
|
2394
2398
|
bytes_read: e.number().optional()
|
|
2395
2399
|
});
|
|
2396
2400
|
e.object({
|
|
2397
|
-
meta: e.array(
|
|
2401
|
+
meta: e.array(Nn),
|
|
2398
2402
|
data: e.array(e.record(e.string(), e.any())),
|
|
2399
2403
|
rows: e.number(),
|
|
2400
2404
|
rows_before_limit_at_least: e.number().optional(),
|
|
2401
|
-
statistics:
|
|
2405
|
+
statistics: Pn.optional()
|
|
2402
2406
|
});
|
|
2403
|
-
var
|
|
2407
|
+
var Fn = 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(".")), In = e.record(e.string(), e.record(e.string(), e.string())).openapi({
|
|
2404
2408
|
type: "object",
|
|
2405
2409
|
additionalProperties: {
|
|
2406
2410
|
type: "object",
|
|
@@ -2408,11 +2412,11 @@ var jn = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.
|
|
|
2408
2412
|
}
|
|
2409
2413
|
});
|
|
2410
2414
|
e.object({
|
|
2411
|
-
prompt:
|
|
2415
|
+
prompt: Fn,
|
|
2412
2416
|
language: e.string(),
|
|
2413
|
-
custom_text:
|
|
2417
|
+
custom_text: In
|
|
2414
2418
|
});
|
|
2415
|
-
var
|
|
2419
|
+
var Ln = e.enum([
|
|
2416
2420
|
"phone",
|
|
2417
2421
|
"totp",
|
|
2418
2422
|
"email",
|
|
@@ -2420,9 +2424,9 @@ var Nn = e.enum([
|
|
|
2420
2424
|
"webauthn-roaming",
|
|
2421
2425
|
"webauthn-platform",
|
|
2422
2426
|
"passkey"
|
|
2423
|
-
]),
|
|
2427
|
+
]), N = e.object({
|
|
2424
2428
|
user_id: e.string(),
|
|
2425
|
-
type:
|
|
2429
|
+
type: Ln,
|
|
2426
2430
|
phone_number: e.string().optional(),
|
|
2427
2431
|
totp_secret: e.string().optional(),
|
|
2428
2432
|
credential_id: e.string().optional(),
|
|
@@ -2433,7 +2437,7 @@ var Nn = e.enum([
|
|
|
2433
2437
|
friendly_name: e.string().optional(),
|
|
2434
2438
|
confirmed: e.boolean().default(!1)
|
|
2435
2439
|
});
|
|
2436
|
-
function
|
|
2440
|
+
function P(t, n) {
|
|
2437
2441
|
t.type === "phone" && !t.phone_number && n.addIssue({
|
|
2438
2442
|
code: e.ZodIssueCode.custom,
|
|
2439
2443
|
message: "phone_number is required when type is 'phone'",
|
|
@@ -2456,71 +2460,76 @@ function L(t, n) {
|
|
|
2456
2460
|
path: ["public_key"]
|
|
2457
2461
|
}));
|
|
2458
2462
|
}
|
|
2459
|
-
|
|
2463
|
+
N.superRefine(P), N.extend({
|
|
2460
2464
|
id: e.string(),
|
|
2461
2465
|
created_at: e.string(),
|
|
2462
2466
|
updated_at: e.string()
|
|
2463
|
-
}).superRefine(
|
|
2467
|
+
}).superRefine(P);
|
|
2464
2468
|
//#endregion
|
|
2465
2469
|
//#region src/data-plane/cache.ts
|
|
2466
|
-
var
|
|
2467
|
-
function
|
|
2470
|
+
var Rn = 1e4;
|
|
2471
|
+
function F(e, t, n) {
|
|
2468
2472
|
let r = typeof t == "number" ? {
|
|
2469
2473
|
freshTtlMs: t,
|
|
2470
2474
|
maxEntries: n
|
|
2471
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.negativeTtlMs ?? i,
|
|
2472
|
-
function
|
|
2473
|
-
for (let [t, n] of
|
|
2474
|
-
for (;
|
|
2475
|
-
let e =
|
|
2475
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ?? Rn, l = r.waitUntil, u = /* @__PURE__ */ new Map();
|
|
2476
|
+
function d(e) {
|
|
2477
|
+
for (let [t, n] of u) n.stale_if_error_until <= e && n.stale_until <= e && !n.refreshing && u.delete(t);
|
|
2478
|
+
for (; u.size >= c;) {
|
|
2479
|
+
let e = u.keys().next().value;
|
|
2476
2480
|
if (e === void 0) break;
|
|
2477
|
-
|
|
2481
|
+
u.delete(e);
|
|
2478
2482
|
}
|
|
2479
2483
|
}
|
|
2480
|
-
function
|
|
2481
|
-
let r = n + (t === null ?
|
|
2484
|
+
function f(e, t, n) {
|
|
2485
|
+
let r = n + (t === null ? s : i), c = t === null ? r : r + a, l = {
|
|
2482
2486
|
value: t,
|
|
2483
2487
|
fresh_until: r,
|
|
2484
|
-
stale_until:
|
|
2488
|
+
stale_until: c,
|
|
2489
|
+
stale_if_error_until: t === null ? c : c + o
|
|
2485
2490
|
};
|
|
2486
|
-
return
|
|
2491
|
+
return u.delete(e), d(n), u.set(e, l), l;
|
|
2487
2492
|
}
|
|
2488
|
-
function
|
|
2489
|
-
let n =
|
|
2493
|
+
function p(t) {
|
|
2494
|
+
let n = u.get(t);
|
|
2490
2495
|
if (n?.refreshing) return n.refreshing;
|
|
2491
2496
|
let r = n ?? {
|
|
2492
2497
|
value: null,
|
|
2493
2498
|
fresh_until: 0,
|
|
2494
|
-
stale_until: 0
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
let i = (async () => {
|
|
2499
|
+
stale_until: 0,
|
|
2500
|
+
stale_if_error_until: 0
|
|
2501
|
+
}, i = (async () => {
|
|
2498
2502
|
try {
|
|
2499
2503
|
let n = await e.resolveHost(t);
|
|
2500
|
-
return
|
|
2504
|
+
return f(t, n, Date.now()), n;
|
|
2501
2505
|
} catch (e) {
|
|
2502
|
-
let n =
|
|
2503
|
-
throw n && (n.refreshing = void 0, n.
|
|
2506
|
+
let n = u.get(t);
|
|
2507
|
+
throw n && (n.refreshing = void 0, n.stale_if_error_until <= Date.now() && u.delete(t)), e;
|
|
2504
2508
|
}
|
|
2505
2509
|
})();
|
|
2506
|
-
return r.refreshing = i, i;
|
|
2510
|
+
return r.refreshing = i, n || (d(Date.now()), u.set(t, r)), i;
|
|
2507
2511
|
}
|
|
2508
2512
|
return { async resolveHost(e) {
|
|
2509
|
-
let t = Date.now(), n =
|
|
2510
|
-
if (n && n.fresh_until > t) return
|
|
2513
|
+
let t = Date.now(), n = u.get(e);
|
|
2514
|
+
if (n && n.fresh_until > t) return u.delete(e), u.set(e, n), n.value;
|
|
2511
2515
|
if (n && n.stale_until > t) {
|
|
2512
|
-
if (
|
|
2513
|
-
let t =
|
|
2514
|
-
|
|
2516
|
+
if (u.delete(e), u.set(e, n), !n.refreshing) {
|
|
2517
|
+
let t = p(e).catch(() => void 0);
|
|
2518
|
+
l && l(t);
|
|
2515
2519
|
}
|
|
2516
2520
|
return n.value;
|
|
2517
2521
|
}
|
|
2518
|
-
|
|
2522
|
+
try {
|
|
2523
|
+
return await p(e);
|
|
2524
|
+
} catch (e) {
|
|
2525
|
+
if (n && n.stale_if_error_until > t) return n.value;
|
|
2526
|
+
throw e;
|
|
2527
|
+
}
|
|
2519
2528
|
} };
|
|
2520
2529
|
}
|
|
2521
2530
|
//#endregion
|
|
2522
2531
|
//#region src/data-plane/registry.ts
|
|
2523
|
-
var
|
|
2532
|
+
var I = class {
|
|
2524
2533
|
definitions = /* @__PURE__ */ new Map();
|
|
2525
2534
|
bindings;
|
|
2526
2535
|
constructor(e = {}) {
|
|
@@ -2540,38 +2549,38 @@ var z = class {
|
|
|
2540
2549
|
return n.build(r.data, { bindings: this.bindings });
|
|
2541
2550
|
}
|
|
2542
2551
|
};
|
|
2543
|
-
function
|
|
2552
|
+
function L(e) {
|
|
2544
2553
|
return e;
|
|
2545
2554
|
}
|
|
2546
2555
|
//#endregion
|
|
2547
2556
|
//#region src/data-plane/handlers/util.ts
|
|
2548
|
-
var
|
|
2549
|
-
function
|
|
2550
|
-
e.set(
|
|
2557
|
+
var R = "__authhero_proxy_request__", z = "__authhero_proxy_tenant_id__", B = "__authhero_proxy_custom_domain_id__", V = "__authhero_proxy_domain__", H = "x-authhero-proxy-mutability-probe";
|
|
2558
|
+
function zn(e, t) {
|
|
2559
|
+
e.set(R, t);
|
|
2551
2560
|
}
|
|
2552
|
-
function
|
|
2553
|
-
return e.get(
|
|
2561
|
+
function U(e) {
|
|
2562
|
+
return e.get(R) ?? e.req.raw;
|
|
2554
2563
|
}
|
|
2555
|
-
function
|
|
2556
|
-
e.set(
|
|
2564
|
+
function Bn(e, t) {
|
|
2565
|
+
e.set(z, t.tenant_id), e.set(B, t.custom_domain_id), e.set(V, t.domain);
|
|
2557
2566
|
}
|
|
2558
|
-
function
|
|
2559
|
-
return e.get(
|
|
2567
|
+
function Vn(e) {
|
|
2568
|
+
return e.get(z);
|
|
2560
2569
|
}
|
|
2561
|
-
function
|
|
2562
|
-
return e.get(
|
|
2570
|
+
function Hn(e) {
|
|
2571
|
+
return e.get(B);
|
|
2563
2572
|
}
|
|
2564
|
-
function
|
|
2565
|
-
return e.get(
|
|
2573
|
+
function Un(e) {
|
|
2574
|
+
return e.get(V);
|
|
2566
2575
|
}
|
|
2567
|
-
function
|
|
2568
|
-
let n =
|
|
2569
|
-
t(r),
|
|
2576
|
+
function W(e, t) {
|
|
2577
|
+
let n = U(e), r = new Headers(n.headers);
|
|
2578
|
+
t(r), zn(e, new Request(n, { headers: r }));
|
|
2570
2579
|
}
|
|
2571
|
-
function
|
|
2580
|
+
function G(e) {
|
|
2572
2581
|
let t = e.res;
|
|
2573
2582
|
try {
|
|
2574
|
-
t.headers.append(
|
|
2583
|
+
t.headers.append(H, "1"), t.headers.delete(H);
|
|
2575
2584
|
return;
|
|
2576
2585
|
} catch {
|
|
2577
2586
|
e.res = new Response(t.body, {
|
|
@@ -2583,7 +2592,7 @@ function J(e) {
|
|
|
2583
2592
|
}
|
|
2584
2593
|
//#endregion
|
|
2585
2594
|
//#region src/data-plane/handlers/cors.ts
|
|
2586
|
-
var
|
|
2595
|
+
var Wn = e.object({
|
|
2587
2596
|
origins: e.array(e.string()).optional(),
|
|
2588
2597
|
allow_credentials: e.boolean().optional(),
|
|
2589
2598
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2591,44 +2600,44 @@ var Bn = e.object({
|
|
|
2591
2600
|
expose_headers: e.array(e.string()).optional(),
|
|
2592
2601
|
max_age: e.number().int().optional()
|
|
2593
2602
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2594
|
-
function
|
|
2603
|
+
function K(e, t) {
|
|
2595
2604
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2596
2605
|
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;
|
|
2597
2606
|
}
|
|
2598
|
-
var
|
|
2607
|
+
var Gn = L({
|
|
2599
2608
|
type: "cors",
|
|
2600
|
-
optionsSchema:
|
|
2609
|
+
optionsSchema: Wn,
|
|
2601
2610
|
build(e) {
|
|
2602
2611
|
return async (t, n) => {
|
|
2603
2612
|
let r = t.req.header("origin") ?? null;
|
|
2604
2613
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2605
|
-
let t =
|
|
2614
|
+
let t = K(e, r);
|
|
2606
2615
|
return new Response(null, {
|
|
2607
2616
|
status: 204,
|
|
2608
2617
|
headers: t
|
|
2609
2618
|
});
|
|
2610
2619
|
}
|
|
2611
2620
|
await n();
|
|
2612
|
-
let i =
|
|
2613
|
-
|
|
2621
|
+
let i = K(e, r);
|
|
2622
|
+
G(t), i.forEach((e, n) => {
|
|
2614
2623
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2615
2624
|
});
|
|
2616
2625
|
};
|
|
2617
2626
|
}
|
|
2618
|
-
}),
|
|
2627
|
+
}), Kn = e.object({
|
|
2619
2628
|
username: e.string(),
|
|
2620
2629
|
password: e.string(),
|
|
2621
2630
|
realm: e.string().optional()
|
|
2622
2631
|
});
|
|
2623
|
-
function
|
|
2632
|
+
function qn(e, t) {
|
|
2624
2633
|
let n = `${e}:${t}`;
|
|
2625
2634
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2626
2635
|
}
|
|
2627
|
-
var
|
|
2636
|
+
var Jn = L({
|
|
2628
2637
|
type: "basic_auth",
|
|
2629
|
-
optionsSchema:
|
|
2638
|
+
optionsSchema: Kn,
|
|
2630
2639
|
build(e) {
|
|
2631
|
-
let t =
|
|
2640
|
+
let t = qn(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2632
2641
|
return async (e, r) => {
|
|
2633
2642
|
let i = e.req.header("authorization");
|
|
2634
2643
|
if (i) {
|
|
@@ -2644,7 +2653,7 @@ var Wn = B({
|
|
|
2644
2653
|
});
|
|
2645
2654
|
};
|
|
2646
2655
|
}
|
|
2647
|
-
}),
|
|
2656
|
+
}), Yn = L({
|
|
2648
2657
|
type: "headers",
|
|
2649
2658
|
optionsSchema: e.object({
|
|
2650
2659
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2654,23 +2663,23 @@ var Wn = B({
|
|
|
2654
2663
|
}),
|
|
2655
2664
|
build(e) {
|
|
2656
2665
|
return async (t, n) => {
|
|
2657
|
-
if ((e.request || e.remove_request) &&
|
|
2666
|
+
if ((e.request || e.remove_request) && W(t, (t) => {
|
|
2658
2667
|
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2659
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
2668
|
+
}), await n(), (e.response || e.remove_response) && (G(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);
|
|
2660
2669
|
};
|
|
2661
2670
|
}
|
|
2662
|
-
}),
|
|
2671
|
+
}), Xn = L({
|
|
2663
2672
|
type: "cache",
|
|
2664
2673
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2665
2674
|
build(e) {
|
|
2666
2675
|
return async (t, n) => {
|
|
2667
2676
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2668
2677
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2669
|
-
|
|
2678
|
+
G(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2670
2679
|
}
|
|
2671
2680
|
};
|
|
2672
2681
|
}
|
|
2673
|
-
}),
|
|
2682
|
+
}), Zn = L({
|
|
2674
2683
|
type: "forwarded_headers",
|
|
2675
2684
|
optionsSchema: e.object({
|
|
2676
2685
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -2680,40 +2689,40 @@ var Wn = B({
|
|
|
2680
2689
|
build(e) {
|
|
2681
2690
|
return async (t, n) => {
|
|
2682
2691
|
let r = new URL(t.req.url);
|
|
2683
|
-
|
|
2692
|
+
W(t, (n) => {
|
|
2684
2693
|
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);
|
|
2685
2694
|
let i = n.get(e.client_ip_header), a = (n.get("x-forwarded-for") ?? "").split(",").map((e) => e.trim()).filter(Boolean), o = i ?? a[a.length - 1] ?? "127.0.0.1", s = a.length === 0 || a[a.length - 1] !== o, c = a.length ? s ? `${a.join(", ")}, ${o}` : a.join(", ") : o;
|
|
2686
2695
|
n.set("x-forwarded-for", c), e.set_x_real_ip && n.set("x-real-ip", o);
|
|
2687
2696
|
}), await n();
|
|
2688
2697
|
};
|
|
2689
2698
|
}
|
|
2690
|
-
}),
|
|
2691
|
-
function
|
|
2699
|
+
}), Qn = e.object({ upstream_host: e.string().optional() });
|
|
2700
|
+
function $n(e) {
|
|
2692
2701
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2693
2702
|
}
|
|
2694
|
-
function
|
|
2703
|
+
function er(e) {
|
|
2695
2704
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
2696
2705
|
let t = [];
|
|
2697
2706
|
return e.forEach((e, n) => {
|
|
2698
2707
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
2699
2708
|
}), t;
|
|
2700
2709
|
}
|
|
2701
|
-
var
|
|
2710
|
+
var tr = L({
|
|
2702
2711
|
type: "rewrite_cookies",
|
|
2703
|
-
optionsSchema:
|
|
2712
|
+
optionsSchema: Qn,
|
|
2704
2713
|
build(e) {
|
|
2705
2714
|
return async (t, n) => {
|
|
2706
2715
|
await n();
|
|
2707
2716
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
2708
2717
|
if (!i) return;
|
|
2709
|
-
let a =
|
|
2718
|
+
let a = er(t.res.headers);
|
|
2710
2719
|
if (a.length === 0) return;
|
|
2711
|
-
let o =
|
|
2712
|
-
|
|
2720
|
+
let o = $n(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
2721
|
+
G(t), t.res.headers.delete("set-cookie");
|
|
2713
2722
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
2714
2723
|
};
|
|
2715
2724
|
}
|
|
2716
|
-
}),
|
|
2725
|
+
}), nr = L({
|
|
2717
2726
|
type: "rewrite_location",
|
|
2718
2727
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
2719
2728
|
build(e) {
|
|
@@ -2733,10 +2742,33 @@ var Zn = B({
|
|
|
2733
2742
|
}
|
|
2734
2743
|
if (o.origin !== a) return;
|
|
2735
2744
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
2736
|
-
|
|
2745
|
+
G(t), t.res.headers.set("location", c);
|
|
2737
2746
|
};
|
|
2738
2747
|
}
|
|
2739
|
-
}),
|
|
2748
|
+
}), rr = class extends Error {
|
|
2749
|
+
ms;
|
|
2750
|
+
constructor(e, t) {
|
|
2751
|
+
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2752
|
+
}
|
|
2753
|
+
};
|
|
2754
|
+
function q(e) {
|
|
2755
|
+
return e instanceof rr ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2756
|
+
}
|
|
2757
|
+
function J(e, t) {
|
|
2758
|
+
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
2759
|
+
return t(n.signal).finally(() => clearTimeout(r));
|
|
2760
|
+
}
|
|
2761
|
+
function Y(e, t, n) {
|
|
2762
|
+
let r, i = new Promise((e, i) => {
|
|
2763
|
+
r = setTimeout(() => i(new rr(t, n)), t);
|
|
2764
|
+
});
|
|
2765
|
+
return Promise.race([e, i]).finally(() => {
|
|
2766
|
+
r && clearTimeout(r);
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
//#endregion
|
|
2770
|
+
//#region src/data-plane/handlers/http.ts
|
|
2771
|
+
var ir = new Set([
|
|
2740
2772
|
"connection",
|
|
2741
2773
|
"keep-alive",
|
|
2742
2774
|
"proxy-authenticate",
|
|
@@ -2745,24 +2777,24 @@ var Zn = B({
|
|
|
2745
2777
|
"trailers",
|
|
2746
2778
|
"transfer-encoding",
|
|
2747
2779
|
"upgrade"
|
|
2748
|
-
]),
|
|
2780
|
+
]), ar = 3e4, or = e.object({
|
|
2749
2781
|
upstream_url: e.string(),
|
|
2750
2782
|
preserve_host: e.boolean().default(!1),
|
|
2751
2783
|
timeout_ms: e.number().int().positive().optional()
|
|
2752
2784
|
});
|
|
2753
|
-
function
|
|
2785
|
+
function sr(e, t) {
|
|
2754
2786
|
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
2755
2787
|
}
|
|
2756
|
-
function
|
|
2788
|
+
function cr(e) {
|
|
2757
2789
|
return e !== "GET" && e !== "HEAD";
|
|
2758
2790
|
}
|
|
2759
|
-
function
|
|
2791
|
+
function lr(e, t) {
|
|
2760
2792
|
let n = new URL(t.url), r = new URL(e.upstream_url);
|
|
2761
|
-
r.pathname =
|
|
2793
|
+
r.pathname = sr(r.pathname, n.pathname), r.search = n.search;
|
|
2762
2794
|
let i = new Headers(t.headers);
|
|
2763
|
-
for (let e of
|
|
2795
|
+
for (let e of ir) i.delete(e);
|
|
2764
2796
|
e.preserve_host || i.set("host", r.host), i.has("x-forwarded-host") || i.set("x-forwarded-host", n.host), i.has("x-forwarded-proto") || i.set("x-forwarded-proto", n.protocol.replace(":", ""));
|
|
2765
|
-
let a =
|
|
2797
|
+
let a = cr(t.method) ? t.body : void 0, o = {
|
|
2766
2798
|
method: t.method,
|
|
2767
2799
|
headers: i,
|
|
2768
2800
|
body: a,
|
|
@@ -2773,93 +2805,107 @@ function ir(e, t) {
|
|
|
2773
2805
|
init: o
|
|
2774
2806
|
};
|
|
2775
2807
|
}
|
|
2776
|
-
var
|
|
2808
|
+
var ur = L({
|
|
2777
2809
|
type: "http",
|
|
2778
|
-
optionsSchema:
|
|
2810
|
+
optionsSchema: or,
|
|
2779
2811
|
build(e) {
|
|
2780
|
-
let t = e.timeout_ms ??
|
|
2812
|
+
let t = e.timeout_ms ?? ar;
|
|
2781
2813
|
return async (n) => {
|
|
2782
|
-
let { target: r, init: i } =
|
|
2814
|
+
let { target: r, init: i } = lr(e, U(n));
|
|
2783
2815
|
n.set("__proxy_upstream_host__", r.hostname), n.set("__proxy_upstream_origin__", `${r.protocol}//${r.host}`);
|
|
2784
|
-
let a = new AbortController(), o = setTimeout(() => a.abort(), t);
|
|
2785
2816
|
try {
|
|
2786
|
-
return await fetch(r.toString(), {
|
|
2817
|
+
return await J(t, (e) => fetch(r.toString(), {
|
|
2787
2818
|
...i,
|
|
2788
|
-
signal:
|
|
2789
|
-
});
|
|
2819
|
+
signal: e
|
|
2820
|
+
}));
|
|
2790
2821
|
} catch (e) {
|
|
2791
|
-
|
|
2792
|
-
throw e;
|
|
2793
|
-
} finally {
|
|
2794
|
-
clearTimeout(o);
|
|
2822
|
+
return q(e) ? n.text("Upstream timeout", 504, { "x-authhero-proxy-error": "http_timeout" }) : n.text("Bad gateway", 502, { "x-authhero-proxy-error": "http_failed" });
|
|
2795
2823
|
}
|
|
2796
2824
|
};
|
|
2797
2825
|
}
|
|
2798
|
-
}),
|
|
2826
|
+
}), dr = 3e4, fr = e.object({
|
|
2799
2827
|
binding: e.string(),
|
|
2800
2828
|
upstream_url: e.string().optional(),
|
|
2801
|
-
preserve_host: e.boolean().default(!0)
|
|
2829
|
+
preserve_host: e.boolean().default(!0),
|
|
2830
|
+
timeout_ms: e.number().int().positive().optional()
|
|
2802
2831
|
});
|
|
2803
|
-
function
|
|
2832
|
+
function pr(e) {
|
|
2804
2833
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
2805
2834
|
}
|
|
2806
|
-
var
|
|
2835
|
+
var mr = L({
|
|
2807
2836
|
type: "service_binding",
|
|
2808
|
-
optionsSchema:
|
|
2837
|
+
optionsSchema: fr,
|
|
2809
2838
|
build(e, t) {
|
|
2810
2839
|
let n = t.bindings[e.binding];
|
|
2811
|
-
if (!
|
|
2812
|
-
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid
|
|
2840
|
+
if (!pr(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
2841
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ?? dr;
|
|
2813
2842
|
return async (t) => {
|
|
2814
|
-
let
|
|
2843
|
+
let a = U(t), { target: o, init: s } = lr({
|
|
2815
2844
|
upstream_url: r,
|
|
2816
2845
|
preserve_host: e.preserve_host
|
|
2817
|
-
},
|
|
2818
|
-
|
|
2846
|
+
}, a);
|
|
2847
|
+
t.set("__proxy_upstream_host__", o.hostname), t.set("__proxy_upstream_origin__", `${o.protocol}//${o.host}`);
|
|
2848
|
+
try {
|
|
2849
|
+
return await J(i, async (e) => n.fetch(new Request(o.toString(), {
|
|
2850
|
+
...s,
|
|
2851
|
+
signal: e
|
|
2852
|
+
})));
|
|
2853
|
+
} catch (e) {
|
|
2854
|
+
return q(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" });
|
|
2855
|
+
}
|
|
2819
2856
|
};
|
|
2820
2857
|
}
|
|
2821
|
-
}),
|
|
2858
|
+
}), hr = 3e4, gr = e.object({
|
|
2822
2859
|
binding: e.string(),
|
|
2823
2860
|
script_name: e.string(),
|
|
2824
2861
|
cpu_ms: e.number().int().positive().optional(),
|
|
2825
|
-
subrequests: e.number().int().positive().optional()
|
|
2862
|
+
subrequests: e.number().int().positive().optional(),
|
|
2863
|
+
timeout_ms: e.number().int().positive().optional()
|
|
2826
2864
|
});
|
|
2827
|
-
function
|
|
2865
|
+
function _r(e) {
|
|
2828
2866
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
2829
2867
|
}
|
|
2830
2868
|
var X = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
2831
|
-
function
|
|
2869
|
+
function vr(e) {
|
|
2832
2870
|
return X.lastIndex = 0, X.test(e);
|
|
2833
2871
|
}
|
|
2834
|
-
var
|
|
2872
|
+
var yr = L({
|
|
2835
2873
|
type: "dispatch_namespace",
|
|
2836
|
-
optionsSchema:
|
|
2874
|
+
optionsSchema: gr,
|
|
2837
2875
|
build(e, t) {
|
|
2838
2876
|
let n = t.bindings[e.binding];
|
|
2839
|
-
if (!
|
|
2840
|
-
let r =
|
|
2877
|
+
if (!_r(n)) throw Error(`Dispatch namespace binding "${e.binding}" is not configured or does not expose .get()`);
|
|
2878
|
+
let r = vr(e.script_name), i = e.timeout_ms ?? hr, a = e.cpu_ms || e.subrequests ? { limits: {
|
|
2841
2879
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
2842
2880
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
2843
2881
|
} } : void 0;
|
|
2844
2882
|
return async (t) => {
|
|
2845
|
-
let
|
|
2883
|
+
let o = e.script_name;
|
|
2846
2884
|
if (r) {
|
|
2847
|
-
let n =
|
|
2848
|
-
if (
|
|
2885
|
+
let n = Vn(t), r = Hn(t), i = Un(t), a = t.req.header("host") ?? t.req.header("x-forwarded-host") ?? "";
|
|
2886
|
+
if (o = o.replace(X, (e, t) => {
|
|
2849
2887
|
switch (t) {
|
|
2850
2888
|
case "tenant_id": return n ?? "";
|
|
2851
2889
|
case "custom_domain_id": return r ?? "";
|
|
2852
2890
|
case "domain": return i ?? "";
|
|
2853
|
-
case "host": return
|
|
2891
|
+
case "host": return a;
|
|
2854
2892
|
default: return "";
|
|
2855
2893
|
}
|
|
2856
|
-
}),
|
|
2894
|
+
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
2895
|
+
}
|
|
2896
|
+
let s = U(t);
|
|
2897
|
+
try {
|
|
2898
|
+
let e = n.get(o, void 0, a);
|
|
2899
|
+
return await J(i, async (t) => {
|
|
2900
|
+
let n = new Request(s, { signal: t });
|
|
2901
|
+
return e.fetch(n);
|
|
2902
|
+
});
|
|
2903
|
+
} catch (e) {
|
|
2904
|
+
return q(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" });
|
|
2857
2905
|
}
|
|
2858
|
-
let o = n.get(a, void 0, i), s = K(t);
|
|
2859
|
-
return o.fetch(s);
|
|
2860
2906
|
};
|
|
2861
2907
|
}
|
|
2862
|
-
}),
|
|
2908
|
+
}), br = L({
|
|
2863
2909
|
type: "redirect",
|
|
2864
2910
|
optionsSchema: e.object({
|
|
2865
2911
|
upstream_url: e.string().refine((e) => {
|
|
@@ -2888,7 +2934,7 @@ var fr = B({
|
|
|
2888
2934
|
});
|
|
2889
2935
|
};
|
|
2890
2936
|
}
|
|
2891
|
-
}),
|
|
2937
|
+
}), xr = L({
|
|
2892
2938
|
type: "static",
|
|
2893
2939
|
optionsSchema: e.object({
|
|
2894
2940
|
status: e.number().int().default(200),
|
|
@@ -2908,15 +2954,15 @@ var fr = B({
|
|
|
2908
2954
|
});
|
|
2909
2955
|
//#endregion
|
|
2910
2956
|
//#region src/data-plane/handlers/index.ts
|
|
2911
|
-
function
|
|
2912
|
-
e.add(
|
|
2957
|
+
function Sr(e) {
|
|
2958
|
+
e.add(Gn).add(Jn).add(Yn).add(Xn).add(Zn).add(tr).add(nr).add(ur).add(mr).add(yr).add(br).add(xr);
|
|
2913
2959
|
}
|
|
2914
2960
|
//#endregion
|
|
2915
2961
|
//#region src/data-plane/matcher.ts
|
|
2916
|
-
function
|
|
2962
|
+
function Z(e) {
|
|
2917
2963
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
2918
2964
|
}
|
|
2919
|
-
function
|
|
2965
|
+
function Cr(e, t) {
|
|
2920
2966
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
2921
2967
|
if (n === r) return !0;
|
|
2922
2968
|
if (n.startsWith("*.")) {
|
|
@@ -2925,13 +2971,13 @@ function _r(e, t) {
|
|
|
2925
2971
|
}
|
|
2926
2972
|
return !1;
|
|
2927
2973
|
}
|
|
2928
|
-
function
|
|
2929
|
-
return !e || e.length === 0 ? !0 : e.some((e) =>
|
|
2974
|
+
function wr(e, t) {
|
|
2975
|
+
return !e || e.length === 0 ? !0 : e.some((e) => Cr(e, t));
|
|
2930
2976
|
}
|
|
2931
|
-
function
|
|
2977
|
+
function Tr(e) {
|
|
2932
2978
|
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;
|
|
2933
2979
|
return async (e, i) => {
|
|
2934
|
-
if (r && !
|
|
2980
|
+
if (r && !wr(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
2935
2981
|
for (let [n, r] of t) {
|
|
2936
2982
|
let t = e.req.header(n);
|
|
2937
2983
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -2948,7 +2994,7 @@ function yr(e) {
|
|
|
2948
2994
|
}
|
|
2949
2995
|
//#endregion
|
|
2950
2996
|
//#region src/data-plane/compile.ts
|
|
2951
|
-
var
|
|
2997
|
+
var Er = [
|
|
2952
2998
|
"GET",
|
|
2953
2999
|
"POST",
|
|
2954
3000
|
"PUT",
|
|
@@ -2957,130 +3003,168 @@ var br = [
|
|
|
2957
3003
|
"OPTIONS",
|
|
2958
3004
|
"HEAD"
|
|
2959
3005
|
];
|
|
2960
|
-
function
|
|
3006
|
+
function Dr(e, n, r) {
|
|
2961
3007
|
let i = new t();
|
|
2962
3008
|
r && i.use("*", async (e, t) => {
|
|
2963
|
-
|
|
3009
|
+
Bn(e, r), await t();
|
|
2964
3010
|
});
|
|
2965
|
-
let a =
|
|
3011
|
+
let a = Z(e);
|
|
2966
3012
|
for (let e of a) {
|
|
2967
3013
|
let t = [];
|
|
2968
|
-
t.push(
|
|
3014
|
+
t.push(Tr(e.match));
|
|
2969
3015
|
for (let r of e.handlers) t.push(n.build(r.type, r.options));
|
|
2970
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3016
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : Er, a = e.match.path || "/*";
|
|
2971
3017
|
i.on(r, [a], ...t);
|
|
2972
3018
|
}
|
|
2973
|
-
return i.all("*", (e) => e.text("No matching route", 404)), i
|
|
3019
|
+
return i.all("*", (e) => e.text("No matching route", 404)), i.onError((e, t) => {
|
|
3020
|
+
let n = q(e);
|
|
3021
|
+
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3022
|
+
}), i;
|
|
2974
3023
|
}
|
|
2975
3024
|
//#endregion
|
|
2976
3025
|
//#region src/data-plane/router.ts
|
|
2977
|
-
|
|
2978
|
-
|
|
3026
|
+
var Or = 5e3;
|
|
3027
|
+
function kr(e) {
|
|
3028
|
+
return e.resolver ? e.resolver : e.cache ? F(e.data, e.cache) : F(e.data, e.cacheTtlMs ?? 3e4);
|
|
2979
3029
|
}
|
|
2980
|
-
function
|
|
3030
|
+
function Ar(e) {
|
|
2981
3031
|
if (e.registry) return e.registry;
|
|
2982
|
-
let t = new
|
|
2983
|
-
return
|
|
3032
|
+
let t = new I(e.bindings ?? {});
|
|
3033
|
+
return Sr(t), t;
|
|
2984
3034
|
}
|
|
2985
|
-
function
|
|
2986
|
-
let t =
|
|
3035
|
+
function Q(e) {
|
|
3036
|
+
let t = kr(e), n = Ar(e), r = /* @__PURE__ */ new WeakMap(), i = e.resolveHostTimeoutMs ?? Or;
|
|
2987
3037
|
return async (e) => {
|
|
2988
|
-
let
|
|
2989
|
-
if (!
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3038
|
+
let a = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3039
|
+
if (!a) return e.text("Missing host", 400);
|
|
3040
|
+
try {
|
|
3041
|
+
let o = await Y(t.resolveHost(a), i, "resolveHost");
|
|
3042
|
+
if (!o) return e.text("Unknown host", 404);
|
|
3043
|
+
let s = r.get(o);
|
|
3044
|
+
return s || (s = Dr(o.routes, n, {
|
|
3045
|
+
tenant_id: o.tenant_id,
|
|
3046
|
+
custom_domain_id: o.custom_domain_id,
|
|
3047
|
+
domain: o.domain
|
|
3048
|
+
}), r.set(o, s)), await s.fetch(e.req.raw);
|
|
3049
|
+
} catch (t) {
|
|
3050
|
+
return q(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" });
|
|
3051
|
+
}
|
|
2998
3052
|
};
|
|
2999
3053
|
}
|
|
3000
|
-
function
|
|
3054
|
+
function jr(e) {
|
|
3001
3055
|
let n = new t();
|
|
3002
|
-
return n.all("*",
|
|
3056
|
+
return n.all("*", Q(e)), n;
|
|
3003
3057
|
}
|
|
3004
3058
|
//#endregion
|
|
3005
3059
|
//#region src/app.ts
|
|
3006
|
-
function
|
|
3060
|
+
function Mr(e) {
|
|
3007
3061
|
let n = new t();
|
|
3008
|
-
return n.all("*",
|
|
3062
|
+
return n.all("*", Q({
|
|
3009
3063
|
data: e.data,
|
|
3010
3064
|
cacheTtlMs: e.cacheTtlMs,
|
|
3011
3065
|
cache: e.cache,
|
|
3012
3066
|
resolver: e.resolver,
|
|
3013
3067
|
registry: e.registry,
|
|
3014
|
-
bindings: e.bindings
|
|
3015
|
-
|
|
3068
|
+
bindings: e.bindings,
|
|
3069
|
+
resolveHostTimeoutMs: e.resolveHostTimeoutMs
|
|
3070
|
+
})), n.onError((e, t) => {
|
|
3071
|
+
let n = q(e);
|
|
3072
|
+
return t.text(n ? "Proxy timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "proxy_timeout" : "proxy_error" });
|
|
3073
|
+
}), n;
|
|
3016
3074
|
}
|
|
3017
3075
|
//#endregion
|
|
3018
3076
|
//#region src/data-plane/cache-api-cache.ts
|
|
3019
|
-
|
|
3077
|
+
var Nr = 1e3, Pr = 1e3;
|
|
3078
|
+
function Fr(e, t) {
|
|
3020
3079
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3021
3080
|
}
|
|
3022
|
-
function
|
|
3081
|
+
function Ir() {
|
|
3023
3082
|
return globalThis.caches?.default;
|
|
3024
3083
|
}
|
|
3025
|
-
function
|
|
3026
|
-
let t = e.cache ??
|
|
3084
|
+
function Lr(e) {
|
|
3085
|
+
let t = e.cache ?? Ir();
|
|
3027
3086
|
if (!t) return e.upstream;
|
|
3028
|
-
let n = e.namespace ?? "authhero-proxy",
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3087
|
+
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ?? Nr, c = e.cacheWriteTimeoutMs ?? Pr;
|
|
3088
|
+
async function l(e) {
|
|
3089
|
+
try {
|
|
3090
|
+
return await Y(Promise.resolve(n.match(e)), s, "cache.match");
|
|
3091
|
+
} catch {
|
|
3092
|
+
return;
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
return { async resolveHost(t) {
|
|
3096
|
+
let s = Fr(r, t), u = await l(s);
|
|
3097
|
+
if (u) try {
|
|
3098
|
+
return (await u.json()).value;
|
|
3033
3099
|
} catch {}
|
|
3034
|
-
let
|
|
3100
|
+
let d = await e.upstream.resolveHost(t), f = d === null ? a : i, p = new Response(JSON.stringify({ value: d }), { headers: {
|
|
3035
3101
|
"content-type": "application/json",
|
|
3036
|
-
"cache-control": `public, max-age=${
|
|
3037
|
-
} }),
|
|
3038
|
-
return
|
|
3102
|
+
"cache-control": `public, max-age=${f}`
|
|
3103
|
+
} }), m = Y(Promise.resolve(n.put(s, p)), c, "cache.put").catch(() => void 0);
|
|
3104
|
+
return o ? o(m) : await m, d;
|
|
3039
3105
|
} };
|
|
3040
3106
|
}
|
|
3041
|
-
function
|
|
3042
|
-
return
|
|
3107
|
+
function Rr(e, t) {
|
|
3108
|
+
return Fr(e, t);
|
|
3043
3109
|
}
|
|
3044
3110
|
//#endregion
|
|
3045
3111
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3112
|
+
var zr = 1e3, Br = 1e3;
|
|
3113
|
+
function Vr(e) {
|
|
3114
|
+
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 = zr, cacheWriteTimeoutMs: u = Br } = e, d = /* @__PURE__ */ new Map();
|
|
3115
|
+
function f(e) {
|
|
3116
|
+
return `${s}:${e.toLowerCase()}`;
|
|
3117
|
+
}
|
|
3118
|
+
async function p(e) {
|
|
3119
|
+
try {
|
|
3120
|
+
return await Y(n.get(e), l, "cache.get") ?? null;
|
|
3121
|
+
} catch {
|
|
3122
|
+
return null;
|
|
3123
|
+
}
|
|
3050
3124
|
}
|
|
3051
|
-
|
|
3052
|
-
let
|
|
3053
|
-
|
|
3125
|
+
function m(e, t, r) {
|
|
3126
|
+
let i = Y(Promise.resolve().then(() => n.set(e, t, r)), u, "cache.set").catch(() => void 0);
|
|
3127
|
+
return c ? (c(i), Promise.resolve()) : i;
|
|
3128
|
+
}
|
|
3129
|
+
async function h(e) {
|
|
3130
|
+
let n = d.get(e);
|
|
3131
|
+
if (n) return n;
|
|
3054
3132
|
let s = (async () => {
|
|
3055
3133
|
try {
|
|
3056
|
-
let
|
|
3057
|
-
value:
|
|
3134
|
+
let n = await t.resolveHost(e), s = Date.now(), c = n === null ? o : r, l = n === null ? 0 : i, u = n === null ? 0 : a, d = {
|
|
3135
|
+
value: n,
|
|
3058
3136
|
freshUntilMs: s + c,
|
|
3059
|
-
staleUntilMs: s + c +
|
|
3060
|
-
|
|
3061
|
-
|
|
3137
|
+
staleUntilMs: s + c + l,
|
|
3138
|
+
staleIfErrorUntilMs: s + c + l + u
|
|
3139
|
+
}, p = Math.max(1, Math.ceil((c + l + u) / 1e3));
|
|
3140
|
+
return await m(f(e), d, p), n;
|
|
3062
3141
|
} finally {
|
|
3063
|
-
|
|
3142
|
+
d.delete(e);
|
|
3064
3143
|
}
|
|
3065
3144
|
})();
|
|
3066
|
-
return
|
|
3145
|
+
return d.set(e, s), s;
|
|
3067
3146
|
}
|
|
3068
3147
|
return { async resolveHost(e) {
|
|
3069
|
-
let t =
|
|
3070
|
-
if (
|
|
3071
|
-
if (
|
|
3072
|
-
if (
|
|
3073
|
-
if (!
|
|
3074
|
-
let t =
|
|
3075
|
-
|
|
3148
|
+
let t = await p(f(e)), n = Date.now();
|
|
3149
|
+
if (t && typeof t.freshUntilMs == "number") {
|
|
3150
|
+
if (t.freshUntilMs > n) return t.value;
|
|
3151
|
+
if (t.staleUntilMs > n) {
|
|
3152
|
+
if (!d.has(e)) {
|
|
3153
|
+
let t = h(e).catch(() => void 0);
|
|
3154
|
+
c && c(t);
|
|
3076
3155
|
}
|
|
3077
|
-
return
|
|
3156
|
+
return t.value;
|
|
3078
3157
|
}
|
|
3079
3158
|
}
|
|
3080
|
-
|
|
3159
|
+
try {
|
|
3160
|
+
return await h(e);
|
|
3161
|
+
} catch (e) {
|
|
3162
|
+
if (t && (t.staleIfErrorUntilMs ?? t.staleUntilMs) > n) return t.value;
|
|
3163
|
+
throw e;
|
|
3164
|
+
}
|
|
3081
3165
|
} };
|
|
3082
3166
|
}
|
|
3083
|
-
function
|
|
3167
|
+
function Hr(e, t) {
|
|
3084
3168
|
return `${e}:${t.toLowerCase()}`;
|
|
3085
3169
|
}
|
|
3086
3170
|
//#endregion
|
|
@@ -3088,7 +3172,7 @@ function Ar(e, t) {
|
|
|
3088
3172
|
function $() {
|
|
3089
3173
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3090
3174
|
}
|
|
3091
|
-
function
|
|
3175
|
+
function Ur(e, t, n, r, i, a) {
|
|
3092
3176
|
return {
|
|
3093
3177
|
id: e.id ?? `${n}:${t}`,
|
|
3094
3178
|
tenant_id: r,
|
|
@@ -3103,10 +3187,10 @@ function jr(e, t, n, r, i, a) {
|
|
|
3103
3187
|
updated_at: e.updated_at ?? a
|
|
3104
3188
|
};
|
|
3105
3189
|
}
|
|
3106
|
-
function
|
|
3190
|
+
function Wr(e) {
|
|
3107
3191
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3108
3192
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
3109
|
-
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) =>
|
|
3193
|
+
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) => Ur(n, r, e, s, c, t)).sort((e, t) => e.priority - t.priority);
|
|
3110
3194
|
r.set(e, {
|
|
3111
3195
|
tenant_id: s,
|
|
3112
3196
|
custom_domain_id: c,
|
|
@@ -3150,7 +3234,7 @@ function Mr(e) {
|
|
|
3150
3234
|
}
|
|
3151
3235
|
};
|
|
3152
3236
|
}
|
|
3153
|
-
function
|
|
3237
|
+
function Gr(e, t = {}) {
|
|
3154
3238
|
return {
|
|
3155
3239
|
priority: t.priority,
|
|
3156
3240
|
match: { path: t.path ?? "/*" },
|
|
@@ -3165,10 +3249,10 @@ function Nr(e, t = {}) {
|
|
|
3165
3249
|
}
|
|
3166
3250
|
//#endregion
|
|
3167
3251
|
//#region src/constants.ts
|
|
3168
|
-
var
|
|
3252
|
+
var Kr = "proxy:resolve_host";
|
|
3169
3253
|
//#endregion
|
|
3170
3254
|
//#region src/http-adapter/index.ts
|
|
3171
|
-
function
|
|
3255
|
+
function qr() {
|
|
3172
3256
|
let e = () => {
|
|
3173
3257
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3174
3258
|
};
|
|
@@ -3190,7 +3274,7 @@ function Fr() {
|
|
|
3190
3274
|
}
|
|
3191
3275
|
};
|
|
3192
3276
|
}
|
|
3193
|
-
function
|
|
3277
|
+
function Jr(e) {
|
|
3194
3278
|
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 ?? 5e3;
|
|
3195
3279
|
function c(e) {
|
|
3196
3280
|
let t = new AbortController(), n = setTimeout(() => t.abort(), s);
|
|
@@ -3223,7 +3307,7 @@ function Ir(e) {
|
|
|
3223
3307
|
}), u);
|
|
3224
3308
|
}
|
|
3225
3309
|
return {
|
|
3226
|
-
proxyRoutes:
|
|
3310
|
+
proxyRoutes: qr(),
|
|
3227
3311
|
async resolveHost(e) {
|
|
3228
3312
|
let i = await f(), a = `${n}${r}${encodeURIComponent(e.toLowerCase())}`, o = await c((e) => t(a, {
|
|
3229
3313
|
headers: { authorization: `Bearer ${i}` },
|
|
@@ -3236,4 +3320,4 @@ function Ir(e) {
|
|
|
3236
3320
|
};
|
|
3237
3321
|
}
|
|
3238
3322
|
//#endregion
|
|
3239
|
-
export {
|
|
3323
|
+
export { I as HandlerRegistry, Kr as PROXY_RESOLVE_HOST_SCOPE, Jn as basicAuthHandler, Hr as buildCacheAdapterKey, Rr as buildCacheApiKey, Tr as buildMatchFilter, Xn as cacheHandler, Dr as compileHostApp, Gn as corsHandler, Vr as createCacheAdapterHostCache, Lr as createCacheApiHostCache, Jr as createHttpProxyAdapter, F as createInMemoryHostCache, Mr as createProxyApp, Q as createProxyDataPlaneHandler, jr as createProxyDataPlaneRouter, Wr as createStaticProxyAdapter, L as defineHandler, yr as dispatchNamespaceHandler, Zn as forwardedHeadersHandler, _n as handlerConfigSchema, Yn as headersHandler, ur as httpHandler, Gr as httpRoute, gn as matchSchema, wr as matchesAnyHost, Cr as matchesHost, M as proxyRouteInsertSchema, vn as proxyRouteSchema, yn as proxyRouteUpdateSchema, br as redirectHandler, Sr as registerBuiltinHandlers, tr as rewriteCookiesHandler, nr as rewriteLocationHandler, mr as serviceBindingHandler, Z as sortRoutes, xr as staticHandler };
|