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