mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-21 20:36:37 +00:00
Testing cross site issue
This commit is contained in:
@@ -68,7 +68,7 @@ export async function updateResources(
|
||||
)
|
||||
.limit(1);
|
||||
} else {
|
||||
throw new Error(`Target site ID is required`);
|
||||
throw new Error(`Target site is required`);
|
||||
}
|
||||
|
||||
if (!site) {
|
||||
@@ -712,7 +712,7 @@ async function getDomainId(
|
||||
}
|
||||
|
||||
const validDomains = possibleDomains.filter((domain) => {
|
||||
if (domain.domains.type == "ns") {
|
||||
if (domain.domains.type == "ns" || domain.domains.type == "wildcard") {
|
||||
return (
|
||||
fullDomain === domain.domains.baseDomain ||
|
||||
fullDomain.endsWith(`.${domain.domains.baseDomain}`)
|
||||
|
||||
@@ -41,9 +41,10 @@ const applyBlueprintParamsSchema = z
|
||||
registry.registerPath({
|
||||
method: "put",
|
||||
path: "/org/{orgId}/blueprint",
|
||||
description: "Apply a blueprint to an organization",
|
||||
description: "Apply a base64 encoded blueprint to an organization",
|
||||
tags: [OpenAPITags.Org],
|
||||
request: {
|
||||
params: applyBlueprintParamsSchema,
|
||||
body: {
|
||||
content: {
|
||||
"application/json": {
|
||||
@@ -93,7 +94,10 @@ export async function applyBlueprint(
|
||||
logger.debug(`Received blueprint: ${blueprint}`);
|
||||
|
||||
try {
|
||||
const blueprintParsed = JSON.parse(blueprint);
|
||||
// first base64 decode the blueprint
|
||||
const decoded = Buffer.from(blueprint, "base64").toString("utf-8");
|
||||
// then parse the json
|
||||
const blueprintParsed = JSON.parse(decoded);
|
||||
// Update the blueprint in the database
|
||||
await applyBlueprintFunc(orgId, blueprintParsed);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user