@authhero/proxy 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/proxy.cjs +1 -1
- package/dist/proxy.mjs +303 -272
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/proxy.mjs
CHANGED
|
@@ -309,6 +309,7 @@ pe.extend({
|
|
|
309
309
|
provider: e.string().optional(),
|
|
310
310
|
connection: e.string(),
|
|
311
311
|
is_social: e.boolean().optional(),
|
|
312
|
+
blocked: e.boolean().optional(),
|
|
312
313
|
registration_completed_at: e.string().optional(),
|
|
313
314
|
password: e.object({
|
|
314
315
|
hash: e.string(),
|
|
@@ -827,8 +828,8 @@ var We = e.object({
|
|
|
827
828
|
strategy: e.string(),
|
|
828
829
|
options: e.preprocess((e) => e === null ? {} : v(e), Ue).default({}),
|
|
829
830
|
enabled_clients: e.array(e.string()).default([]).optional(),
|
|
830
|
-
response_type: e.
|
|
831
|
-
response_mode: e.
|
|
831
|
+
response_type: e.nativeEnum(Ie).optional(),
|
|
832
|
+
response_mode: e.nativeEnum(Le).optional(),
|
|
832
833
|
is_domain_connection: e.boolean().optional(),
|
|
833
834
|
show_as_button: e.boolean().optional(),
|
|
834
835
|
metadata: e.record(e.string(), e.any()).optional(),
|
|
@@ -839,7 +840,7 @@ e.object({
|
|
|
839
840
|
created_at: e.string().transform((e) => e === null ? "" : e),
|
|
840
841
|
updated_at: e.string().transform((e) => e === null ? "" : e)
|
|
841
842
|
}).extend(We.shape);
|
|
842
|
-
var
|
|
843
|
+
var y = e.object({
|
|
843
844
|
domain: e.string(),
|
|
844
845
|
custom_domain_id: e.string().optional(),
|
|
845
846
|
type: e.enum(["auth0_managed_certs", "self_managed_certs"]),
|
|
@@ -853,7 +854,7 @@ var Ge = e.object({
|
|
|
853
854
|
"null"
|
|
854
855
|
]).optional(),
|
|
855
856
|
domain_metadata: e.record(e.string(), e.string().max(255)).optional()
|
|
856
|
-
}),
|
|
857
|
+
}), Ge = e.discriminatedUnion("name", [e.object({
|
|
857
858
|
name: e.literal("txt"),
|
|
858
859
|
record: e.string(),
|
|
859
860
|
domain: e.string()
|
|
@@ -861,7 +862,7 @@ var Ge = e.object({
|
|
|
861
862
|
name: e.literal("http"),
|
|
862
863
|
http_body: e.string(),
|
|
863
864
|
http_url: e.string()
|
|
864
|
-
})]),
|
|
865
|
+
})]), Ke = y.extend({
|
|
865
866
|
custom_domain_id: e.string(),
|
|
866
867
|
primary: e.boolean(),
|
|
867
868
|
status: e.enum([
|
|
@@ -871,28 +872,28 @@ var Ge = e.object({
|
|
|
871
872
|
"ready"
|
|
872
873
|
]),
|
|
873
874
|
origin_domain_name: e.string().optional(),
|
|
874
|
-
verification: e.object({ methods: e.array(
|
|
875
|
+
verification: e.object({ methods: e.array(Ge) }).optional(),
|
|
875
876
|
tls_policy: e.string().optional()
|
|
876
877
|
});
|
|
877
|
-
|
|
878
|
+
y.pick({
|
|
878
879
|
tls_policy: !0,
|
|
879
880
|
custom_client_ip_header: !0,
|
|
880
881
|
domain_metadata: !0
|
|
881
|
-
}).strict(),
|
|
882
|
+
}).strict(), Ke.extend({ tenant_id: e.string() }), e.object({
|
|
882
883
|
certificate: e.string().regex(/^-----BEGIN CERTIFICATE-----[\s\S]+-----END CERTIFICATE-----\s*$/, "must be PEM-encoded; include the full certificate chain in leaf-first order"),
|
|
883
884
|
private_key: e.string().regex(/-----BEGIN (RSA |EC |ENCRYPTED )?PRIVATE KEY-----[\s\S]+-----END \1PRIVATE KEY-----\s*$/, "must be a PEM-encoded private key")
|
|
884
885
|
});
|
|
885
|
-
var
|
|
886
|
+
var b = e.object({
|
|
886
887
|
id: e.string(),
|
|
887
888
|
order: e.number().optional(),
|
|
888
889
|
visible: e.boolean().optional().default(!0)
|
|
889
|
-
}),
|
|
890
|
+
}), x = b.extend({ category: e.literal("BLOCK").optional() }), qe = x.extend({
|
|
890
891
|
type: e.literal("DIVIDER"),
|
|
891
892
|
config: e.object({ text: e.string().optional() }).optional()
|
|
892
|
-
}),
|
|
893
|
+
}), Je = x.extend({
|
|
893
894
|
type: e.literal("HTML"),
|
|
894
895
|
config: e.object({ content: e.string().optional() }).optional()
|
|
895
|
-
}),
|
|
896
|
+
}), Ye = x.extend({
|
|
896
897
|
type: e.literal("IMAGE"),
|
|
897
898
|
config: e.object({
|
|
898
899
|
src: e.string().optional(),
|
|
@@ -900,43 +901,43 @@ var y = e.object({
|
|
|
900
901
|
width: e.number().optional(),
|
|
901
902
|
height: e.number().optional()
|
|
902
903
|
}).optional()
|
|
903
|
-
}),
|
|
904
|
+
}), Xe = x.extend({
|
|
904
905
|
type: e.literal("JUMP_BUTTON"),
|
|
905
906
|
config: e.object({
|
|
906
907
|
text: e.string().optional(),
|
|
907
908
|
target_step: e.string().optional()
|
|
908
909
|
})
|
|
909
|
-
}),
|
|
910
|
+
}), Ze = x.extend({
|
|
910
911
|
type: e.literal("RESEND_BUTTON"),
|
|
911
912
|
config: e.object({
|
|
912
913
|
text: e.string().optional(),
|
|
913
914
|
resend_action: e.string().optional()
|
|
914
915
|
})
|
|
915
|
-
}),
|
|
916
|
+
}), Qe = x.extend({
|
|
916
917
|
type: e.literal("NEXT_BUTTON"),
|
|
917
918
|
config: e.object({ text: e.string().optional() })
|
|
918
|
-
}),
|
|
919
|
+
}), $e = x.extend({
|
|
919
920
|
type: e.literal("PREVIOUS_BUTTON"),
|
|
920
921
|
config: e.object({ text: e.string().optional() })
|
|
921
|
-
}),
|
|
922
|
+
}), et = x.extend({
|
|
922
923
|
type: e.literal("RICH_TEXT"),
|
|
923
924
|
config: e.object({ content: e.string().optional() }).optional()
|
|
924
|
-
}),
|
|
925
|
+
}), S = b.extend({
|
|
925
926
|
category: e.literal("WIDGET").optional(),
|
|
926
927
|
label: e.string().min(1).optional(),
|
|
927
928
|
hint: e.string().min(1).max(500).optional(),
|
|
928
929
|
required: e.boolean().optional(),
|
|
929
930
|
sensitive: e.boolean().optional()
|
|
930
|
-
}),
|
|
931
|
+
}), tt = S.extend({
|
|
931
932
|
type: e.literal("AUTH0_VERIFIABLE_CREDENTIALS"),
|
|
932
933
|
config: e.object({ credential_type: e.string().optional() })
|
|
933
|
-
}),
|
|
934
|
+
}), nt = S.extend({
|
|
934
935
|
type: e.literal("GMAPS_ADDRESS"),
|
|
935
936
|
config: e.object({ api_key: e.string().optional() })
|
|
936
|
-
}),
|
|
937
|
+
}), rt = S.extend({
|
|
937
938
|
type: e.literal("RECAPTCHA"),
|
|
938
939
|
config: e.object({ site_key: e.string().optional() })
|
|
939
|
-
}),
|
|
940
|
+
}), C = b.extend({
|
|
940
941
|
category: e.literal("FIELD").optional(),
|
|
941
942
|
label: e.string().min(1).optional(),
|
|
942
943
|
hint: e.string().min(1).max(500).optional(),
|
|
@@ -952,10 +953,10 @@ var y = e.object({
|
|
|
952
953
|
})).optional(),
|
|
953
954
|
required: e.boolean().optional(),
|
|
954
955
|
sensitive: e.boolean().optional()
|
|
955
|
-
}),
|
|
956
|
+
}), it = C.extend({
|
|
956
957
|
type: e.literal("BOOLEAN"),
|
|
957
958
|
config: e.object({ default_value: e.boolean().optional() }).optional()
|
|
958
|
-
}),
|
|
959
|
+
}), at = C.extend({
|
|
959
960
|
type: e.literal("CARDS"),
|
|
960
961
|
config: e.object({
|
|
961
962
|
options: e.array(e.object({
|
|
@@ -966,7 +967,7 @@ var y = e.object({
|
|
|
966
967
|
})).optional(),
|
|
967
968
|
multi_select: e.boolean().optional()
|
|
968
969
|
}).optional()
|
|
969
|
-
}),
|
|
970
|
+
}), ot = C.extend({
|
|
970
971
|
type: e.literal("CHOICE"),
|
|
971
972
|
config: e.object({
|
|
972
973
|
options: e.array(e.object({
|
|
@@ -977,7 +978,7 @@ var y = e.object({
|
|
|
977
978
|
multiple: e.boolean().optional(),
|
|
978
979
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
979
980
|
}).optional()
|
|
980
|
-
}),
|
|
981
|
+
}), st = C.extend({
|
|
981
982
|
type: e.literal("CODE"),
|
|
982
983
|
config: e.object({
|
|
983
984
|
length: e.number().int().positive().max(100).optional(),
|
|
@@ -994,7 +995,7 @@ var y = e.object({
|
|
|
994
995
|
message: "default_value is longer than the configured length",
|
|
995
996
|
path: ["default_value"]
|
|
996
997
|
}).optional()
|
|
997
|
-
}),
|
|
998
|
+
}), ct = C.extend({
|
|
998
999
|
type: e.literal("CUSTOM"),
|
|
999
1000
|
config: e.object({
|
|
1000
1001
|
component: e.string().optional(),
|
|
@@ -1002,7 +1003,7 @@ var y = e.object({
|
|
|
1002
1003
|
schema: e.record(e.string(), e.any()).optional(),
|
|
1003
1004
|
code: e.string().optional()
|
|
1004
1005
|
})
|
|
1005
|
-
}),
|
|
1006
|
+
}), lt = C.extend({
|
|
1006
1007
|
type: e.literal("DATE"),
|
|
1007
1008
|
config: e.object({
|
|
1008
1009
|
format: e.string().optional(),
|
|
@@ -1010,7 +1011,7 @@ var y = e.object({
|
|
|
1010
1011
|
max: e.string().optional(),
|
|
1011
1012
|
default_value: e.string().optional()
|
|
1012
1013
|
}).optional()
|
|
1013
|
-
}),
|
|
1014
|
+
}), ut = C.extend({
|
|
1014
1015
|
type: e.literal("DROPDOWN"),
|
|
1015
1016
|
config: e.object({
|
|
1016
1017
|
options: e.array(e.object({
|
|
@@ -1022,26 +1023,26 @@ var y = e.object({
|
|
|
1022
1023
|
multiple: e.boolean().optional(),
|
|
1023
1024
|
default_value: e.union([e.string(), e.array(e.string())]).optional()
|
|
1024
1025
|
}).optional()
|
|
1025
|
-
}),
|
|
1026
|
+
}), dt = C.extend({
|
|
1026
1027
|
type: e.literal("EMAIL"),
|
|
1027
1028
|
config: e.object({
|
|
1028
1029
|
placeholder: e.string().optional(),
|
|
1029
1030
|
default_value: e.string().optional()
|
|
1030
1031
|
}).optional()
|
|
1031
|
-
}),
|
|
1032
|
+
}), ft = C.extend({
|
|
1032
1033
|
type: e.literal("FILE"),
|
|
1033
1034
|
config: e.object({
|
|
1034
1035
|
accept: e.string().optional(),
|
|
1035
1036
|
max_size: e.number().optional(),
|
|
1036
1037
|
multiple: e.boolean().optional()
|
|
1037
1038
|
}).optional()
|
|
1038
|
-
}),
|
|
1039
|
+
}), pt = C.extend({
|
|
1039
1040
|
type: e.literal("LEGAL"),
|
|
1040
1041
|
config: e.object({
|
|
1041
1042
|
text: e.string(),
|
|
1042
1043
|
html: e.boolean().optional()
|
|
1043
1044
|
}).optional()
|
|
1044
|
-
}),
|
|
1045
|
+
}), mt = C.extend({
|
|
1045
1046
|
type: e.literal("NUMBER"),
|
|
1046
1047
|
config: e.object({
|
|
1047
1048
|
placeholder: e.string().optional(),
|
|
@@ -1050,7 +1051,7 @@ var y = e.object({
|
|
|
1050
1051
|
step: e.number().optional(),
|
|
1051
1052
|
default_value: e.string().optional()
|
|
1052
1053
|
}).optional()
|
|
1053
|
-
}),
|
|
1054
|
+
}), ht = C.extend({
|
|
1054
1055
|
type: e.literal("PASSWORD"),
|
|
1055
1056
|
config: e.object({
|
|
1056
1057
|
placeholder: e.string().optional(),
|
|
@@ -1059,13 +1060,13 @@ var y = e.object({
|
|
|
1059
1060
|
forgot_password_link: e.string().optional(),
|
|
1060
1061
|
default_value: e.string().optional()
|
|
1061
1062
|
}).optional()
|
|
1062
|
-
}),
|
|
1063
|
+
}), gt = C.extend({
|
|
1063
1064
|
type: e.literal("PAYMENT"),
|
|
1064
1065
|
config: e.object({
|
|
1065
1066
|
provider: e.string().optional(),
|
|
1066
1067
|
currency: e.string().optional()
|
|
1067
1068
|
}).optional()
|
|
1068
|
-
}),
|
|
1069
|
+
}), _t = C.extend({
|
|
1069
1070
|
type: e.literal("SOCIAL"),
|
|
1070
1071
|
config: e.object({
|
|
1071
1072
|
providers: e.array(e.string()).optional(),
|
|
@@ -1074,10 +1075,12 @@ var y = e.object({
|
|
|
1074
1075
|
strategy: e.string().optional(),
|
|
1075
1076
|
display_name: e.string().optional(),
|
|
1076
1077
|
icon_url: e.string().optional(),
|
|
1077
|
-
href: e.string().optional()
|
|
1078
|
+
href: e.string().optional(),
|
|
1079
|
+
last_used: e.boolean().optional(),
|
|
1080
|
+
last_used_label: e.string().optional()
|
|
1078
1081
|
})).optional()
|
|
1079
1082
|
}).optional()
|
|
1080
|
-
}),
|
|
1083
|
+
}), vt = C.extend({
|
|
1081
1084
|
type: e.literal("TEL"),
|
|
1082
1085
|
config: e.object({
|
|
1083
1086
|
placeholder: e.string().optional(),
|
|
@@ -1085,7 +1088,7 @@ var y = e.object({
|
|
|
1085
1088
|
default_value: e.string().optional(),
|
|
1086
1089
|
allow_email: e.boolean().optional()
|
|
1087
1090
|
}).optional()
|
|
1088
|
-
}),
|
|
1091
|
+
}), yt = C.extend({
|
|
1089
1092
|
type: e.literal("TEXT"),
|
|
1090
1093
|
config: e.object({
|
|
1091
1094
|
placeholder: e.string().optional(),
|
|
@@ -1093,37 +1096,38 @@ var y = e.object({
|
|
|
1093
1096
|
max_length: e.number().optional(),
|
|
1094
1097
|
default_value: e.string().optional()
|
|
1095
1098
|
}).optional()
|
|
1096
|
-
}),
|
|
1099
|
+
}), bt = C.extend({
|
|
1097
1100
|
type: e.literal("COUNTRY"),
|
|
1098
1101
|
config: e.object({
|
|
1099
1102
|
placeholder: e.string().optional(),
|
|
1100
1103
|
default_value: e.string().optional()
|
|
1101
1104
|
}).optional()
|
|
1102
|
-
}),
|
|
1105
|
+
}), xt = C.extend({
|
|
1103
1106
|
type: e.literal("URL"),
|
|
1104
1107
|
config: e.object({
|
|
1105
1108
|
placeholder: e.string().optional(),
|
|
1106
1109
|
default_value: e.string().optional()
|
|
1107
1110
|
}).optional()
|
|
1108
|
-
}),
|
|
1111
|
+
}), St = e.discriminatedUnion("type", [
|
|
1112
|
+
qe,
|
|
1109
1113
|
Je,
|
|
1110
1114
|
Ye,
|
|
1111
1115
|
Xe,
|
|
1112
1116
|
Ze,
|
|
1113
1117
|
Qe,
|
|
1114
1118
|
$e,
|
|
1115
|
-
et
|
|
1116
|
-
|
|
1117
|
-
|
|
1119
|
+
et
|
|
1120
|
+
]), Ct = e.discriminatedUnion("type", [
|
|
1121
|
+
tt,
|
|
1118
1122
|
nt,
|
|
1119
|
-
rt
|
|
1120
|
-
|
|
1121
|
-
|
|
1123
|
+
rt
|
|
1124
|
+
]), wt = e.discriminatedUnion("type", [
|
|
1125
|
+
it,
|
|
1122
1126
|
at,
|
|
1123
1127
|
ot,
|
|
1124
1128
|
st,
|
|
1129
|
+
bt,
|
|
1125
1130
|
ct,
|
|
1126
|
-
xt,
|
|
1127
1131
|
lt,
|
|
1128
1132
|
ut,
|
|
1129
1133
|
dt,
|
|
@@ -1135,12 +1139,11 @@ var y = e.object({
|
|
|
1135
1139
|
_t,
|
|
1136
1140
|
vt,
|
|
1137
1141
|
yt,
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1142
|
+
xt
|
|
1143
|
+
]), w = e.union([
|
|
1144
|
+
St,
|
|
1141
1145
|
Ct,
|
|
1142
|
-
wt
|
|
1143
|
-
Tt
|
|
1146
|
+
wt
|
|
1144
1147
|
]);
|
|
1145
1148
|
new Set([
|
|
1146
1149
|
"BOOLEAN",
|
|
@@ -1167,22 +1170,22 @@ new Set([
|
|
|
1167
1170
|
visible: e.boolean().optional().default(!0),
|
|
1168
1171
|
customizations: e.record(e.string(), e.any()).optional()
|
|
1169
1172
|
});
|
|
1170
|
-
var
|
|
1173
|
+
var T = e.object({
|
|
1171
1174
|
x: e.number(),
|
|
1172
1175
|
y: e.number()
|
|
1173
|
-
}),
|
|
1176
|
+
}), Tt = e.object({
|
|
1174
1177
|
id: e.string(),
|
|
1175
1178
|
type: e.literal("FLOW"),
|
|
1176
|
-
coordinates:
|
|
1179
|
+
coordinates: T,
|
|
1177
1180
|
alias: e.string().min(1).max(150).optional(),
|
|
1178
1181
|
config: e.object({
|
|
1179
1182
|
flow_id: e.string().max(30),
|
|
1180
1183
|
next_node: e.string().optional()
|
|
1181
1184
|
})
|
|
1182
|
-
}),
|
|
1185
|
+
}), Et = e.object({
|
|
1183
1186
|
id: e.string(),
|
|
1184
1187
|
type: e.literal("ROUTER"),
|
|
1185
|
-
coordinates:
|
|
1188
|
+
coordinates: T,
|
|
1186
1189
|
alias: e.string().min(1).max(150),
|
|
1187
1190
|
config: e.object({
|
|
1188
1191
|
rules: e.array(e.object({
|
|
@@ -1193,20 +1196,20 @@ var C = e.object({
|
|
|
1193
1196
|
})),
|
|
1194
1197
|
fallback: e.string()
|
|
1195
1198
|
})
|
|
1196
|
-
}),
|
|
1199
|
+
}), Dt = e.object({
|
|
1197
1200
|
id: e.string(),
|
|
1198
1201
|
type: e.literal("STEP"),
|
|
1199
|
-
coordinates:
|
|
1202
|
+
coordinates: T,
|
|
1200
1203
|
alias: e.string().min(1).max(150).optional(),
|
|
1201
1204
|
config: e.object({
|
|
1202
|
-
components: e.array(
|
|
1205
|
+
components: e.array(w),
|
|
1203
1206
|
next_node: e.string().optional()
|
|
1204
1207
|
})
|
|
1205
|
-
}),
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
]),
|
|
1208
|
+
}), Ot = e.discriminatedUnion("type", [
|
|
1209
|
+
Tt,
|
|
1210
|
+
Et,
|
|
1211
|
+
Dt
|
|
1212
|
+
]), kt = e.object({
|
|
1210
1213
|
name: e.string().openapi({ description: "The name of the form" }),
|
|
1211
1214
|
messages: e.object({
|
|
1212
1215
|
errors: e.record(e.string(), e.any()).optional(),
|
|
@@ -1217,14 +1220,14 @@ var C = e.object({
|
|
|
1217
1220
|
default: e.string().optional()
|
|
1218
1221
|
}).optional(),
|
|
1219
1222
|
translations: e.record(e.string(), e.any()).optional(),
|
|
1220
|
-
nodes: e.array(
|
|
1223
|
+
nodes: e.array(Ot).optional(),
|
|
1221
1224
|
start: e.object({
|
|
1222
1225
|
hidden_fields: e.array(e.object({
|
|
1223
1226
|
key: e.string(),
|
|
1224
1227
|
value: e.string()
|
|
1225
1228
|
})).optional(),
|
|
1226
1229
|
next_node: e.string().optional(),
|
|
1227
|
-
coordinates:
|
|
1230
|
+
coordinates: T.optional()
|
|
1228
1231
|
}).optional(),
|
|
1229
1232
|
ending: e.object({
|
|
1230
1233
|
redirection: e.object({
|
|
@@ -1232,7 +1235,7 @@ var C = e.object({
|
|
|
1232
1235
|
target: e.string().optional()
|
|
1233
1236
|
}).optional(),
|
|
1234
1237
|
after_submit: e.object({ flow_id: e.string().optional() }).optional(),
|
|
1235
|
-
coordinates:
|
|
1238
|
+
coordinates: T.optional(),
|
|
1236
1239
|
resume_flow: e.boolean().optional()
|
|
1237
1240
|
}).optional(),
|
|
1238
1241
|
style: e.object({ css: e.string().optional() }).optional(),
|
|
@@ -1241,8 +1244,8 @@ var C = e.object({
|
|
|
1241
1244
|
sdk_src: e.string().optional()
|
|
1242
1245
|
}).optional()
|
|
1243
1246
|
}).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
|
|
1244
|
-
n.extend(
|
|
1245
|
-
var
|
|
1247
|
+
n.extend(kt.shape).extend({ id: e.string() });
|
|
1248
|
+
var At = e.object({
|
|
1246
1249
|
id: e.number().optional(),
|
|
1247
1250
|
text: e.string(),
|
|
1248
1251
|
type: e.enum([
|
|
@@ -1251,7 +1254,7 @@ var Mt = e.object({
|
|
|
1251
1254
|
"success",
|
|
1252
1255
|
"warning"
|
|
1253
1256
|
])
|
|
1254
|
-
}),
|
|
1257
|
+
}), jt = e.object({
|
|
1255
1258
|
id: e.string().optional(),
|
|
1256
1259
|
text: e.string(),
|
|
1257
1260
|
href: e.string(),
|
|
@@ -1263,12 +1266,12 @@ e.object({
|
|
|
1263
1266
|
method: e.enum(["POST", "GET"]),
|
|
1264
1267
|
title: e.string().optional(),
|
|
1265
1268
|
description: e.string().optional(),
|
|
1266
|
-
components: e.array(
|
|
1267
|
-
messages: e.array(
|
|
1268
|
-
links: e.array(
|
|
1269
|
+
components: e.array(w),
|
|
1270
|
+
messages: e.array(At).optional(),
|
|
1271
|
+
links: e.array(jt).optional(),
|
|
1269
1272
|
footer: e.string().optional()
|
|
1270
1273
|
});
|
|
1271
|
-
var
|
|
1274
|
+
var E = e.enum([
|
|
1272
1275
|
"pre-user-registration",
|
|
1273
1276
|
"post-user-registration",
|
|
1274
1277
|
"post-user-login",
|
|
@@ -1276,24 +1279,24 @@ var Pt = e.enum([
|
|
|
1276
1279
|
"validate-registration-username",
|
|
1277
1280
|
"pre-user-deletion",
|
|
1278
1281
|
"post-user-deletion"
|
|
1279
|
-
]),
|
|
1282
|
+
]), D = e.enum([
|
|
1280
1283
|
"pre-user-registration",
|
|
1281
1284
|
"post-user-registration",
|
|
1282
1285
|
"post-user-login",
|
|
1283
1286
|
"validate-registration-username",
|
|
1284
1287
|
"pre-user-deletion",
|
|
1285
1288
|
"post-user-deletion"
|
|
1286
|
-
]),
|
|
1289
|
+
]), Mt = e.enum([
|
|
1287
1290
|
"post-user-login",
|
|
1288
1291
|
"post-user-registration",
|
|
1289
1292
|
"post-user-update",
|
|
1290
1293
|
"credentials-exchange"
|
|
1291
|
-
]),
|
|
1294
|
+
]), Nt = e.enum([
|
|
1292
1295
|
"post-user-login",
|
|
1293
1296
|
"credentials-exchange",
|
|
1294
1297
|
"pre-user-registration",
|
|
1295
1298
|
"post-user-registration"
|
|
1296
|
-
]),
|
|
1299
|
+
]), Pt = e.enum([
|
|
1297
1300
|
"ensure-username",
|
|
1298
1301
|
"set-preferred-username",
|
|
1299
1302
|
"account-linking"
|
|
@@ -1305,19 +1308,19 @@ var Pt = e.enum([
|
|
|
1305
1308
|
metadata: e.record(e.string(), e.unknown()).optional()
|
|
1306
1309
|
}, Ft = e.object({
|
|
1307
1310
|
...O,
|
|
1308
|
-
trigger_id:
|
|
1311
|
+
trigger_id: E,
|
|
1309
1312
|
url: e.string()
|
|
1310
1313
|
}), It = e.object({
|
|
1311
1314
|
...O,
|
|
1312
|
-
trigger_id:
|
|
1315
|
+
trigger_id: D,
|
|
1313
1316
|
form_id: e.string()
|
|
1314
1317
|
}), Lt = e.object({
|
|
1315
1318
|
...O,
|
|
1316
|
-
trigger_id:
|
|
1317
|
-
template_id:
|
|
1319
|
+
trigger_id: Mt,
|
|
1320
|
+
template_id: Pt
|
|
1318
1321
|
}), Rt = e.object({
|
|
1319
1322
|
...O,
|
|
1320
|
-
trigger_id:
|
|
1323
|
+
trigger_id: Nt,
|
|
1321
1324
|
code_id: e.string()
|
|
1322
1325
|
});
|
|
1323
1326
|
e.union([
|
|
@@ -1328,25 +1331,25 @@ e.union([
|
|
|
1328
1331
|
]);
|
|
1329
1332
|
var zt = e.object({
|
|
1330
1333
|
...O,
|
|
1331
|
-
trigger_id:
|
|
1334
|
+
trigger_id: E
|
|
1332
1335
|
}).extend(n.shape).extend({
|
|
1333
1336
|
hook_id: e.string(),
|
|
1334
1337
|
url: e.string()
|
|
1335
1338
|
}), Bt = e.object({
|
|
1336
1339
|
...O,
|
|
1337
|
-
trigger_id:
|
|
1340
|
+
trigger_id: D
|
|
1338
1341
|
}).extend(n.shape).extend({
|
|
1339
1342
|
hook_id: e.string(),
|
|
1340
1343
|
form_id: e.string()
|
|
1341
1344
|
}), Vt = e.object({
|
|
1342
1345
|
...O,
|
|
1343
|
-
trigger_id:
|
|
1346
|
+
trigger_id: Mt
|
|
1344
1347
|
}).extend(n.shape).extend({
|
|
1345
1348
|
hook_id: e.string(),
|
|
1346
|
-
template_id:
|
|
1349
|
+
template_id: Pt
|
|
1347
1350
|
}), Ht = e.object({
|
|
1348
1351
|
...O,
|
|
1349
|
-
trigger_id:
|
|
1352
|
+
trigger_id: Nt
|
|
1350
1353
|
}).extend(n.shape).extend({
|
|
1351
1354
|
hook_id: e.string(),
|
|
1352
1355
|
code_id: e.string()
|
|
@@ -2168,6 +2171,7 @@ e.object({
|
|
|
2168
2171
|
universal_login_experience: e.enum(["new", "classic"]).default("new"),
|
|
2169
2172
|
identifier_first: e.boolean().default(!0),
|
|
2170
2173
|
password_first: e.boolean().default(!1),
|
|
2174
|
+
show_last_used_connection: e.boolean().default(!1),
|
|
2171
2175
|
webauthn_platform_first_factor: e.boolean()
|
|
2172
2176
|
});
|
|
2173
2177
|
var wn = e.object({
|
|
@@ -2176,32 +2180,59 @@ var wn = e.object({
|
|
|
2176
2180
|
path: e.string().default("/*"),
|
|
2177
2181
|
headers: e.record(e.string(), e.string()).optional(),
|
|
2178
2182
|
query: e.record(e.string(), e.string()).optional()
|
|
2179
|
-
}),
|
|
2183
|
+
}), j = e.object({
|
|
2180
2184
|
type: e.string(),
|
|
2181
2185
|
options: e.record(e.string(), e.unknown()).default({})
|
|
2182
|
-
}),
|
|
2186
|
+
}), M = e.object({
|
|
2183
2187
|
id: e.string().optional(),
|
|
2184
2188
|
custom_domain_id: e.string(),
|
|
2185
2189
|
priority: e.number().int().default(100),
|
|
2186
2190
|
match: wn,
|
|
2187
|
-
handlers: e.array(
|
|
2188
|
-
}),
|
|
2191
|
+
handlers: e.array(j).min(1)
|
|
2192
|
+
}), Tn = M.extend({
|
|
2189
2193
|
id: e.string(),
|
|
2190
2194
|
tenant_id: e.string(),
|
|
2191
2195
|
created_at: e.string(),
|
|
2192
2196
|
updated_at: e.string()
|
|
2193
|
-
}),
|
|
2197
|
+
}), En = M.partial().omit({
|
|
2194
2198
|
id: !0,
|
|
2195
2199
|
custom_domain_id: !0
|
|
2200
|
+
}), Dn = e.object({
|
|
2201
|
+
scim: e.string(),
|
|
2202
|
+
auth0: e.string()
|
|
2203
|
+
}), On = e.object({
|
|
2204
|
+
connection_id: e.string(),
|
|
2205
|
+
user_id_attribute: e.string().default("externalId"),
|
|
2206
|
+
mapping: e.array(Dn).default([])
|
|
2207
|
+
});
|
|
2208
|
+
e.object({
|
|
2209
|
+
created_at: e.string(),
|
|
2210
|
+
updated_at: e.string()
|
|
2211
|
+
}).extend(On.shape);
|
|
2212
|
+
var kn = e.object({
|
|
2213
|
+
token_id: e.string(),
|
|
2214
|
+
connection_id: e.string(),
|
|
2215
|
+
token_hash: e.string(),
|
|
2216
|
+
scopes: e.array(e.string()).default([]),
|
|
2217
|
+
valid_until: e.string().optional()
|
|
2196
2218
|
});
|
|
2197
2219
|
e.object({
|
|
2220
|
+
created_at: e.string(),
|
|
2221
|
+
last_used_at: e.string().optional()
|
|
2222
|
+
}).extend(kn.shape);
|
|
2223
|
+
var An = e.object({
|
|
2224
|
+
connection_id: e.string(),
|
|
2225
|
+
external_id: e.string(),
|
|
2226
|
+
user_id: e.string()
|
|
2227
|
+
});
|
|
2228
|
+
e.object({ created_at: e.string() }).extend(An.shape), e.object({
|
|
2198
2229
|
name: e.string(),
|
|
2199
2230
|
enabled: e.boolean().optional().default(!0),
|
|
2200
2231
|
default_from_address: e.string().optional(),
|
|
2201
2232
|
credentials: e.record(e.string(), e.unknown()),
|
|
2202
2233
|
settings: e.object({}).optional()
|
|
2203
2234
|
});
|
|
2204
|
-
var
|
|
2235
|
+
var jn = e.enum([
|
|
2205
2236
|
"verify_email",
|
|
2206
2237
|
"verify_email_by_code",
|
|
2207
2238
|
"reset_email",
|
|
@@ -2216,7 +2247,7 @@ var On = e.enum([
|
|
|
2216
2247
|
"user_invitation"
|
|
2217
2248
|
]);
|
|
2218
2249
|
e.object({
|
|
2219
|
-
template:
|
|
2250
|
+
template: jn,
|
|
2220
2251
|
body: e.string(),
|
|
2221
2252
|
from: e.string(),
|
|
2222
2253
|
subject: e.string(),
|
|
@@ -2254,10 +2285,10 @@ e.object({
|
|
|
2254
2285
|
name: e.string(),
|
|
2255
2286
|
options: e.object({})
|
|
2256
2287
|
});
|
|
2257
|
-
var
|
|
2288
|
+
var Mn = e.object({
|
|
2258
2289
|
value: e.string(),
|
|
2259
2290
|
description: e.string().optional()
|
|
2260
|
-
}),
|
|
2291
|
+
}), Nn = e.object({
|
|
2261
2292
|
token_dialect: e.enum(["access_token", "access_token_authz"]).optional(),
|
|
2262
2293
|
enforce_policies: e.boolean().optional(),
|
|
2263
2294
|
allow_skipping_userinfo: e.boolean().optional(),
|
|
@@ -2265,11 +2296,11 @@ var kn = e.object({
|
|
|
2265
2296
|
persist_client_authorization: e.boolean().optional(),
|
|
2266
2297
|
enable_introspection_endpoint: e.boolean().optional(),
|
|
2267
2298
|
mtls: e.object({ bound_access_tokens: e.boolean().optional() }).optional()
|
|
2268
|
-
}),
|
|
2299
|
+
}), Pn = e.object({
|
|
2269
2300
|
id: e.string().optional(),
|
|
2270
2301
|
name: e.string(),
|
|
2271
2302
|
identifier: e.string(),
|
|
2272
|
-
scopes: e.array(
|
|
2303
|
+
scopes: e.array(Mn).optional(),
|
|
2273
2304
|
signing_alg: e.string().optional(),
|
|
2274
2305
|
signing_secret: e.string().optional(),
|
|
2275
2306
|
token_lifetime: e.number().default(86400),
|
|
@@ -2277,20 +2308,20 @@ var kn = e.object({
|
|
|
2277
2308
|
skip_consent_for_verifiable_first_party_clients: e.boolean().optional(),
|
|
2278
2309
|
allow_offline_access: e.boolean().optional(),
|
|
2279
2310
|
verificationKey: e.string().optional(),
|
|
2280
|
-
options:
|
|
2311
|
+
options: Nn.optional(),
|
|
2281
2312
|
is_system: e.boolean().optional(),
|
|
2282
2313
|
metadata: e.record(e.string(), e.any()).optional()
|
|
2283
2314
|
}).extend({
|
|
2284
2315
|
created_at: e.string().optional(),
|
|
2285
2316
|
updated_at: e.string().optional()
|
|
2286
2317
|
});
|
|
2287
|
-
e.array(
|
|
2288
|
-
var
|
|
2318
|
+
e.array(Pn);
|
|
2319
|
+
var Fn = e.object({
|
|
2289
2320
|
role_id: e.string(),
|
|
2290
2321
|
resource_server_identifier: e.string(),
|
|
2291
2322
|
permission_name: e.string()
|
|
2292
2323
|
}).extend({ created_at: e.string() });
|
|
2293
|
-
e.array(
|
|
2324
|
+
e.array(Fn), e.object({
|
|
2294
2325
|
user_id: e.string().openapi({ description: "The id of the user that granted the consent" }),
|
|
2295
2326
|
clientID: e.string().openapi({ description: "The id of the client the grant was issued to" }),
|
|
2296
2327
|
audience: e.string().optional().openapi({ description: "The audience the grant applies to" }),
|
|
@@ -2303,7 +2334,7 @@ e.array(Mn), e.object({
|
|
|
2303
2334
|
failed_logins: e.array(e.string()).optional(),
|
|
2304
2335
|
last_password_reset: e.string().optional()
|
|
2305
2336
|
});
|
|
2306
|
-
var
|
|
2337
|
+
var In = e.object({
|
|
2307
2338
|
user_id: e.string(),
|
|
2308
2339
|
resource_server_identifier: e.string(),
|
|
2309
2340
|
permission_name: e.string(),
|
|
@@ -2312,8 +2343,8 @@ var Nn = e.object({
|
|
|
2312
2343
|
tenant_id: e.string(),
|
|
2313
2344
|
created_at: e.string().optional()
|
|
2314
2345
|
});
|
|
2315
|
-
e.array(
|
|
2316
|
-
var
|
|
2346
|
+
e.array(In);
|
|
2347
|
+
var Ln = e.object({
|
|
2317
2348
|
user_id: e.string(),
|
|
2318
2349
|
resource_server_identifier: e.string(),
|
|
2319
2350
|
resource_server_name: e.string(),
|
|
@@ -2322,8 +2353,8 @@ var Pn = e.object({
|
|
|
2322
2353
|
created_at: e.string().optional(),
|
|
2323
2354
|
organization_id: e.string().optional()
|
|
2324
2355
|
});
|
|
2325
|
-
e.array(
|
|
2326
|
-
var
|
|
2356
|
+
e.array(Ln);
|
|
2357
|
+
var Rn = e.object({
|
|
2327
2358
|
user_id: e.string(),
|
|
2328
2359
|
role_id: e.string(),
|
|
2329
2360
|
organization_id: e.string().optional()
|
|
@@ -2331,8 +2362,8 @@ var Fn = e.object({
|
|
|
2331
2362
|
tenant_id: e.string(),
|
|
2332
2363
|
created_at: e.string().optional()
|
|
2333
2364
|
});
|
|
2334
|
-
e.array(
|
|
2335
|
-
var
|
|
2365
|
+
e.array(Rn);
|
|
2366
|
+
var zn = e.object({
|
|
2336
2367
|
id: e.string().optional().openapi({ description: "The unique identifier of the role. If not provided, one will be generated." }),
|
|
2337
2368
|
name: e.string().min(1).max(50).openapi({ description: "The name of the role. Cannot include '<' or '>'" }),
|
|
2338
2369
|
description: e.string().max(255).optional().openapi({ description: "The description of the role" }),
|
|
@@ -2343,19 +2374,19 @@ var In = e.object({
|
|
|
2343
2374
|
created_at: e.string().optional(),
|
|
2344
2375
|
updated_at: e.string().optional()
|
|
2345
2376
|
});
|
|
2346
|
-
e.array(
|
|
2347
|
-
var
|
|
2377
|
+
e.array(zn);
|
|
2378
|
+
var Bn = e.object({
|
|
2348
2379
|
logo_url: e.string().optional().openapi({ description: "URL of the organization's logo" }),
|
|
2349
2380
|
colors: e.object({
|
|
2350
2381
|
primary: e.string().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
2351
2382
|
page_background: e.string().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
2352
2383
|
}).optional()
|
|
2353
|
-
}).optional(),
|
|
2384
|
+
}).optional(), Vn = e.object({
|
|
2354
2385
|
connection_id: e.string().openapi({ description: "ID of the connection" }),
|
|
2355
2386
|
assign_membership_on_login: e.boolean().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
2356
2387
|
show_as_button: e.boolean().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
2357
2388
|
is_signup_enabled: e.boolean().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
2358
|
-
}),
|
|
2389
|
+
}), Hn = e.object({ client_credentials: e.object({
|
|
2359
2390
|
enforce: e.boolean().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
2360
2391
|
per_day: e.number().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
2361
2392
|
per_hour: e.number().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
@@ -2364,15 +2395,15 @@ e.object({
|
|
|
2364
2395
|
id: e.string().optional(),
|
|
2365
2396
|
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." }),
|
|
2366
2397
|
display_name: e.string().optional().openapi({ description: "The display name of the organization" }),
|
|
2367
|
-
branding:
|
|
2398
|
+
branding: Bn,
|
|
2368
2399
|
metadata: e.record(e.string(), e.any()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
2369
|
-
enabled_connections: e.array(
|
|
2370
|
-
token_quota:
|
|
2400
|
+
enabled_connections: e.array(Vn).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
2401
|
+
token_quota: Hn
|
|
2371
2402
|
}).extend(n.shape).extend({
|
|
2372
2403
|
id: e.string(),
|
|
2373
2404
|
name: e.string().min(1).openapi({ description: "The name of the organization" })
|
|
2374
2405
|
});
|
|
2375
|
-
var
|
|
2406
|
+
var Un = e.object({
|
|
2376
2407
|
connection_id: e.string().openapi({ description: "ID of the tenant-level connection to enable for the org." }),
|
|
2377
2408
|
assign_membership_on_login: e.boolean().optional().default(!1),
|
|
2378
2409
|
show_as_button: e.boolean().optional().default(!0),
|
|
@@ -2385,7 +2416,7 @@ var Bn = e.object({
|
|
|
2385
2416
|
created_at: e.string().optional(),
|
|
2386
2417
|
updated_at: e.string().optional()
|
|
2387
2418
|
});
|
|
2388
|
-
e.array(
|
|
2419
|
+
e.array(Un), e.object({
|
|
2389
2420
|
user_id: e.string().openapi({ description: "ID of the user" }),
|
|
2390
2421
|
organization_id: e.string().openapi({ description: "ID of the organization" })
|
|
2391
2422
|
}).extend(n.shape).extend({ id: e.string() }), e.object({
|
|
@@ -2524,22 +2555,22 @@ e.array(Bn), e.object({
|
|
|
2524
2555
|
"passwordless",
|
|
2525
2556
|
"enterprise"
|
|
2526
2557
|
]);
|
|
2527
|
-
var
|
|
2558
|
+
var Wn = e.object({
|
|
2528
2559
|
name: e.string(),
|
|
2529
2560
|
type: e.string()
|
|
2530
|
-
}),
|
|
2561
|
+
}), Gn = e.object({
|
|
2531
2562
|
elapsed: e.number(),
|
|
2532
2563
|
rows_read: e.number().optional(),
|
|
2533
2564
|
bytes_read: e.number().optional()
|
|
2534
2565
|
});
|
|
2535
2566
|
e.object({
|
|
2536
|
-
meta: e.array(
|
|
2567
|
+
meta: e.array(Wn),
|
|
2537
2568
|
data: e.array(e.record(e.string(), e.any())),
|
|
2538
2569
|
rows: e.number(),
|
|
2539
2570
|
rows_before_limit_at_least: e.number().optional(),
|
|
2540
|
-
statistics:
|
|
2571
|
+
statistics: Gn.optional()
|
|
2541
2572
|
});
|
|
2542
|
-
var
|
|
2573
|
+
var Kn = 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(".")), qn = e.record(e.string(), e.record(e.string(), e.string())).openapi({
|
|
2543
2574
|
type: "object",
|
|
2544
2575
|
additionalProperties: {
|
|
2545
2576
|
type: "object",
|
|
@@ -2547,11 +2578,11 @@ var Un = e.enum(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.
|
|
|
2547
2578
|
}
|
|
2548
2579
|
});
|
|
2549
2580
|
e.object({
|
|
2550
|
-
prompt:
|
|
2581
|
+
prompt: Kn,
|
|
2551
2582
|
language: e.string(),
|
|
2552
|
-
custom_text:
|
|
2583
|
+
custom_text: qn
|
|
2553
2584
|
});
|
|
2554
|
-
var
|
|
2585
|
+
var Jn = e.enum([
|
|
2555
2586
|
"phone",
|
|
2556
2587
|
"totp",
|
|
2557
2588
|
"email",
|
|
@@ -2559,9 +2590,9 @@ var Gn = e.enum([
|
|
|
2559
2590
|
"webauthn-roaming",
|
|
2560
2591
|
"webauthn-platform",
|
|
2561
2592
|
"passkey"
|
|
2562
|
-
]),
|
|
2593
|
+
]), N = e.object({
|
|
2563
2594
|
user_id: e.string(),
|
|
2564
|
-
type:
|
|
2595
|
+
type: Jn,
|
|
2565
2596
|
phone_number: e.string().optional(),
|
|
2566
2597
|
totp_secret: e.string().optional(),
|
|
2567
2598
|
credential_id: e.string().optional(),
|
|
@@ -2572,7 +2603,7 @@ var Gn = e.enum([
|
|
|
2572
2603
|
friendly_name: e.string().optional(),
|
|
2573
2604
|
confirmed: e.boolean().default(!1)
|
|
2574
2605
|
});
|
|
2575
|
-
function
|
|
2606
|
+
function P(t, n) {
|
|
2576
2607
|
t.type === "phone" && !t.phone_number && n.addIssue({
|
|
2577
2608
|
code: e.ZodIssueCode.custom,
|
|
2578
2609
|
message: "phone_number is required when type is 'phone'",
|
|
@@ -2595,23 +2626,23 @@ function N(t, n) {
|
|
|
2595
2626
|
path: ["public_key"]
|
|
2596
2627
|
}));
|
|
2597
2628
|
}
|
|
2598
|
-
|
|
2629
|
+
N.superRefine(P), N.extend({
|
|
2599
2630
|
id: e.string(),
|
|
2600
2631
|
created_at: e.string(),
|
|
2601
2632
|
updated_at: e.string()
|
|
2602
|
-
}).superRefine(
|
|
2633
|
+
}).superRefine(P), e.object({
|
|
2603
2634
|
id: e.string().optional(),
|
|
2604
2635
|
created_at: e.string().datetime({ offset: !0 }).optional(),
|
|
2605
2636
|
updated_at: e.string().datetime({ offset: !0 }).optional()
|
|
2606
2637
|
});
|
|
2607
2638
|
//#endregion
|
|
2608
2639
|
//#region src/data-plane/cache.ts
|
|
2609
|
-
var
|
|
2610
|
-
function
|
|
2640
|
+
var Yn = 1e4;
|
|
2641
|
+
function F(e, t, n) {
|
|
2611
2642
|
let r = typeof t == "number" ? {
|
|
2612
2643
|
freshTtlMs: t,
|
|
2613
2644
|
maxEntries: n
|
|
2614
|
-
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ??
|
|
2645
|
+
} : t, i = r.freshTtlMs, a = r.staleTtlMs ?? 0, o = r.staleIfErrorTtlMs ?? 0, s = r.negativeTtlMs ?? i, c = r.maxEntries ?? Yn, l = r.waitUntil, u = /* @__PURE__ */ new Map();
|
|
2615
2646
|
function d(e) {
|
|
2616
2647
|
for (let [t, n] of u) n.stale_if_error_until <= e && n.stale_until <= e && !n.refreshing && u.delete(t);
|
|
2617
2648
|
for (; u.size >= c;) {
|
|
@@ -2668,7 +2699,7 @@ function P(e, t, n) {
|
|
|
2668
2699
|
}
|
|
2669
2700
|
//#endregion
|
|
2670
2701
|
//#region src/data-plane/registry.ts
|
|
2671
|
-
var
|
|
2702
|
+
var I = class {
|
|
2672
2703
|
definitions = /* @__PURE__ */ new Map();
|
|
2673
2704
|
bindings;
|
|
2674
2705
|
constructor(e = {}) {
|
|
@@ -2688,38 +2719,38 @@ var F = class {
|
|
|
2688
2719
|
return n.build(r.data, { bindings: this.bindings });
|
|
2689
2720
|
}
|
|
2690
2721
|
};
|
|
2691
|
-
function
|
|
2722
|
+
function L(e) {
|
|
2692
2723
|
return e;
|
|
2693
2724
|
}
|
|
2694
2725
|
//#endregion
|
|
2695
2726
|
//#region src/data-plane/handlers/util.ts
|
|
2696
|
-
var
|
|
2697
|
-
function
|
|
2698
|
-
e.set(
|
|
2727
|
+
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";
|
|
2728
|
+
function Xn(e, t) {
|
|
2729
|
+
e.set(R, t);
|
|
2699
2730
|
}
|
|
2700
|
-
function
|
|
2701
|
-
return e.get(
|
|
2731
|
+
function U(e) {
|
|
2732
|
+
return e.get(R) ?? e.req.raw;
|
|
2702
2733
|
}
|
|
2703
|
-
function
|
|
2704
|
-
e.set(
|
|
2734
|
+
function Zn(e, t) {
|
|
2735
|
+
e.set(z, t.tenant_id), e.set(B, t.custom_domain_id), e.set(V, t.domain);
|
|
2705
2736
|
}
|
|
2706
|
-
function
|
|
2707
|
-
return e.get(R);
|
|
2708
|
-
}
|
|
2709
|
-
function Xn(e) {
|
|
2737
|
+
function Qn(e) {
|
|
2710
2738
|
return e.get(z);
|
|
2711
2739
|
}
|
|
2712
|
-
function
|
|
2740
|
+
function $n(e) {
|
|
2713
2741
|
return e.get(B);
|
|
2714
2742
|
}
|
|
2715
|
-
function
|
|
2716
|
-
|
|
2717
|
-
|
|
2743
|
+
function er(e) {
|
|
2744
|
+
return e.get(V);
|
|
2745
|
+
}
|
|
2746
|
+
function W(e, t) {
|
|
2747
|
+
let n = U(e), r = new Headers(n.headers);
|
|
2748
|
+
t(r), Xn(e, new Request(n, { headers: r }));
|
|
2718
2749
|
}
|
|
2719
|
-
function
|
|
2750
|
+
function G(e) {
|
|
2720
2751
|
let t = e.res;
|
|
2721
2752
|
try {
|
|
2722
|
-
t.headers.append(
|
|
2753
|
+
t.headers.append(H, "1"), t.headers.delete(H);
|
|
2723
2754
|
return;
|
|
2724
2755
|
} catch {
|
|
2725
2756
|
e.res = new Response(t.body, {
|
|
@@ -2731,7 +2762,7 @@ function W(e) {
|
|
|
2731
2762
|
}
|
|
2732
2763
|
//#endregion
|
|
2733
2764
|
//#region src/data-plane/handlers/cors.ts
|
|
2734
|
-
var
|
|
2765
|
+
var tr = e.object({
|
|
2735
2766
|
origins: e.array(e.string()).optional(),
|
|
2736
2767
|
allow_credentials: e.boolean().optional(),
|
|
2737
2768
|
allow_headers: e.array(e.string()).optional(),
|
|
@@ -2739,44 +2770,44 @@ var Qn = e.object({
|
|
|
2739
2770
|
expose_headers: e.array(e.string()).optional(),
|
|
2740
2771
|
max_age: e.number().int().optional()
|
|
2741
2772
|
}).refine((e) => !(e.allow_credentials && e.origins?.includes("*")), { message: "Cannot use wildcard origin (*) with allow_credentials" });
|
|
2742
|
-
function
|
|
2773
|
+
function nr(e, t) {
|
|
2743
2774
|
let n = new Headers(), r = e.origins ?? ["*"], i = r.includes("*");
|
|
2744
2775
|
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;
|
|
2745
2776
|
}
|
|
2746
|
-
var
|
|
2777
|
+
var rr = L({
|
|
2747
2778
|
type: "cors",
|
|
2748
|
-
optionsSchema:
|
|
2779
|
+
optionsSchema: tr,
|
|
2749
2780
|
build(e) {
|
|
2750
2781
|
return async (t, n) => {
|
|
2751
2782
|
let r = t.req.header("origin") ?? null;
|
|
2752
2783
|
if (t.req.method === "OPTIONS" && r !== null && t.req.header("access-control-request-method") !== void 0) {
|
|
2753
|
-
let t =
|
|
2784
|
+
let t = nr(e, r);
|
|
2754
2785
|
return new Response(null, {
|
|
2755
2786
|
status: 204,
|
|
2756
2787
|
headers: t
|
|
2757
2788
|
});
|
|
2758
2789
|
}
|
|
2759
2790
|
await n();
|
|
2760
|
-
let i =
|
|
2761
|
-
|
|
2791
|
+
let i = nr(e, r);
|
|
2792
|
+
G(t), i.forEach((e, n) => {
|
|
2762
2793
|
n.toLowerCase() === "vary" ? t.res.headers.append(n, e) : t.res.headers.set(n, e);
|
|
2763
2794
|
});
|
|
2764
2795
|
};
|
|
2765
2796
|
}
|
|
2766
|
-
}),
|
|
2797
|
+
}), ir = e.object({
|
|
2767
2798
|
username: e.string(),
|
|
2768
2799
|
password: e.string(),
|
|
2769
2800
|
realm: e.string().optional()
|
|
2770
2801
|
});
|
|
2771
|
-
function
|
|
2802
|
+
function ar(e, t) {
|
|
2772
2803
|
let n = `${e}:${t}`;
|
|
2773
2804
|
return typeof btoa == "function" ? btoa(n) : Buffer.from(n, "utf-8").toString("base64");
|
|
2774
2805
|
}
|
|
2775
|
-
var
|
|
2806
|
+
var or = L({
|
|
2776
2807
|
type: "basic_auth",
|
|
2777
|
-
optionsSchema:
|
|
2808
|
+
optionsSchema: ir,
|
|
2778
2809
|
build(e) {
|
|
2779
|
-
let t =
|
|
2810
|
+
let t = ar(e.username, e.password), n = (e.realm ?? "Restricted").replace(/["\\\r\n]/g, "");
|
|
2780
2811
|
return async (e, r) => {
|
|
2781
2812
|
let i = e.req.header("authorization");
|
|
2782
2813
|
if (i) {
|
|
@@ -2792,7 +2823,7 @@ var nr = I({
|
|
|
2792
2823
|
});
|
|
2793
2824
|
};
|
|
2794
2825
|
}
|
|
2795
|
-
}),
|
|
2826
|
+
}), sr = L({
|
|
2796
2827
|
type: "headers",
|
|
2797
2828
|
optionsSchema: e.object({
|
|
2798
2829
|
request: e.record(e.string(), e.string()).optional(),
|
|
@@ -2802,23 +2833,23 @@ var nr = I({
|
|
|
2802
2833
|
}),
|
|
2803
2834
|
build(e) {
|
|
2804
2835
|
return async (t, n) => {
|
|
2805
|
-
if ((e.request || e.remove_request) &&
|
|
2836
|
+
if ((e.request || e.remove_request) && W(t, (t) => {
|
|
2806
2837
|
if (e.remove_request?.forEach((e) => t.delete(e)), e.request) for (let [n, r] of Object.entries(e.request)) t.set(n, r);
|
|
2807
|
-
}), await n(), (e.response || e.remove_response) && (
|
|
2838
|
+
}), 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);
|
|
2808
2839
|
};
|
|
2809
2840
|
}
|
|
2810
|
-
}),
|
|
2841
|
+
}), cr = L({
|
|
2811
2842
|
type: "cache",
|
|
2812
2843
|
optionsSchema: e.object({ ttl_seconds: e.number().int().positive() }),
|
|
2813
2844
|
build(e) {
|
|
2814
2845
|
return async (t, n) => {
|
|
2815
2846
|
if (await n(), !t.res.headers.has("Cache-Control")) {
|
|
2816
2847
|
let n = t.res.headers.has("set-cookie") ? "private" : "public";
|
|
2817
|
-
|
|
2848
|
+
G(t), t.res.headers.set("Cache-Control", `${n}, max-age=${e.ttl_seconds}`);
|
|
2818
2849
|
}
|
|
2819
2850
|
};
|
|
2820
2851
|
}
|
|
2821
|
-
}),
|
|
2852
|
+
}), lr = L({
|
|
2822
2853
|
type: "forwarded_headers",
|
|
2823
2854
|
optionsSchema: e.object({
|
|
2824
2855
|
client_ip_header: e.string().default("cf-connecting-ip"),
|
|
@@ -2828,40 +2859,40 @@ var nr = I({
|
|
|
2828
2859
|
build(e) {
|
|
2829
2860
|
return async (t, n) => {
|
|
2830
2861
|
let r = new URL(t.req.url);
|
|
2831
|
-
|
|
2862
|
+
W(t, (n) => {
|
|
2832
2863
|
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);
|
|
2833
2864
|
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;
|
|
2834
2865
|
n.set("x-forwarded-for", c), e.set_x_real_ip && n.set("x-real-ip", o);
|
|
2835
2866
|
}), await n();
|
|
2836
2867
|
};
|
|
2837
2868
|
}
|
|
2838
|
-
}),
|
|
2839
|
-
function
|
|
2869
|
+
}), ur = e.object({ upstream_host: e.string().optional() });
|
|
2870
|
+
function dr(e) {
|
|
2840
2871
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2841
2872
|
}
|
|
2842
|
-
function
|
|
2873
|
+
function fr(e) {
|
|
2843
2874
|
if (typeof e.getSetCookie == "function") return e.getSetCookie();
|
|
2844
2875
|
let t = [];
|
|
2845
2876
|
return e.forEach((e, n) => {
|
|
2846
2877
|
n.toLowerCase() === "set-cookie" && t.push(e);
|
|
2847
2878
|
}), t;
|
|
2848
2879
|
}
|
|
2849
|
-
var
|
|
2880
|
+
var pr = L({
|
|
2850
2881
|
type: "rewrite_cookies",
|
|
2851
|
-
optionsSchema:
|
|
2882
|
+
optionsSchema: ur,
|
|
2852
2883
|
build(e) {
|
|
2853
2884
|
return async (t, n) => {
|
|
2854
2885
|
await n();
|
|
2855
2886
|
let r = new URL(t.req.url).hostname, i = e.upstream_host ?? t.get("__proxy_upstream_host__");
|
|
2856
2887
|
if (!i) return;
|
|
2857
|
-
let a =
|
|
2888
|
+
let a = fr(t.res.headers);
|
|
2858
2889
|
if (a.length === 0) return;
|
|
2859
|
-
let o =
|
|
2860
|
-
|
|
2890
|
+
let o = dr(i), s = RegExp(`(?:^|;\\s*)Domain=\\.?${o}(?=;|$)`, "i");
|
|
2891
|
+
G(t), t.res.headers.delete("set-cookie");
|
|
2861
2892
|
for (let e of a) t.res.headers.append("set-cookie", e.replace(s, `Domain=${r}`));
|
|
2862
2893
|
};
|
|
2863
2894
|
}
|
|
2864
|
-
}),
|
|
2895
|
+
}), mr = L({
|
|
2865
2896
|
type: "rewrite_location",
|
|
2866
2897
|
optionsSchema: e.object({ upstream_origin: e.string().optional() }),
|
|
2867
2898
|
build(e) {
|
|
@@ -2881,17 +2912,17 @@ var lr = I({
|
|
|
2881
2912
|
}
|
|
2882
2913
|
if (o.origin !== a) return;
|
|
2883
2914
|
let s = new URL(t.req.url), c = `${`${s.protocol}//${s.host}`}${o.pathname}${o.search}${o.hash}`;
|
|
2884
|
-
|
|
2915
|
+
G(t), t.res.headers.set("location", c);
|
|
2885
2916
|
};
|
|
2886
2917
|
}
|
|
2887
|
-
}),
|
|
2918
|
+
}), hr = class extends Error {
|
|
2888
2919
|
ms;
|
|
2889
2920
|
constructor(e, t) {
|
|
2890
2921
|
super(`${t ?? "Operation"} timed out after ${e}ms`), this.name = "TimeoutError", this.ms = e;
|
|
2891
2922
|
}
|
|
2892
2923
|
};
|
|
2893
2924
|
function K(e) {
|
|
2894
|
-
return e instanceof
|
|
2925
|
+
return e instanceof hr ? !0 : e instanceof Error ? e.name === "AbortError" || e.name === "TimeoutError" : !1;
|
|
2895
2926
|
}
|
|
2896
2927
|
function q(e, t) {
|
|
2897
2928
|
let n = new AbortController(), r = setTimeout(() => n.abort(), e);
|
|
@@ -2899,7 +2930,7 @@ function q(e, t) {
|
|
|
2899
2930
|
}
|
|
2900
2931
|
function J(e, t, n) {
|
|
2901
2932
|
let r, i = new Promise((e, i) => {
|
|
2902
|
-
r = setTimeout(() => i(new
|
|
2933
|
+
r = setTimeout(() => i(new hr(t, n)), t);
|
|
2903
2934
|
});
|
|
2904
2935
|
return Promise.race([e, i]).finally(() => {
|
|
2905
2936
|
r && clearTimeout(r);
|
|
@@ -2907,7 +2938,7 @@ function J(e, t, n) {
|
|
|
2907
2938
|
}
|
|
2908
2939
|
//#endregion
|
|
2909
2940
|
//#region src/data-plane/handlers/http.ts
|
|
2910
|
-
var
|
|
2941
|
+
var gr = new Set([
|
|
2911
2942
|
"connection",
|
|
2912
2943
|
"keep-alive",
|
|
2913
2944
|
"proxy-authenticate",
|
|
@@ -2916,24 +2947,24 @@ var fr = new Set([
|
|
|
2916
2947
|
"trailers",
|
|
2917
2948
|
"transfer-encoding",
|
|
2918
2949
|
"upgrade"
|
|
2919
|
-
]),
|
|
2950
|
+
]), _r = 3e4, vr = e.object({
|
|
2920
2951
|
upstream_url: e.string(),
|
|
2921
2952
|
preserve_host: e.boolean().default(!1),
|
|
2922
2953
|
timeout_ms: e.number().int().positive().optional()
|
|
2923
2954
|
});
|
|
2924
|
-
function
|
|
2955
|
+
function yr(e, t) {
|
|
2925
2956
|
return e === "" || e === "/" ? t : `${e.endsWith("/") ? e.slice(0, -1) : e}${t.startsWith("/") ? t : `/${t}`}`;
|
|
2926
2957
|
}
|
|
2927
|
-
function
|
|
2958
|
+
function br(e) {
|
|
2928
2959
|
return e !== "GET" && e !== "HEAD";
|
|
2929
2960
|
}
|
|
2930
|
-
function
|
|
2961
|
+
function xr(e, t) {
|
|
2931
2962
|
let n = new URL(t.url), r = new URL(e.upstream_url);
|
|
2932
|
-
r.pathname =
|
|
2963
|
+
r.pathname = yr(r.pathname, n.pathname), r.search = n.search;
|
|
2933
2964
|
let i = new Headers(t.headers);
|
|
2934
|
-
for (let e of
|
|
2965
|
+
for (let e of gr) i.delete(e);
|
|
2935
2966
|
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(":", ""));
|
|
2936
|
-
let a =
|
|
2967
|
+
let a = br(t.method) ? t.body : void 0, o = {
|
|
2937
2968
|
method: t.method,
|
|
2938
2969
|
headers: i,
|
|
2939
2970
|
body: a,
|
|
@@ -2944,13 +2975,13 @@ function _r(e, t) {
|
|
|
2944
2975
|
init: o
|
|
2945
2976
|
};
|
|
2946
2977
|
}
|
|
2947
|
-
var
|
|
2978
|
+
var Sr = L({
|
|
2948
2979
|
type: "http",
|
|
2949
|
-
optionsSchema:
|
|
2980
|
+
optionsSchema: vr,
|
|
2950
2981
|
build(e) {
|
|
2951
|
-
let t = e.timeout_ms ??
|
|
2982
|
+
let t = e.timeout_ms ?? _r;
|
|
2952
2983
|
return async (n) => {
|
|
2953
|
-
let { target: r, init: i } =
|
|
2984
|
+
let { target: r, init: i } = xr(e, U(n));
|
|
2954
2985
|
n.set("__proxy_upstream_host__", r.hostname), n.set("__proxy_upstream_origin__", `${r.protocol}//${r.host}`);
|
|
2955
2986
|
try {
|
|
2956
2987
|
return await q(t, (e) => fetch(r.toString(), {
|
|
@@ -2962,24 +2993,24 @@ var vr = I({
|
|
|
2962
2993
|
}
|
|
2963
2994
|
};
|
|
2964
2995
|
}
|
|
2965
|
-
}),
|
|
2996
|
+
}), Cr = 3e4, wr = e.object({
|
|
2966
2997
|
binding: e.string(),
|
|
2967
2998
|
upstream_url: e.string().optional(),
|
|
2968
2999
|
preserve_host: e.boolean().default(!0),
|
|
2969
3000
|
timeout_ms: e.number().int().positive().optional()
|
|
2970
3001
|
});
|
|
2971
|
-
function
|
|
3002
|
+
function Tr(e) {
|
|
2972
3003
|
return typeof e == "object" && !!e && typeof e.fetch == "function";
|
|
2973
3004
|
}
|
|
2974
|
-
var
|
|
3005
|
+
var Er = L({
|
|
2975
3006
|
type: "service_binding",
|
|
2976
|
-
optionsSchema:
|
|
3007
|
+
optionsSchema: wr,
|
|
2977
3008
|
build(e, t) {
|
|
2978
3009
|
let n = t.bindings[e.binding];
|
|
2979
|
-
if (!
|
|
2980
|
-
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ??
|
|
3010
|
+
if (!Tr(n)) throw Error(`Service binding "${e.binding}" is not configured or is not a Fetcher`);
|
|
3011
|
+
let r = e.upstream_url ?? `https://${e.binding}.binding.invalid/`, i = e.timeout_ms ?? Cr;
|
|
2981
3012
|
return async (t) => {
|
|
2982
|
-
let a =
|
|
3013
|
+
let a = U(t), { target: o, init: s } = xr({
|
|
2983
3014
|
upstream_url: r,
|
|
2984
3015
|
preserve_host: e.preserve_host
|
|
2985
3016
|
}, a);
|
|
@@ -2994,34 +3025,34 @@ var Sr = I({
|
|
|
2994
3025
|
}
|
|
2995
3026
|
};
|
|
2996
3027
|
}
|
|
2997
|
-
}),
|
|
3028
|
+
}), Dr = 3e4, Or = e.object({
|
|
2998
3029
|
binding: e.string(),
|
|
2999
3030
|
script_name: e.string(),
|
|
3000
3031
|
cpu_ms: e.number().int().positive().optional(),
|
|
3001
3032
|
subrequests: e.number().int().positive().optional(),
|
|
3002
3033
|
timeout_ms: e.number().int().positive().optional()
|
|
3003
3034
|
});
|
|
3004
|
-
function
|
|
3035
|
+
function kr(e) {
|
|
3005
3036
|
return typeof e == "object" && !!e && typeof e.get == "function";
|
|
3006
3037
|
}
|
|
3007
3038
|
var Y = /\{(tenant_id|custom_domain_id|domain|host)\}/g;
|
|
3008
|
-
function
|
|
3039
|
+
function Ar(e) {
|
|
3009
3040
|
return Y.lastIndex = 0, Y.test(e);
|
|
3010
3041
|
}
|
|
3011
|
-
var
|
|
3042
|
+
var jr = L({
|
|
3012
3043
|
type: "dispatch_namespace",
|
|
3013
|
-
optionsSchema:
|
|
3044
|
+
optionsSchema: Or,
|
|
3014
3045
|
build(e, t) {
|
|
3015
3046
|
let n = t.bindings[e.binding];
|
|
3016
|
-
if (!
|
|
3017
|
-
let r =
|
|
3047
|
+
if (!kr(n)) throw Error(`Dispatch namespace binding "${e.binding}" is not configured or does not expose .get()`);
|
|
3048
|
+
let r = Ar(e.script_name), i = e.timeout_ms ?? Dr, a = e.cpu_ms || e.subrequests ? { limits: {
|
|
3018
3049
|
...e.cpu_ms ? { cpuMs: e.cpu_ms } : {},
|
|
3019
3050
|
...e.subrequests ? { subrequests: e.subrequests } : {}
|
|
3020
3051
|
} } : void 0;
|
|
3021
3052
|
return async (t) => {
|
|
3022
3053
|
let o = e.script_name;
|
|
3023
3054
|
if (r) {
|
|
3024
|
-
let n =
|
|
3055
|
+
let n = Qn(t), r = $n(t), i = er(t), a = t.req.header("host") ?? t.req.header("x-forwarded-host") ?? "";
|
|
3025
3056
|
if (o = o.replace(Y, (e, t) => {
|
|
3026
3057
|
switch (t) {
|
|
3027
3058
|
case "tenant_id": return n ?? "";
|
|
@@ -3032,7 +3063,7 @@ var Dr = I({
|
|
|
3032
3063
|
}
|
|
3033
3064
|
}), o.includes("{") || o === "") return t.text(`dispatch_namespace: could not resolve script name from template "${e.script_name}"`, 500);
|
|
3034
3065
|
}
|
|
3035
|
-
let s =
|
|
3066
|
+
let s = U(t);
|
|
3036
3067
|
try {
|
|
3037
3068
|
let e = n.get(o, void 0, a);
|
|
3038
3069
|
return await q(i, async (t) => {
|
|
@@ -3044,7 +3075,7 @@ var Dr = I({
|
|
|
3044
3075
|
}
|
|
3045
3076
|
};
|
|
3046
3077
|
}
|
|
3047
|
-
}),
|
|
3078
|
+
}), Mr = L({
|
|
3048
3079
|
type: "redirect",
|
|
3049
3080
|
optionsSchema: e.object({
|
|
3050
3081
|
upstream_url: e.string().refine((e) => {
|
|
@@ -3073,7 +3104,7 @@ var Dr = I({
|
|
|
3073
3104
|
});
|
|
3074
3105
|
};
|
|
3075
3106
|
}
|
|
3076
|
-
}),
|
|
3107
|
+
}), X = L({
|
|
3077
3108
|
type: "static",
|
|
3078
3109
|
optionsSchema: e.object({
|
|
3079
3110
|
status: e.number().int().default(200),
|
|
@@ -3093,15 +3124,15 @@ var Dr = I({
|
|
|
3093
3124
|
});
|
|
3094
3125
|
//#endregion
|
|
3095
3126
|
//#region src/data-plane/handlers/index.ts
|
|
3096
|
-
function
|
|
3097
|
-
e.add(
|
|
3127
|
+
function Nr(e) {
|
|
3128
|
+
e.add(rr).add(or).add(sr).add(cr).add(lr).add(pr).add(mr).add(Sr).add(Er).add(jr).add(Mr).add(X);
|
|
3098
3129
|
}
|
|
3099
3130
|
//#endregion
|
|
3100
3131
|
//#region src/data-plane/matcher.ts
|
|
3101
|
-
function
|
|
3132
|
+
function Pr(e) {
|
|
3102
3133
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
3103
3134
|
}
|
|
3104
|
-
function
|
|
3135
|
+
function Fr(e, t) {
|
|
3105
3136
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
3106
3137
|
if (n === r) return !0;
|
|
3107
3138
|
if (n.startsWith("*.")) {
|
|
@@ -3110,13 +3141,13 @@ function jr(e, t) {
|
|
|
3110
3141
|
}
|
|
3111
3142
|
return !1;
|
|
3112
3143
|
}
|
|
3113
|
-
function
|
|
3114
|
-
return !e || e.length === 0 ? !0 : e.some((e) =>
|
|
3144
|
+
function Ir(e, t) {
|
|
3145
|
+
return !e || e.length === 0 ? !0 : e.some((e) => Fr(e, t));
|
|
3115
3146
|
}
|
|
3116
|
-
function
|
|
3147
|
+
function Lr(e) {
|
|
3117
3148
|
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;
|
|
3118
3149
|
return async (e, i) => {
|
|
3119
|
-
if (r && !
|
|
3150
|
+
if (r && !Ir(r, e.req.header("host") ?? "")) return new Response("No matching route", { status: 404 });
|
|
3120
3151
|
for (let [n, r] of t) {
|
|
3121
3152
|
let t = e.req.header(n);
|
|
3122
3153
|
if (t === void 0 || !r.test(t)) return new Response("No matching route", { status: 404 });
|
|
@@ -3133,7 +3164,7 @@ function Nr(e) {
|
|
|
3133
3164
|
}
|
|
3134
3165
|
//#endregion
|
|
3135
3166
|
//#region src/data-plane/compile.ts
|
|
3136
|
-
var
|
|
3167
|
+
var Rr = [
|
|
3137
3168
|
"GET",
|
|
3138
3169
|
"POST",
|
|
3139
3170
|
"PUT",
|
|
@@ -3145,34 +3176,34 @@ var Pr = [
|
|
|
3145
3176
|
function Z(e, n, r, i) {
|
|
3146
3177
|
let a = new t();
|
|
3147
3178
|
r && a.use("*", async (e, t) => {
|
|
3148
|
-
|
|
3179
|
+
Zn(e, r), await t();
|
|
3149
3180
|
});
|
|
3150
|
-
let o =
|
|
3181
|
+
let o = Pr(e);
|
|
3151
3182
|
for (let e of o) {
|
|
3152
3183
|
let t = [];
|
|
3153
|
-
t.push(
|
|
3184
|
+
t.push(Lr(e.match));
|
|
3154
3185
|
for (let r of e.handlers) t.push(n.build(r.type, r.options));
|
|
3155
|
-
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) :
|
|
3186
|
+
let r = e.match.methods?.length ? e.match.methods.map((e) => e.toUpperCase()) : Rr, i = e.match.path || "/*";
|
|
3156
3187
|
a.on(r, [i], ...t);
|
|
3157
3188
|
}
|
|
3158
|
-
return i && i.length > 0 ? a.on(
|
|
3189
|
+
return i && i.length > 0 ? a.on(Rr, ["*"], ...i) : a.all("*", (e) => e.text("No matching route", 404)), a.onError((e, t) => {
|
|
3159
3190
|
let n = K(e);
|
|
3160
3191
|
return t.text(n ? "Upstream timeout" : "Bad gateway", n ? 504 : 502, { "x-authhero-proxy-error": n ? "handler_timeout" : "handler_failed" });
|
|
3161
3192
|
}), a;
|
|
3162
3193
|
}
|
|
3163
3194
|
//#endregion
|
|
3164
3195
|
//#region src/data-plane/router.ts
|
|
3165
|
-
var
|
|
3166
|
-
function
|
|
3167
|
-
return e.resolver ? e.resolver : e.cache ?
|
|
3196
|
+
var zr = 1e4;
|
|
3197
|
+
function Br(e) {
|
|
3198
|
+
return e.resolver ? e.resolver : e.cache ? F(e.data, e.cache) : F(e.data, e.cacheTtlMs ?? 3e4);
|
|
3168
3199
|
}
|
|
3169
|
-
function
|
|
3200
|
+
function Vr(e) {
|
|
3170
3201
|
if (e.registry) return e.registry;
|
|
3171
|
-
let t = new
|
|
3172
|
-
return
|
|
3202
|
+
let t = new I(e.bindings ?? {});
|
|
3203
|
+
return Nr(t), t;
|
|
3173
3204
|
}
|
|
3174
3205
|
function Q(e) {
|
|
3175
|
-
let t =
|
|
3206
|
+
let t = Br(e), n = Vr(e), r = /* @__PURE__ */ new WeakMap(), i = e.resolveHostTimeoutMs ?? zr, a = e.defaultHandlers && e.defaultHandlers.length > 0 ? e.defaultHandlers.map((e) => n.build(e.type, e.options)) : void 0, o = a ? Z([], n, void 0, a) : void 0;
|
|
3176
3207
|
return async (e) => {
|
|
3177
3208
|
let s = e.req.header("host") ?? e.req.header("x-forwarded-host");
|
|
3178
3209
|
if (!s) return e.text("Missing host", 400);
|
|
@@ -3190,13 +3221,13 @@ function Q(e) {
|
|
|
3190
3221
|
}
|
|
3191
3222
|
};
|
|
3192
3223
|
}
|
|
3193
|
-
function
|
|
3224
|
+
function Hr(e) {
|
|
3194
3225
|
let n = new t();
|
|
3195
3226
|
return n.all("*", Q(e)), n;
|
|
3196
3227
|
}
|
|
3197
3228
|
//#endregion
|
|
3198
3229
|
//#region src/app.ts
|
|
3199
|
-
function
|
|
3230
|
+
function Ur(e) {
|
|
3200
3231
|
let n = new t();
|
|
3201
3232
|
return n.all("*", Q({
|
|
3202
3233
|
data: e.data,
|
|
@@ -3214,17 +3245,17 @@ function zr(e) {
|
|
|
3214
3245
|
}
|
|
3215
3246
|
//#endregion
|
|
3216
3247
|
//#region src/data-plane/cache-api-cache.ts
|
|
3217
|
-
var
|
|
3218
|
-
function
|
|
3248
|
+
var Wr = 1e3, Gr = 1e3;
|
|
3249
|
+
function Kr(e, t) {
|
|
3219
3250
|
return new Request(`https://proxy-cache.internal/${encodeURIComponent(e)}/hosts/${encodeURIComponent(t.toLowerCase())}`, { method: "GET" });
|
|
3220
3251
|
}
|
|
3221
|
-
function
|
|
3252
|
+
function qr() {
|
|
3222
3253
|
return globalThis.caches?.default;
|
|
3223
3254
|
}
|
|
3224
|
-
function
|
|
3225
|
-
let t = e.cache ??
|
|
3255
|
+
function Jr(e) {
|
|
3256
|
+
let t = e.cache ?? qr();
|
|
3226
3257
|
if (!t) return e.upstream;
|
|
3227
|
-
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ??
|
|
3258
|
+
let n = t, r = e.namespace ?? "authhero-proxy", i = e.cacheTtlSeconds ?? 60, a = e.negativeCacheTtlSeconds ?? 10, o = e.waitUntil, s = e.cacheReadTimeoutMs ?? Wr, c = e.cacheWriteTimeoutMs ?? Gr;
|
|
3228
3259
|
async function l(e) {
|
|
3229
3260
|
try {
|
|
3230
3261
|
return await J(Promise.resolve(n.match(e)), s, "cache.match");
|
|
@@ -3233,7 +3264,7 @@ function Wr(e) {
|
|
|
3233
3264
|
}
|
|
3234
3265
|
}
|
|
3235
3266
|
return { async resolveHost(t) {
|
|
3236
|
-
let s =
|
|
3267
|
+
let s = Kr(r, t), u = await l(s);
|
|
3237
3268
|
if (u) try {
|
|
3238
3269
|
return (await u.json()).value;
|
|
3239
3270
|
} catch {}
|
|
@@ -3244,14 +3275,14 @@ function Wr(e) {
|
|
|
3244
3275
|
return o ? o(m) : await m, d;
|
|
3245
3276
|
} };
|
|
3246
3277
|
}
|
|
3247
|
-
function
|
|
3248
|
-
return
|
|
3278
|
+
function Yr(e, t) {
|
|
3279
|
+
return Kr(e, t);
|
|
3249
3280
|
}
|
|
3250
3281
|
//#endregion
|
|
3251
3282
|
//#region src/data-plane/cache-adapter-cache.ts
|
|
3252
|
-
var
|
|
3253
|
-
function
|
|
3254
|
-
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 =
|
|
3283
|
+
var Xr = 1e3, Zr = 1e3;
|
|
3284
|
+
function Qr(e) {
|
|
3285
|
+
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 = Xr, cacheWriteTimeoutMs: u = Zr } = e, d = /* @__PURE__ */ new Map();
|
|
3255
3286
|
function f(e) {
|
|
3256
3287
|
return `${s}:${e.toLowerCase()}`;
|
|
3257
3288
|
}
|
|
@@ -3304,7 +3335,7 @@ function Jr(e) {
|
|
|
3304
3335
|
}
|
|
3305
3336
|
} };
|
|
3306
3337
|
}
|
|
3307
|
-
function
|
|
3338
|
+
function $r(e, t) {
|
|
3308
3339
|
return `${e}:${t.toLowerCase()}`;
|
|
3309
3340
|
}
|
|
3310
3341
|
//#endregion
|
|
@@ -3312,7 +3343,7 @@ function Yr(e, t) {
|
|
|
3312
3343
|
function $() {
|
|
3313
3344
|
throw Error("Static proxy adapter is read-only; configure routes at init time");
|
|
3314
3345
|
}
|
|
3315
|
-
function
|
|
3346
|
+
function ei(e, t, n, r, i, a) {
|
|
3316
3347
|
return {
|
|
3317
3348
|
id: e.id ?? `${n}:${t}`,
|
|
3318
3349
|
tenant_id: r,
|
|
@@ -3327,10 +3358,10 @@ function Xr(e, t, n, r, i, a) {
|
|
|
3327
3358
|
updated_at: e.updated_at ?? a
|
|
3328
3359
|
};
|
|
3329
3360
|
}
|
|
3330
|
-
function
|
|
3361
|
+
function ti(e) {
|
|
3331
3362
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = e.defaultTenantId ?? "static", r = /* @__PURE__ */ new Map();
|
|
3332
3363
|
for (let [i, a] of Object.entries(e.hosts)) {
|
|
3333
|
-
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) =>
|
|
3364
|
+
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) => ei(n, r, e, s, c, t)).sort((e, t) => e.priority - t.priority);
|
|
3334
3365
|
r.set(e, {
|
|
3335
3366
|
tenant_id: s,
|
|
3336
3367
|
custom_domain_id: c,
|
|
@@ -3374,7 +3405,7 @@ function Zr(e) {
|
|
|
3374
3405
|
}
|
|
3375
3406
|
};
|
|
3376
3407
|
}
|
|
3377
|
-
function
|
|
3408
|
+
function ni(e, t = {}) {
|
|
3378
3409
|
return {
|
|
3379
3410
|
priority: t.priority,
|
|
3380
3411
|
match: { path: t.path ?? "/*" },
|
|
@@ -3389,10 +3420,10 @@ function Qr(e, t = {}) {
|
|
|
3389
3420
|
}
|
|
3390
3421
|
//#endregion
|
|
3391
3422
|
//#region src/constants.ts
|
|
3392
|
-
var
|
|
3423
|
+
var ri = "proxy:resolve_host";
|
|
3393
3424
|
//#endregion
|
|
3394
3425
|
//#region src/http-adapter/index.ts
|
|
3395
|
-
function
|
|
3426
|
+
function ii() {
|
|
3396
3427
|
let e = () => {
|
|
3397
3428
|
throw Error("HTTP proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3398
3429
|
};
|
|
@@ -3414,7 +3445,7 @@ function ei() {
|
|
|
3414
3445
|
}
|
|
3415
3446
|
};
|
|
3416
3447
|
}
|
|
3417
|
-
function
|
|
3448
|
+
function ai(e) {
|
|
3418
3449
|
let t = e.fetch ?? fetch, n = e.baseUrl.replace(/\/+$/, ""), r = e.resolveHostPath ?? "/api/v2/proxy/control-plane/hosts/", i = e.audience ?? `${n}/api/v2/`, a = e.scope ?? "proxy:resolve_host", o = e.tokenRefreshSkewSeconds ?? 60, s = e.timeoutMs ?? 2500;
|
|
3419
3450
|
function c(e) {
|
|
3420
3451
|
let t = new AbortController(), n = setTimeout(() => t.abort(), s);
|
|
@@ -3447,7 +3478,7 @@ function ti(e) {
|
|
|
3447
3478
|
}), u);
|
|
3448
3479
|
}
|
|
3449
3480
|
return {
|
|
3450
|
-
proxyRoutes:
|
|
3481
|
+
proxyRoutes: ii(),
|
|
3451
3482
|
async resolveHost(e) {
|
|
3452
3483
|
let i = await f(), a = `${n}${r}${encodeURIComponent(e.toLowerCase())}`, o = await c((e) => t(a, {
|
|
3453
3484
|
headers: { authorization: `Bearer ${i}` },
|
|
@@ -3461,7 +3492,7 @@ function ti(e) {
|
|
|
3461
3492
|
}
|
|
3462
3493
|
//#endregion
|
|
3463
3494
|
//#region src/http-adapter/service-binding-fetch.ts
|
|
3464
|
-
function
|
|
3495
|
+
function oi(e) {
|
|
3465
3496
|
return (t, n) => {
|
|
3466
3497
|
let r = t instanceof Request && n === void 0 ? t : new Request(t, n);
|
|
3467
3498
|
return e.fetch(r);
|
|
@@ -3469,11 +3500,11 @@ function ni(e) {
|
|
|
3469
3500
|
}
|
|
3470
3501
|
//#endregion
|
|
3471
3502
|
//#region src/kv-adapter/index.ts
|
|
3472
|
-
var
|
|
3473
|
-
function
|
|
3503
|
+
var si = "authhero-proxy-host:";
|
|
3504
|
+
function ci(e, t) {
|
|
3474
3505
|
return `${e}${t.toLowerCase()}`;
|
|
3475
3506
|
}
|
|
3476
|
-
function
|
|
3507
|
+
function li() {
|
|
3477
3508
|
let e = () => {
|
|
3478
3509
|
throw Error("KV proxy adapter does not expose write access to proxy_routes; mutate via the control-plane management API");
|
|
3479
3510
|
};
|
|
@@ -3495,15 +3526,15 @@ function ai() {
|
|
|
3495
3526
|
}
|
|
3496
3527
|
};
|
|
3497
3528
|
}
|
|
3498
|
-
function
|
|
3499
|
-
let { kv: t, keyPrefix: n =
|
|
3529
|
+
function ui(e) {
|
|
3530
|
+
let { kv: t, keyPrefix: n = si, timeoutMs: r } = e;
|
|
3500
3531
|
return {
|
|
3501
|
-
proxyRoutes:
|
|
3532
|
+
proxyRoutes: li(),
|
|
3502
3533
|
async resolveHost(e) {
|
|
3503
|
-
let i =
|
|
3534
|
+
let i = ci(n, e), a = t.get(i, "json");
|
|
3504
3535
|
return (r && r > 0 ? await J(a, r, "kv.get") : await a) ?? null;
|
|
3505
3536
|
}
|
|
3506
3537
|
};
|
|
3507
3538
|
}
|
|
3508
3539
|
//#endregion
|
|
3509
|
-
export {
|
|
3540
|
+
export { si as DEFAULT_KV_HOST_KEY_PREFIX, I as HandlerRegistry, ri as PROXY_RESOLVE_HOST_SCOPE, or as basicAuthHandler, $r as buildCacheAdapterKey, Yr as buildCacheApiKey, ci as buildKvHostKey, Lr as buildMatchFilter, cr as cacheHandler, Z as compileHostApp, rr as corsHandler, Qr as createCacheAdapterHostCache, Jr as createCacheApiHostCache, ai as createHttpProxyAdapter, F as createInMemoryHostCache, ui as createKvProxyAdapter, Ur as createProxyApp, Q as createProxyDataPlaneHandler, Hr as createProxyDataPlaneRouter, oi as createServiceBindingFetch, ti as createStaticProxyAdapter, L as defineHandler, jr as dispatchNamespaceHandler, lr as forwardedHeadersHandler, j as handlerConfigSchema, sr as headersHandler, Sr as httpHandler, ni as httpRoute, wn as matchSchema, Ir as matchesAnyHost, Fr as matchesHost, M as proxyRouteInsertSchema, Tn as proxyRouteSchema, En as proxyRouteUpdateSchema, Mr as redirectHandler, Nr as registerBuiltinHandlers, pr as rewriteCookiesHandler, mr as rewriteLocationHandler, Er as serviceBindingHandler, Pr as sortRoutes, X as staticHandler };
|