Project node-addon-slsa
Type Aliases§
Source§type Bundle Verifier = Awaited<ReturnType<typeof createVerifier>>
type Bundle Verifier = Awaited<ReturnType<typeof createVerifier>>
Source§type Git Hub Repo = `${string}/${string}`
type Git Hub Repo = `${string}/${string}`
GitHub owner/repo slug.
Source§type Run Invocation URI = string & { "[___runInvocationURIBrand]": true }
type Run Invocation URI = string & { "[___runInvocationURIBrand]": true }
Source§type Sem Ver String = `${number}.${number}.${number}${string}`
type Sem Ver String = `${number}.${number}.${number}${string}`
Strict semver string (no v prefix): major.minor.patch[-pre][+build].
The template literal type is intentionally wider than the runtime check
in semVerString because TypeScript cannot express the full regex.
Functions§
Source§githubRepo(value: string): `${string}/${string}`
githubRepo(value: string): `${string}/${string}`
Validate and brand a string as a GitHubRepo.
Source§isProvenanceError(err: unknown): err is ProvenanceError
isProvenanceError(err: unknown): err is ProvenanceError
Type guard for ProvenanceError. Use in catch blocks to distinguish security failures from transient errors.
Source§runInvocationURI(value: string): RunInvocationURI
runInvocationURI(value: string): RunInvocationURI
Validate and brand a string as a RunInvocationURI.
Source§semVerString(value: string): `${number}.${number}.${number}${string}`
semVerString(value: string): `${number}.${number}.${number}${string}`
Validate and brand a string as a SemVerString.
Source§verifyAddonProvenance(
options: {
repo: `${string}/${string}`;
runInvocationURI: RunInvocationURI;
sha256: Sha256Hex;
} & VerifyOptions,
): Promise<void>
verifyAddonProvenance(
options: {
repo: `${string}/${string}`;
runInvocationURI: RunInvocationURI;
sha256: Sha256Hex;
} & VerifyOptions,
): Promise<void>
Verify addon binary provenance via the GitHub Attestations API. Confirms the artifact was attested in the expected workflow run and source repository.
Typically called via verifyAddon. Use directly when you already have a RunInvocationURI.
Source§verifyPackageProvenance(
options: {
packageName: string;
repo: `${string}/${string}`;
version: `${number}.${number}.${number}${string}`;
} & VerifyOptions,
): Promise<PackageProvenance>
verifyPackageProvenance(
options: {
packageName: string;
repo: `${string}/${string}`;
version: `${number}.${number}.${number}${string}`;
} & VerifyOptions,
): Promise<PackageProvenance>
Verify npm package provenance via sigstore attestations. Checks the certificate chain, issuer identity, and source repository. Returns a PackageProvenance handle for addon verification.
Classes§
- ProvenanceError
Thrown when provenance verification detects a security issue. The message is prefixed with
SECURITY:and includes remediation advice.
Interfaces§
- FetchOptions
Options controlling HTTP fetch behavior (timeouts, retries, cancellation).
- PackageProvenance
Returned by verifyPackageProvenance after npm provenance checks pass.
- VerifyOptions
Verification options: extends FetchOptions with attestation-specific limits.
Sigstore bundle verifier created by
createVerifier()from thesigstorepackage.