Admit checked restricted artifacts without individual code approvals
This commit is contained in:
@@ -113,6 +113,8 @@ export interface ExecutionInstallation {
|
||||
readonly root: string;
|
||||
readonly service?: ArtifactImplementation;
|
||||
readonly module?: ArtifactImplementation;
|
||||
/** Checked candidate only; the qualified host verifies its import surface and SDK. */
|
||||
readonly restricted?: ArtifactImplementation;
|
||||
readonly browserImplementation?: ArtifactImplementation;
|
||||
readonly browserURL?: string;
|
||||
readonly browserRegistry?: string;
|
||||
@@ -251,6 +253,11 @@ function assembleExecutionInstallation(
|
||||
exports: exports.map((entry) => entry.id),
|
||||
})
|
||||
: undefined;
|
||||
const restrictedCandidates = manifest.implementations.filter(
|
||||
(entry) => entry.compatibility === "quixos-restricted-module-v1",
|
||||
);
|
||||
if (restrictedCandidates.length > 1) fail(revision, "Ambiguous restricted module candidates");
|
||||
const restricted = restrictedCandidates[0];
|
||||
const browserExports = exports.filter(
|
||||
(entry) =>
|
||||
entry.execution.kind !== "remote" &&
|
||||
@@ -258,7 +265,13 @@ function assembleExecutionInstallation(
|
||||
);
|
||||
if (!browserExports.length) {
|
||||
if (selection.browser) fail(revision, "Package has no browser exports to select");
|
||||
packages.push({ revision, root, ...(service ? { service } : {}), ...(module ? { module } : {}) });
|
||||
packages.push({
|
||||
revision,
|
||||
root,
|
||||
...(service ? { service } : {}),
|
||||
...(module ? { module } : {}),
|
||||
...(restricted ? { restricted } : {}),
|
||||
});
|
||||
continue;
|
||||
}
|
||||
const browser = selectArtifactImplementation(manifest, {
|
||||
@@ -289,6 +302,7 @@ function assembleExecutionInstallation(
|
||||
root,
|
||||
...(service ? { service } : {}),
|
||||
...(module ? { module } : {}),
|
||||
...(restricted ? { restricted } : {}),
|
||||
browserImplementation: browser,
|
||||
browserURL: contentArtifactUrl(entry),
|
||||
browserRegistry: browser.registryExport,
|
||||
|
||||
Reference in New Issue
Block a user