UNPKG

snyk-docker-plugin

Version:
80 lines (79 loc) 2.07 kB
/// <reference types="node" /> /// <reference types="node" /> import { Readable } from "stream"; import { Elf } from "../go-parser/types"; import { AutoDetectedUserInstructions } from "../types"; export declare type ExtractCallback = (dataStream: Readable, streamSize?: number) => Promise<string | Buffer>; export declare type FileContent = string | Buffer | Elf; export declare type FileNameAndContent = Record<string, FileContent>; export interface ExtractionResult { imageId: string; manifestLayers: string[]; extractedLayers: ExtractedLayers; rootFsLayers?: string[]; autoDetectedUserInstructions?: AutoDetectedUserInstructions; platform?: string; imageLabels?: { [key: string]: string; }; imageCreationTime?: string; } export interface ExtractedLayers { [layerName: string]: FileNameAndContent; } export interface ExtractedLayersAndManifest { layers: ExtractedLayers[]; manifest: DockerArchiveManifest; imageConfig: ImageConfig; } export interface DockerArchiveManifest { Config: string; RepoTags: string[]; Layers: string[]; } export interface ImageConfig { architecture: string; os: string; rootfs: { diff_ids: string[]; }; config: { Labels: { [key: string]: string; }; }; created: string; } export interface OciArchiveLayer { digest: string; } export interface OciArchiveManifest { schemaVersion: string; config: { digest: string; }; layers: OciArchiveLayer[]; } export interface OciManifestInfo { digest: string; platform?: { architecture: string; os: string; }; } export interface OciImageIndex { manifests: OciManifestInfo[]; } export interface ExtractAction { actionName: string; filePathMatches: (filePath: string) => boolean; callback?: ExtractCallback; } export interface DetectedImageLayers { packages: any; layers: any; } export interface RedHatRepos { [imageLayerIndex: string]: RedHatRepo[]; } export declare type RedHatRepo = string;