mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 13:12:26 +00:00
feat(artifacts): name integrity checks for DMG, directory and release-exposure readers (#11056)
* feat(artifacts): name integrity checks for DMG, directory and release-exposure readers Directory members and release-exposure members whose file identity or bytes changed since inventory report member-identity; a directory entry without captured state reports entry-metadata and a changed directory root container-identity; an hdiutil checksum failure reports image-checksum. AnalysisArtifactChangedError carries the check from the reader failure and projects it as details.integrity_check. * fix(artifacts): name missing directory entry state and keep integrity checks through error copies * feat(artifacts): name integrity checks for ZIP, PyInstaller and changed release files (#11081) feat(artifacts): name integrity checks for ZIP, PyInstaller and changed release files, and keep them through reader projections * feat(artifacts): name integrity checks for the remaining readers and their projections (#11098)
This commit is contained in:
1 parent
598a0c4034
commit
7134053d27
63 files changed
+494
-185
No files matched your search
@@ -124,6 +124,7 @@ export const readJavaScriptArtifactFiles = async (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
"Root artifact node is missing",
|
||||
{ integrityCheck: "inventory-node" },
|
||||
);
|
||||
await verifyEntryBytes(
|
||||
await reader.openContainer(signal),
|
||||
@@ -253,6 +254,7 @@ const visitReader = async (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
`Nested ASAR was not present in inventory: ${path}`,
|
||||
{ integrityCheck: "inventory-node" },
|
||||
);
|
||||
if (container.hash_status === "mismatched") continue;
|
||||
if (container.hash_status === "unavailable") continue;
|
||||
@@ -260,6 +262,7 @@ const visitReader = async (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
`Nested ASAR was not integrity-verified: ${path}`,
|
||||
{ integrityCheck: "inventory-node" },
|
||||
);
|
||||
// Inventory expands an ASAR-named file only when its bytes are an
|
||||
// ASAR. One it recorded as ordinary bytes has no members to read.
|
||||
@@ -269,6 +272,7 @@ const visitReader = async (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
`Verified nested ASAR has no inventory node: ${path}`,
|
||||
{ integrityCheck: "inventory-node" },
|
||||
);
|
||||
await verifyEntryBytes(
|
||||
await frame.reader.open(entry, context.signal),
|
||||
@@ -384,6 +388,7 @@ const readText = async (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
`Artifact entry changed after inventory: ${input.expected.path}`,
|
||||
{ integrityCheck: "member-identity" },
|
||||
);
|
||||
context.textBytes += bytes.length;
|
||||
try {
|
||||
@@ -413,6 +418,7 @@ const verifyEntryBytes = async (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
`Artifact entry changed after inventory: ${expected.path}`,
|
||||
{ integrityCheck: "member-identity" },
|
||||
);
|
||||
abortIfNeeded(signal);
|
||||
};
|
||||
@@ -469,6 +475,7 @@ const expectedInventory = (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
`Artifact inventory node is missing: ${occurrence.logical_path}`,
|
||||
{ integrityCheck: "inventory-node" },
|
||||
);
|
||||
// Inventory occurrences can have content identities for directories too.
|
||||
// Suffixes only describe file candidates; a directory such as
|
||||
@@ -668,6 +675,7 @@ const assertExpectedFilesWereVisited = (
|
||||
throw new ArtifactReaderFailure(
|
||||
"integrity",
|
||||
`Relevant artifact entry disappeared after inventory: ${path}`,
|
||||
{ integrityCheck: "member-identity" },
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user