mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-21 11:42:37 +02:00
Restrict wildcard domains for inference resources
This commit is contained in:
@@ -415,6 +415,16 @@ async function createHttpResource(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wildcard subdomains are not allowed for inference-mode resources
|
||||||
|
if (effectiveMode === "inference" && subdomain && subdomain.includes("*")) {
|
||||||
|
return next(
|
||||||
|
createHttpError(
|
||||||
|
HttpCode.BAD_REQUEST,
|
||||||
|
"Wildcard subdomains are not supported for inference-mode resources."
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Wildcard subdomains are a paid feature
|
// Wildcard subdomains are a paid feature
|
||||||
if (subdomain && subdomain.includes("*")) {
|
if (subdomain && subdomain.includes("*")) {
|
||||||
const isLicensed = await isLicensedOrSubscribed(
|
const isLicensed = await isLicensedOrSubscribed(
|
||||||
|
|||||||
@@ -531,6 +531,20 @@ async function updateHttpResource(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wildcard subdomains are not allowed for inference-mode resources
|
||||||
|
if (
|
||||||
|
resource.mode === "inference" &&
|
||||||
|
updateData.subdomain &&
|
||||||
|
updateData.subdomain.includes("*")
|
||||||
|
) {
|
||||||
|
return next(
|
||||||
|
createHttpError(
|
||||||
|
HttpCode.BAD_REQUEST,
|
||||||
|
"Wildcard subdomains are not supported for inference-mode resources."
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Wildcard subdomains are a paid feature
|
// Wildcard subdomains are a paid feature
|
||||||
if (updateData.subdomain && updateData.subdomain.includes("*")) {
|
if (updateData.subdomain && updateData.subdomain.includes("*")) {
|
||||||
if (!isLicensed) {
|
if (!isLicensed) {
|
||||||
|
|||||||
@@ -405,7 +405,10 @@ export default function GeneralForm() {
|
|||||||
<SettingsFormCell span="full">
|
<SettingsFormCell span="full">
|
||||||
<div id="resource-domain-picker">
|
<div id="resource-domain-picker">
|
||||||
<DomainPicker
|
<DomainPicker
|
||||||
allowWildcard={true}
|
allowWildcard={
|
||||||
|
resource.mode !==
|
||||||
|
"inference"
|
||||||
|
}
|
||||||
key={
|
key={
|
||||||
resource.resourceId
|
resource.resourceId
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -928,7 +928,8 @@ export default function Page() {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<DomainPicker
|
<DomainPicker
|
||||||
allowWildcard={
|
allowWildcard={
|
||||||
true
|
resourceType !==
|
||||||
|
"inference"
|
||||||
}
|
}
|
||||||
orgId={
|
orgId={
|
||||||
orgId as string
|
orgId as string
|
||||||
|
|||||||
Reference in New Issue
Block a user