snyk-docker-plugin
Version:
Snyk CLI docker plugin
21 lines (20 loc) • 1.33 kB
TypeScript
import { PluginOptions } from "../../types";
import { ExtractAction, ExtractedLayersAndManifest, OciArchiveManifest, OciImageIndex, OciPlatformInfo } from "../types";
/**
* Retrieve the products of files content from the specified oci-archive.
*
* Uses a two-pass approach:
* 1. First pass: Parse JSON metadata (manifests, configs, indexes) to determine
* which layers are needed for the target platform.
* 2. Second pass: Extract only the required layer blobs.
*
* This avoids memory issues from buffering large layer blobs unnecessarily.
*
* @param ociArchiveFilesystemPath Path to image file saved in oci-archive format.
* @param extractActions Array of pattern-callbacks pairs.
* @param options PluginOptions
* @returns Array of extracted files products sorted by the reverse order of the layers from last to first.
*/
export declare function extractArchive(ociArchiveFilesystemPath: string, extractActions: ExtractAction[], options: PluginOptions): Promise<ExtractedLayersAndManifest>;
export declare function isImageManifest(manifest: OciArchiveManifest): boolean;
export declare function getManifest(imageIndex: OciImageIndex | undefined, manifestCollection: Record<string, OciArchiveManifest>, indexFiles: Record<string, OciImageIndex>, platformInfo: OciPlatformInfo): OciArchiveManifest | undefined;