Host checked adapter-object controllers through bounded registries (WI-13)
This commit is contained in:
@@ -257,7 +257,11 @@ const createResourceGraphResolver = (quixosCommit: string, resolveResource: Capa
|
||||
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
||||
}
|
||||
if (controllerText !== undefined)
|
||||
compiled.resource.revision.controllers = parseControllerCatalog(controllerText, queryInterfaces);
|
||||
compiled.resource.revision.controllers = parseControllerCatalog(
|
||||
controllerText,
|
||||
queryInterfaces,
|
||||
compiled.resource.revision.checkedQueries,
|
||||
);
|
||||
let catalogText: string | undefined;
|
||||
try {
|
||||
catalogText = await readFile(path.join(snapshot.directory, "quixos.migrations.json"), "utf8");
|
||||
|
||||
@@ -10,7 +10,8 @@ export async function scaffoldController(
|
||||
const entry = { id: spec.id, ...spec.controller };
|
||||
const fields = ["id", "subject", "snapshot", "remote", "input"];
|
||||
if (
|
||||
Object.keys(entry).length !== fields.length ||
|
||||
Object.keys(entry).some((key) => ![...fields, "registry"].includes(key)) ||
|
||||
(entry.registry !== undefined && typeof entry.registry !== "string") ||
|
||||
fields.some((key) => typeof (entry as Record<string, unknown>)[key] !== "string") ||
|
||||
!["unit", "value"].includes(entry.input ?? "")
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ export type ScaffoldRecipe = {
|
||||
declaration?: string;
|
||||
queryDocument?: string;
|
||||
initialFiles?: Record<string, string>;
|
||||
controller?: { subject: string; snapshot: string; remote: string; input: "unit" | "value" };
|
||||
controller?: { registry?: string; subject: string; snapshot: string; remote: string; input: "unit" | "value" };
|
||||
tools?: { quixos: Source; protocol: Source; helpers: Source; sdk?: Source };
|
||||
};
|
||||
const source = (value: Source): GitSource => {
|
||||
|
||||
Reference in New Issue
Block a user