Merge origin/main for artifact admission and evidence fixes
This commit is contained in:
+12
-9
@@ -33,14 +33,14 @@ import {
|
||||
} from "./relationshipCoverage.js";
|
||||
|
||||
/** Provider identity schema shared by evidence-bearing persistence formats. */
|
||||
export const providerSchema = z.object({
|
||||
export const providerSchema = z.strictObject({
|
||||
id: z.string().min(1),
|
||||
name: z.string().min(1),
|
||||
version: z.string().nullable(),
|
||||
});
|
||||
const subjectSchema = z.object({
|
||||
const subjectSchema = z.strictObject({
|
||||
name: z.string().min(1),
|
||||
digest: z.object({ sha256: digestSchema }),
|
||||
digest: z.strictObject({ sha256: digestSchema }),
|
||||
format: z.enum([
|
||||
"hopper",
|
||||
"analysis-database",
|
||||
@@ -78,15 +78,18 @@ const subjectSchema = z.object({
|
||||
/** Source location attached to an evidence observation. */
|
||||
/** Source-location schema shared by evidence-bearing persistence formats. */
|
||||
export const evidenceLocationSchema = z.discriminatedUnion("kind", [
|
||||
z.object({ kind: z.literal("address"), address: z.string().min(1) }),
|
||||
z.object({
|
||||
z.strictObject({ kind: z.literal("address"), address: z.string().min(1) }),
|
||||
z.strictObject({
|
||||
kind: z.literal("address-range"),
|
||||
start: z.string().min(1),
|
||||
end: z.string().min(1),
|
||||
}),
|
||||
z.object({ kind: z.literal("artifact-path"), path: z.string().min(1) }),
|
||||
z.object({ kind: z.literal("file-offset"), offset: z.number().int().min(0) }),
|
||||
z.object({
|
||||
z.strictObject({ kind: z.literal("artifact-path"), path: z.string().min(1) }),
|
||||
z.strictObject({
|
||||
kind: z.literal("file-offset"),
|
||||
offset: z.number().int().min(0),
|
||||
}),
|
||||
z.strictObject({
|
||||
kind: z.literal("file-offset-range"),
|
||||
start: z.number().int().min(0),
|
||||
end: z.number().int().min(0),
|
||||
@@ -101,7 +104,7 @@ const evidenceAuthoritySchema = z.enum([
|
||||
"analyst-inference",
|
||||
]);
|
||||
|
||||
const executionEnvironmentSchema = z.object({
|
||||
const executionEnvironmentSchema = z.strictObject({
|
||||
id: z.string().min(1),
|
||||
platform: z.string().min(1),
|
||||
architecture: z.string().min(1),
|
||||
|
||||
Reference in New Issue
Block a user