(archive: tarfile.TarFile)
return (
        manifest,
        json.loads(config_file_content),
        File(
            config_file_content,
            filename="Dockerfile or build-args",  # noqa: E501
            filesize=config_file_info.size,
        ),
    )
Extracts Docker image archive manifest and configuration.
    Returns a tuple with:
    - the deserialized manifest,
    - the deserialized configuration,
    - the configuration File object to scan.
Extracts Docker image archive manifest and configuration.
    Returns a tuple with:
    - the deserialized manifest,
    - the deserialized configuration,
    - the configuration File object to scan.
Extracts Docker image archive manifest and configuration . Returns a tuple with : - the deserialized manifest - the deserialized configuration - the configuration File object to scan .
def _get_config(archive: tarfile.TarFile) -> Tuple[Dict, Dict, File]:
    """
    Extracts Docker image archive manifest and configuration.
    Returns a tuple with:
    - the deserialized manifest,
    - the deserialized configuration,
    - the configuration File object to scan.
    """
    manifest_file = archive.extractfile("manifest.json")
    if manifest_file is None:
        raise InvalidDockerArchiveException("No manifest file found.")

    manifest = json.load(manifest_file)[0]

    config_file_path = manifest.get("Config")

    config_file_info = archive.getmember(config_file_path)
    if config_file_info is None:
        raise InvalidDockerArchiveException("No config file found.")

    config_file = archive.extractfile(config_file_info)
    if config_file is None:
        raise InvalidDockerArchiveException("Config file could not be extracted.")

    config_file_content = config_file.read().decode()

    return (
        manifest,
        json.loads(config_file_content),
        File(
            config_file_content,
            filename="Dockerfile or build-args",  # noqa: E501
            filesize=config_file_info.size,
        ),
    )
def _get_config ( archive : tarfile . TarFile ) -> Tuple [ Dict , Dict , File ] : manifest_file = archive . extractfile ( "manifest.json" ) if manifest_file is None : raise InvalidDockerArchiveException ( "No manifest file found." ) manifest = json . load ( manifest_file ) [ 0 ] config_file_path = manifest . get ( "Config" ) config_file_info = archive . getmember ( config_file_path ) if config_file_info is None : raise InvalidDockerArchiveException ( "No config file found." ) config_file = archive . extractfile ( config_file_info ) if config_file is None : raise InvalidDockerArchiveException ( "Config file could not be extracted." ) config_file_content = config_file . read ( ) . decode ( ) return ( manifest , json . loads ( config_file_content ) , File ( config_file_content , filename = "Dockerfile or build-args" , # noqa: E501 filesize = config_file_info . size , ) , )