From 1e9f7f49cdecff8ab24e5b0f7be31e12a47870f8 Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Sun, 4 Feb 2024 11:07:35 +0000 Subject: [PATCH] sbom output Signed-off-by: Prabhu Subramanian Retrieve apk summary and features Signed-off-by: Prabhu Subramanian aab support Signed-off-by: Prabhu Subramanian --- .github/workflows/pytests.yml | 2 +- Dockerfile | 52 +- README.md | 40 +- blint/analysis.py | 9 +- blint/android.py | 267 +++ blint/binary.py | 7 + blint/cli.py | 73 +- blint/cyclonedx/__init__.py | 0 blint/cyclonedx/spdx.py | 623 ++++++ blint/cyclonedx/spec.py | 3440 ++++++++++++++++++++++++++++++++ blint/logger.py | 9 +- blint/sbom.py | 106 + blint/utils.py | 55 + poetry.lock | 468 +++-- pyproject.toml | 7 +- tests/data/apk-features.txt | 2 + tests/data/apk-manifest.txt | 1923 ++++++++++++++++++ tests/data/apk-permissions.txt | 42 + tests/data/apk-summary.txt | 1 + tests/test_android.py | 10 + 20 files changed, 6860 insertions(+), 276 deletions(-) create mode 100644 blint/android.py create mode 100644 blint/cyclonedx/__init__.py create mode 100644 blint/cyclonedx/spdx.py create mode 100644 blint/cyclonedx/spec.py create mode 100644 blint/sbom.py create mode 100644 tests/data/apk-features.txt create mode 100644 tests/data/apk-manifest.txt create mode 100644 tests/data/apk-permissions.txt create mode 100644 tests/data/apk-summary.txt create mode 100644 tests/test_android.py diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index f906f46..371c4e1 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python diff --git a/Dockerfile b/Dockerfile index 32bcd4f..28f0700 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,53 +1,47 @@ -FROM almalinux:9.2-minimal +FROM almalinux:9.3-minimal LABEL maintainer="appthreat" \ org.opencontainers.image.authors="Team AppThreat " \ - org.opencontainers.image.source="https://github.com/AppThreat/blint" \ - org.opencontainers.image.url="https://github.com/AppThreat/blint" \ - org.opencontainers.image.version="1.0.35" \ + org.opencontainers.image.source="https://github.com/owasp-dep-scan/blint" \ + org.opencontainers.image.url="https://github.com/owasp-dep-scan/blint" \ + org.opencontainers.image.version="2.0.x" \ org.opencontainers.image.vendor="AppThreat" \ org.opencontainers.image.licenses="Apache-2.0" \ org.opencontainers.image.title="blint" \ - org.opencontainers.image.description="BLint is a Binary Linter to check the security properties, and capabilities in your executables. It is powered by lief." \ - org.opencontainers.docker.cmd="docker run --rm -it -v /tmp:/tmp -v $(pwd):/app:rw -w /app -t ghcr.io/appthreat/blint" + org.opencontainers.image.description="BLint is a Binary Linter and SBOM generator." \ + org.opencontainers.docker.cmd="docker run --rm -it -v /tmp:/tmp -v $(pwd):/app:rw -w /app -t ghcr.io/owasp-dep-scan/blint" ARG TARGETPLATFORM -ARG JAVA_VERSION=22.3.r19-grl -ARG SBT_VERSION=1.9.0 -ARG MAVEN_VERSION=3.9.2 -ARG GRADLE_VERSION=8.1.1 +ARG JAVA_VERSION=21.0.2-tem ARG ARCH_NAME=x86_64 -ENV GOPATH=/opt/app-root/go \ - GO_VERSION=1.20.4 \ - JAVA_VERSION=$JAVA_VERSION \ - SBT_VERSION=$SBT_VERSION \ - MAVEN_VERSION=$MAVEN_VERSION \ - GRADLE_VERSION=$GRADLE_VERSION \ - GRADLE_OPTS="-Dorg.gradle.daemon=false" \ - JAVA_HOME="/opt/java/${JAVA_VERSION}" \ - MAVEN_HOME="/opt/maven/${MAVEN_VERSION}" \ - GRADLE_HOME="/opt/gradle/${GRADLE_VERSION}" \ - SBT_HOME="/opt/sbt/${SBT_VERSION}" \ - COMPOSER_ALLOW_SUPERUSER=1 \ +ENV COMPOSER_ALLOW_SUPERUSER=1 \ + ANDROID_HOME=/opt/android-sdk-linux \ PYTHONUNBUFFERED=1 \ PYTHONIOENCODING="utf-8" -ENV PATH=${PATH}:${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${GRADLE_HOME}/bin:${SBT_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:/usr/local/bin/:/root/.local/bin: +ENV PATH=${PATH}:/usr/local/bin/:/root/.local/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools: -COPY . /opt/blint - -RUN microdnf install -y python3.11 python3.11-devel python3.11-pip \ +RUN microdnf install -y python3.11 python3.11-devel python3.11-pip java-21-openjdk-headless which tar gzip zip unzip sudo ncurses \ && alternatives --install /usr/bin/python3 python /usr/bin/python3.11 1 \ && python3 --version \ && python3 -m pip install --upgrade pip \ && python3 -m pip install setuptools --upgrade \ - && python3 -m pip install poetry - + && python3 -m pip install poetry \ + && microdnf install -y epel-release \ + && mkdir -p ${ANDROID_HOME}/cmdline-tools \ + && curl -L https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -o ${ANDROID_HOME}/cmdline-tools/android_tools.zip \ + && unzip ${ANDROID_HOME}/cmdline-tools/android_tools.zip -d ${ANDROID_HOME}/cmdline-tools/ \ + && rm ${ANDROID_HOME}/cmdline-tools/android_tools.zip \ + && mv ${ANDROID_HOME}/cmdline-tools/cmdline-tools ${ANDROID_HOME}/cmdline-tools/latest \ + && yes | /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --licenses --sdk_root=/opt/android-sdk-linux \ + && /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'platform-tools' --sdk_root=/opt/android-sdk-linux \ + && /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'platforms;android-34' --sdk_root=/opt/android-sdk-linux \ + && /opt/android-sdk-linux/cmdline-tools/latest/bin/sdkmanager 'build-tools;34.0.0' --sdk_root=/opt/android-sdk-linux +COPY . /opt/blint RUN cd /opt/blint \ && poetry config virtualenvs.create false \ && poetry install --no-cache --without dev \ && chmod a-w -R /opt \ && microdnf clean all - ENTRYPOINT [ "blint" ] diff --git a/README.md b/README.md index 77b70e2..32bc6e7 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ BLint is a Binary Linter to check the security properties, and capabilities in y Supported binary formats: +- Android (apk, aab) - ELF (GNU, musl) - PE (exe, dll) - Mach-O (x64, arm64) @@ -42,21 +43,42 @@ You can download single binary builds from the [blint-bin releases](https://gith ## Usage -```bash -usage: blint [-h] [-i SRC_DIR_IMAGE] [-o REPORTS_DIR] [--no-error] [--no-banner] [--no-reviews] +```shell +usage: blint [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [-o REPORTS_DIR] [--no-error] [--no-banner] + [--no-reviews] [--suggest-fuzzable] + {sbom} ... -Linting tool for binary files powered by lief. +Binary linter and SBOM generator. -optional arguments: +options: -h, --help show this help message and exit -i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...], --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...] Source directories, container images or binary files. Defaults to current directory. -o REPORTS_DIR, --reports REPORTS_DIR - Reports directory - --no-error Continue on error to prevent build from breaking - --no-banner Do not display banner - --no-reviews Do not perform method reviews - --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary + Reports directory. Defaults to reports. + --no-error Continue on error to prevent build from breaking. + --no-banner Do not display banner. + --no-reviews Do not perform method reviews. + --suggest-fuzzable Suggest functions and symbols for fuzzing based on a dictionary. + +sub-commands: + Additional sub-commands + + {sbom} + sbom Command to generate SBOM for supported binaries. +``` + +### SBOM sub-command + +```shell +usage: blint sbom [-h] [-i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...]] [--output-file SBOM_OUTPUT] + +options: + -h, --help show this help message and exit + -i SRC_DIR_IMAGE [SRC_DIR_IMAGE ...], --src SRC_DIR_IMAGE [SRC_DIR_IMAGE ...] + Source directories, container images or binary files. Defaults to current directory. + --output-file SBOM_OUTPUT + SBOM output file. Defaults to bom.json in current directory. ``` To test any binary including default commands diff --git a/blint/analysis.py b/blint/analysis.py index d91e40e..3a6ec60 100644 --- a/blint/analysis.py +++ b/blint/analysis.py @@ -17,8 +17,13 @@ from blint.binary import parse from blint.logger import LOG, console -from blint.utils import (find_exe_files, is_exe, is_fuzzable_name, - is_ignored_file, parse_pe_manifest) +from blint.utils import ( + find_exe_files, + is_exe, + is_fuzzable_name, + is_ignored_file, + parse_pe_manifest, +) try: import importlib.resources diff --git a/blint/android.py b/blint/android.py new file mode 100644 index 0000000..b97a8cc --- /dev/null +++ b/blint/android.py @@ -0,0 +1,267 @@ +import os +import shutil +import subprocess +import sys +import tempfile + +from blint.binary import parse +from blint.cyclonedx.spec import ( + Component, + ComponentEvidence, + FieldModel, + Identity, + Method, + Property, + RefType, + Scope, + Technique, + Type, +) +from blint.logger import LOG +from blint.utils import check_command, find_files, unzip_unsafe + +ANDROID_HOME = os.getenv("ANDROID_HOME") +APKANALYZER_CMD = os.getenv("APKANALYZER_CMD") +if ( + not APKANALYZER_CMD + and ANDROID_HOME + and os.path.exists( + os.path.join(ANDROID_HOME, "cmdline-tools", "latest", "bin", "apkanalyzer") + ) +): + APKANALYZER_CMD = os.path.join( + ANDROID_HOME, "cmdline-tools", "latest", "bin", "apkanalyzer" + ) +elif check_command("apkanalyzer"): + APKANALYZER_CMD = "apkanalyzer" + + +def exec_tool(args, cwd=None, stdout=subprocess.PIPE): + """ + Convenience method to invoke cli tools + + :param args: Command line arguments + :param cwd: Working directory + :param stdout: Specifies stdout of command + """ + try: + LOG.debug('⚡︎ Executing "%s"', " ".join(args)) + cp = subprocess.run( + args, + stdout=stdout, + stderr=subprocess.STDOUT, + cwd=cwd, + env=os.environ.copy(), + shell=sys.platform == "win32", + encoding="utf-8", + check=False, + ) + return cp + except Exception as e: + LOG.exception(e) + return None + + +def collect_app_metadata(app_file): + """ + Collect various metadata about an android app + """ + parent_component = apk_summary(app_file) + if parent_component: + parent_component.properties = [] + features = apk_features(app_file) + if features: + parent_component.properties.append( + Property(name="internal.appFeatures", value=features) + ) + permissions = apk_permissions(app_file) + if permissions: + parent_component.properties.append( + Property(name="internal.appPermissions", value=permissions) + ) + components = collect_files_metadata(app_file) + return parent_component, components + + +def apk_summary(app_file): + """ + Retrieve the parent component using apk summary + """ + if not app_file.endswith(".apk") or not APKANALYZER_CMD: + return None + cp = exec_tool([APKANALYZER_CMD, "apk", "summary", app_file]) + if cp and cp.returncode == 0: + return parse_apk_summary(cp.stdout) + return None + + +def apk_features(app_file): + """ + Retrieve the app features + """ + if not app_file.endswith(".apk") or not APKANALYZER_CMD: + return None + cp = exec_tool([APKANALYZER_CMD, "apk", "features", app_file]) + if cp and cp.returncode == 0: + data = cp.stdout.strip() + if "JAVA_TOOL_OPTIONS" in data: + parts = data.split(os.linesep) + if parts and len(parts) > 1: + parts.pop(0) + return "\n".join(parts) + return None + + +def apk_permissions(app_file): + """ + Retrieve the app permissions + """ + if not app_file.endswith(".apk") or not APKANALYZER_CMD: + return None + cp = exec_tool([APKANALYZER_CMD, "manifest", "permissions", app_file]) + if cp and cp.returncode == 0: + data = cp.stdout.strip() + if "JAVA_TOOL_OPTIONS" in data: + parts = data.split(os.linesep) + if parts and len(parts) > 1: + parts.pop(0) + return "\n".join(parts) + return None + + +def collect_files_metadata(app_file): + """ + Unzip the app and collect metadata + """ + file_components = [] + app_temp_dir = tempfile.mkdtemp(prefix="blint_android_app") + unzip_unsafe(app_file, app_temp_dir) + # Find and read all .version files + version_files = find_files(app_temp_dir, [".version"]) + if version_files: + for vf in version_files: + file_name = os.path.basename(vf).removesuffix(".version") + rel_path = os.path.relpath(vf, app_temp_dir) + group = "" + name = "" + if "_" in file_name: + parts = file_name.split("_") + name = file_name + if parts and len(parts) == 2: + group = parts[0] + name = parts[-1] + with open(vf, encoding="utf-8") as fp: + version_data = fp.read().strip() + if name and version_data: + purl = f"pkg:maven/{group}/{name}@{version_data}" + component = Component( + type=Type.library, + group=group, + name=name, + version=version_data, + purl=purl, + scope=Scope.required, + evidence=ComponentEvidence( + identity=Identity( + field=FieldModel.purl, + confidence=1, + methods=[ + Method( + technique=Technique.manifest_analysis, + value=rel_path, + confidence=1, + ) + ], + ) + ), + properties=[ + Property(name="internal:srcFile", value=rel_path), + Property(name="internal:appFile", value=app_file), + ], + ) + component.bom_ref = RefType(purl) + file_components.append(component) + # Parse all .so files + so_files = find_files(app_temp_dir, [".so"]) + if so_files: + for sof in so_files: + so_metadata = parse(sof) + name = os.path.basename(sof).removesuffix(".so").removeprefix("lib") + rel_path = os.path.relpath(sof, app_temp_dir) + group = "" + version = "latest" + arch = "" + functions = [] + # Extract architecture from file + # lib/arm64-v8a/libsentry-android.so + if rel_path.startswith("lib"): + parts = rel_path.split(os.sep) + if len(parts) == 3: + arch = parts[1] + # Retrieve the version number from notes + for anote in so_metadata.get("notes", []): + if anote.get("version"): + version = anote.get("version") + break + elif anote.get("build_id"): + version = anote.get("build_id") + break + if so_metadata.get("functions"): + functions = [ + f.get("name") + for f in so_metadata.get("functions") + if f.get("name") and not f.get("name").startswith("_") + ] + purl = f"pkg:generic/{name}@{version}" + if arch: + purl = f"{purl}?arch={arch}" + component = Component( + type=Type.library, + group=group, + name=name, + version=version, + purl=purl, + scope=Scope.required, + evidence=ComponentEvidence( + identity=Identity( + field=FieldModel.purl, + confidence=0.5, + methods=[ + Method( + technique=Technique.binary_analysis, + value=rel_path, + confidence=0.5, + ) + ], + ) + ), + properties=[ + Property(name="internal:srcFile", value=rel_path), + Property(name="internal:appFile", value=app_file), + Property( + name="internal:functions", value=", ".join(set(functions)) + ), + ], + ) + component.bom_ref = RefType(purl) + file_components.append(component) + shutil.rmtree(app_temp_dir, ignore_errors=True) + return file_components + + +def parse_apk_summary(data): + """ + Parse output from apk summary + """ + if data: + parts = data.strip().split(os.linesep)[-1].split("\t") + if parts: + name = parts[0] + version = parts[-1] + purl = f"pkg:apk/{name}@{version}" + component = Component( + type=Type.application, name=name, version=version, purl=purl + ) + component.bom_ref = RefType(purl) + return component + return None diff --git a/blint/binary.py b/blint/binary.py index 653bd9c..527708c 100644 --- a/blint/binary.py +++ b/blint/binary.py @@ -35,6 +35,10 @@ def parse_notes(parsed_obj): notes = parsed_obj.notes if len(notes): for idx, note in enumerate(notes): + note_str = str(note) + build_id = "" + if "ID Hash" in note_str: + build_id = note_str.split("ID Hash:")[-1].strip() description = note.description description_str = " ".join(map(parse_desc, description[:16])) if len(description) > 16: @@ -58,6 +62,8 @@ def parse_notes(parsed_obj): version_str = "{:d}.{:d}.{:d}".format( version[0], version[1], version[2] ) + if not version_str and type_str == "BUILD_ID" and build_id: + version_str = build_id if note.is_core: note_details_str = note.details metadata["notes"].append( @@ -70,6 +76,7 @@ def parse_notes(parsed_obj): "ndk_build_number": ndk_build_number, "abi": abi, "version": version_str, + "build_id": build_id, } ) return metadata["notes"] diff --git a/blint/cli.py b/blint/cli.py index 0301a91..f664a25 100644 --- a/blint/cli.py +++ b/blint/cli.py @@ -6,6 +6,7 @@ import sys from blint.analysis import report, start +from blint.sbom import generate blint_logo = """ ██████╗ ██╗ ██╗███╗ ██╗████████╗ @@ -23,7 +24,7 @@ def build_args(): """ parser = argparse.ArgumentParser( prog="blint", - description="Linting tool for binary files powered by lief.", + description="Binary linter and SBOM generator.", ) parser.add_argument( "-i", @@ -44,28 +45,51 @@ def build_args(): action="store_true", default=False, dest="noerror", - help="Continue on error to prevent build from breaking", + help="Continue on error to prevent build from breaking.", ) parser.add_argument( "--no-banner", action="store_true", default=False, dest="no_banner", - help="Do not display banner", + help="Do not display banner.", ) parser.add_argument( "--no-reviews", action="store_true", default=False, dest="no_reviews", - help="Do not perform method reviews", + help="Do not perform method reviews.", ) parser.add_argument( "--suggest-fuzzable", action="store_true", default=False, dest="suggest_fuzzable", - help="Suggest functions and symbols for fuzzing based on a dictionary", + help="Suggest functions and symbols for fuzzing based on a dictionary.", + ) + # sbom commmand + subparsers = parser.add_subparsers( + title="sub-commands", + description="Additional sub-commands", + dest="subcommand_name", + ) + sbom_parser = subparsers.add_parser( + "sbom", help="Command to generate SBOM for supported binaries." + ) + sbom_parser.add_argument( + "-i", + "--src", + dest="src_dir_image", + action="extend", + nargs="+", + help="Source directories, container images or binary files. Defaults to current directory.", + ) + sbom_parser.add_argument( + "-o", + "--output-file", + dest="sbom_output", + help="SBOM output file. Defaults to bom.json in current directory.", ) return parser.parse_args() @@ -81,31 +105,38 @@ def main(): args = build_args() if not args.no_banner: print(blint_logo) + if args.sbom_output: + sbom_output = args.sbom_output + else: + sbom_output = os.path.join(os.getcwd(), "bom.json") if not os.getenv("CI"): - src_dir = args.src_dir_image + src_dirs = args.src_dir_image else: - src_dir = parse_input(args.src_dir_image) - if not src_dir: - src_dir = [os.getcwd()] + src_dirs = parse_input(args.src_dir_image) + if not src_dirs: + src_dirs = [os.getcwd()] if args.reports_dir: reports_dir = args.reports_dir else: reports_dir = os.path.join(os.getcwd(), "reports") - for src in src_dir: + for src in src_dirs: if not os.path.exists(src): print(f"{src} is an invalid file or directory!") return - # Create reports directory - if reports_dir and not os.path.exists(reports_dir): - os.makedirs(reports_dir) - - findings, reviews, files, fuzzables = start(args, src_dir, reports_dir) - report(args, src_dir, reports_dir, findings, reviews, files, fuzzables) - - if os.getenv("CI"): - for f in findings: - if f['severity'] == 'critical': - sys.exit(1) + # SBOM command + if args.subcommand_name == "sbom": + generate(src_dirs, sbom_output) + # Default case + else: + # Create reports directory + if reports_dir and not os.path.exists(reports_dir): + os.makedirs(reports_dir) + findings, reviews, files, fuzzables = start(args, src_dirs, reports_dir) + report(args, src_dirs, reports_dir, findings, reviews, files, fuzzables) + if os.getenv("CI") and not args.noerror: + for f in findings: + if f["severity"] == "critical": + sys.exit(1) if __name__ == "__main__": diff --git a/blint/cyclonedx/__init__.py b/blint/cyclonedx/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/blint/cyclonedx/spdx.py b/blint/cyclonedx/spdx.py new file mode 100644 index 0000000..aa762ba --- /dev/null +++ b/blint/cyclonedx/spdx.py @@ -0,0 +1,623 @@ +# generated by datamodel-codegen: +# filename: bom-1.5.schema.json +# timestamp: 2024-02-03T14:05:08+00:00 + +from __future__ import annotations + +from enum import Enum + + +class Schema(Enum): + field_0BSD = "0BSD" + AAL = "AAL" + Abstyles = "Abstyles" + AdaCore_doc = "AdaCore-doc" + Adobe_2006 = "Adobe-2006" + Adobe_Glyph = "Adobe-Glyph" + ADSL = "ADSL" + AFL_1_1 = "AFL-1.1" + AFL_1_2 = "AFL-1.2" + AFL_2_0 = "AFL-2.0" + AFL_2_1 = "AFL-2.1" + AFL_3_0 = "AFL-3.0" + Afmparse = "Afmparse" + AGPL_1_0 = "AGPL-1.0" + AGPL_1_0_only = "AGPL-1.0-only" + AGPL_1_0_or_later = "AGPL-1.0-or-later" + AGPL_3_0 = "AGPL-3.0" + AGPL_3_0_only = "AGPL-3.0-only" + AGPL_3_0_or_later = "AGPL-3.0-or-later" + Aladdin = "Aladdin" + AMDPLPA = "AMDPLPA" + AML = "AML" + AMPAS = "AMPAS" + ANTLR_PD = "ANTLR-PD" + ANTLR_PD_fallback = "ANTLR-PD-fallback" + Apache_1_0 = "Apache-1.0" + Apache_1_1 = "Apache-1.1" + Apache_2_0 = "Apache-2.0" + APAFML = "APAFML" + APL_1_0 = "APL-1.0" + App_s2p = "App-s2p" + APSL_1_0 = "APSL-1.0" + APSL_1_1 = "APSL-1.1" + APSL_1_2 = "APSL-1.2" + APSL_2_0 = "APSL-2.0" + Arphic_1999 = "Arphic-1999" + Artistic_1_0 = "Artistic-1.0" + Artistic_1_0_cl8 = "Artistic-1.0-cl8" + Artistic_1_0_Perl = "Artistic-1.0-Perl" + Artistic_2_0 = "Artistic-2.0" + ASWF_Digital_Assets_1_0 = "ASWF-Digital-Assets-1.0" + ASWF_Digital_Assets_1_1 = "ASWF-Digital-Assets-1.1" + Baekmuk = "Baekmuk" + Bahyph = "Bahyph" + Barr = "Barr" + Beerware = "Beerware" + Bitstream_Charter = "Bitstream-Charter" + Bitstream_Vera = "Bitstream-Vera" + BitTorrent_1_0 = "BitTorrent-1.0" + BitTorrent_1_1 = "BitTorrent-1.1" + blessing = "blessing" + BlueOak_1_0_0 = "BlueOak-1.0.0" + Boehm_GC = "Boehm-GC" + Borceux = "Borceux" + Brian_Gladman_3_Clause = "Brian-Gladman-3-Clause" + BSD_1_Clause = "BSD-1-Clause" + BSD_2_Clause = "BSD-2-Clause" + BSD_2_Clause_FreeBSD = "BSD-2-Clause-FreeBSD" + BSD_2_Clause_NetBSD = "BSD-2-Clause-NetBSD" + BSD_2_Clause_Patent = "BSD-2-Clause-Patent" + BSD_2_Clause_Views = "BSD-2-Clause-Views" + BSD_3_Clause = "BSD-3-Clause" + BSD_3_Clause_Attribution = "BSD-3-Clause-Attribution" + BSD_3_Clause_Clear = "BSD-3-Clause-Clear" + BSD_3_Clause_LBNL = "BSD-3-Clause-LBNL" + BSD_3_Clause_Modification = "BSD-3-Clause-Modification" + BSD_3_Clause_No_Military_License = "BSD-3-Clause-No-Military-License" + BSD_3_Clause_No_Nuclear_License = "BSD-3-Clause-No-Nuclear-License" + BSD_3_Clause_No_Nuclear_License_2014 = "BSD-3-Clause-No-Nuclear-License-2014" + BSD_3_Clause_No_Nuclear_Warranty = "BSD-3-Clause-No-Nuclear-Warranty" + BSD_3_Clause_Open_MPI = "BSD-3-Clause-Open-MPI" + BSD_4_Clause = "BSD-4-Clause" + BSD_4_Clause_Shortened = "BSD-4-Clause-Shortened" + BSD_4_Clause_UC = "BSD-4-Clause-UC" + BSD_4_3RENO = "BSD-4.3RENO" + BSD_4_3TAHOE = "BSD-4.3TAHOE" + BSD_Advertising_Acknowledgement = "BSD-Advertising-Acknowledgement" + BSD_Attribution_HPND_disclaimer = "BSD-Attribution-HPND-disclaimer" + BSD_Protection = "BSD-Protection" + BSD_Source_Code = "BSD-Source-Code" + BSL_1_0 = "BSL-1.0" + BUSL_1_1 = "BUSL-1.1" + bzip2_1_0_5 = "bzip2-1.0.5" + bzip2_1_0_6 = "bzip2-1.0.6" + C_UDA_1_0 = "C-UDA-1.0" + CAL_1_0 = "CAL-1.0" + CAL_1_0_Combined_Work_Exception = "CAL-1.0-Combined-Work-Exception" + Caldera = "Caldera" + CATOSL_1_1 = "CATOSL-1.1" + CC_BY_1_0 = "CC-BY-1.0" + CC_BY_2_0 = "CC-BY-2.0" + CC_BY_2_5 = "CC-BY-2.5" + CC_BY_2_5_AU = "CC-BY-2.5-AU" + CC_BY_3_0 = "CC-BY-3.0" + CC_BY_3_0_AT = "CC-BY-3.0-AT" + CC_BY_3_0_DE = "CC-BY-3.0-DE" + CC_BY_3_0_IGO = "CC-BY-3.0-IGO" + CC_BY_3_0_NL = "CC-BY-3.0-NL" + CC_BY_3_0_US = "CC-BY-3.0-US" + CC_BY_4_0 = "CC-BY-4.0" + CC_BY_NC_1_0 = "CC-BY-NC-1.0" + CC_BY_NC_2_0 = "CC-BY-NC-2.0" + CC_BY_NC_2_5 = "CC-BY-NC-2.5" + CC_BY_NC_3_0 = "CC-BY-NC-3.0" + CC_BY_NC_3_0_DE = "CC-BY-NC-3.0-DE" + CC_BY_NC_4_0 = "CC-BY-NC-4.0" + CC_BY_NC_ND_1_0 = "CC-BY-NC-ND-1.0" + CC_BY_NC_ND_2_0 = "CC-BY-NC-ND-2.0" + CC_BY_NC_ND_2_5 = "CC-BY-NC-ND-2.5" + CC_BY_NC_ND_3_0 = "CC-BY-NC-ND-3.0" + CC_BY_NC_ND_3_0_DE = "CC-BY-NC-ND-3.0-DE" + CC_BY_NC_ND_3_0_IGO = "CC-BY-NC-ND-3.0-IGO" + CC_BY_NC_ND_4_0 = "CC-BY-NC-ND-4.0" + CC_BY_NC_SA_1_0 = "CC-BY-NC-SA-1.0" + CC_BY_NC_SA_2_0 = "CC-BY-NC-SA-2.0" + CC_BY_NC_SA_2_0_DE = "CC-BY-NC-SA-2.0-DE" + CC_BY_NC_SA_2_0_FR = "CC-BY-NC-SA-2.0-FR" + CC_BY_NC_SA_2_0_UK = "CC-BY-NC-SA-2.0-UK" + CC_BY_NC_SA_2_5 = "CC-BY-NC-SA-2.5" + CC_BY_NC_SA_3_0 = "CC-BY-NC-SA-3.0" + CC_BY_NC_SA_3_0_DE = "CC-BY-NC-SA-3.0-DE" + CC_BY_NC_SA_3_0_IGO = "CC-BY-NC-SA-3.0-IGO" + CC_BY_NC_SA_4_0 = "CC-BY-NC-SA-4.0" + CC_BY_ND_1_0 = "CC-BY-ND-1.0" + CC_BY_ND_2_0 = "CC-BY-ND-2.0" + CC_BY_ND_2_5 = "CC-BY-ND-2.5" + CC_BY_ND_3_0 = "CC-BY-ND-3.0" + CC_BY_ND_3_0_DE = "CC-BY-ND-3.0-DE" + CC_BY_ND_4_0 = "CC-BY-ND-4.0" + CC_BY_SA_1_0 = "CC-BY-SA-1.0" + CC_BY_SA_2_0 = "CC-BY-SA-2.0" + CC_BY_SA_2_0_UK = "CC-BY-SA-2.0-UK" + CC_BY_SA_2_1_JP = "CC-BY-SA-2.1-JP" + CC_BY_SA_2_5 = "CC-BY-SA-2.5" + CC_BY_SA_3_0 = "CC-BY-SA-3.0" + CC_BY_SA_3_0_AT = "CC-BY-SA-3.0-AT" + CC_BY_SA_3_0_DE = "CC-BY-SA-3.0-DE" + CC_BY_SA_3_0_IGO = "CC-BY-SA-3.0-IGO" + CC_BY_SA_4_0 = "CC-BY-SA-4.0" + CC_PDDC = "CC-PDDC" + CC0_1_0 = "CC0-1.0" + CDDL_1_0 = "CDDL-1.0" + CDDL_1_1 = "CDDL-1.1" + CDL_1_0 = "CDL-1.0" + CDLA_Permissive_1_0 = "CDLA-Permissive-1.0" + CDLA_Permissive_2_0 = "CDLA-Permissive-2.0" + CDLA_Sharing_1_0 = "CDLA-Sharing-1.0" + CECILL_1_0 = "CECILL-1.0" + CECILL_1_1 = "CECILL-1.1" + CECILL_2_0 = "CECILL-2.0" + CECILL_2_1 = "CECILL-2.1" + CECILL_B = "CECILL-B" + CECILL_C = "CECILL-C" + CERN_OHL_1_1 = "CERN-OHL-1.1" + CERN_OHL_1_2 = "CERN-OHL-1.2" + CERN_OHL_P_2_0 = "CERN-OHL-P-2.0" + CERN_OHL_S_2_0 = "CERN-OHL-S-2.0" + CERN_OHL_W_2_0 = "CERN-OHL-W-2.0" + CFITSIO = "CFITSIO" + checkmk = "checkmk" + ClArtistic = "ClArtistic" + Clips = "Clips" + CMU_Mach = "CMU-Mach" + CNRI_Jython = "CNRI-Jython" + CNRI_Python = "CNRI-Python" + CNRI_Python_GPL_Compatible = "CNRI-Python-GPL-Compatible" + COIL_1_0 = "COIL-1.0" + Community_Spec_1_0 = "Community-Spec-1.0" + Condor_1_1 = "Condor-1.1" + copyleft_next_0_3_0 = "copyleft-next-0.3.0" + copyleft_next_0_3_1 = "copyleft-next-0.3.1" + Cornell_Lossless_JPEG = "Cornell-Lossless-JPEG" + CPAL_1_0 = "CPAL-1.0" + CPL_1_0 = "CPL-1.0" + CPOL_1_02 = "CPOL-1.02" + Crossword = "Crossword" + CrystalStacker = "CrystalStacker" + CUA_OPL_1_0 = "CUA-OPL-1.0" + Cube = "Cube" + curl = "curl" + D_FSL_1_0 = "D-FSL-1.0" + diffmark = "diffmark" + DL_DE_BY_2_0 = "DL-DE-BY-2.0" + DOC = "DOC" + Dotseqn = "Dotseqn" + DRL_1_0 = "DRL-1.0" + DSDP = "DSDP" + dtoa = "dtoa" + dvipdfm = "dvipdfm" + ECL_1_0 = "ECL-1.0" + ECL_2_0 = "ECL-2.0" + eCos_2_0 = "eCos-2.0" + EFL_1_0 = "EFL-1.0" + EFL_2_0 = "EFL-2.0" + eGenix = "eGenix" + Elastic_2_0 = "Elastic-2.0" + Entessa = "Entessa" + EPICS = "EPICS" + EPL_1_0 = "EPL-1.0" + EPL_2_0 = "EPL-2.0" + ErlPL_1_1 = "ErlPL-1.1" + etalab_2_0 = "etalab-2.0" + EUDatagrid = "EUDatagrid" + EUPL_1_0 = "EUPL-1.0" + EUPL_1_1 = "EUPL-1.1" + EUPL_1_2 = "EUPL-1.2" + Eurosym = "Eurosym" + Fair = "Fair" + FDK_AAC = "FDK-AAC" + Frameworx_1_0 = "Frameworx-1.0" + FreeBSD_DOC = "FreeBSD-DOC" + FreeImage = "FreeImage" + FSFAP = "FSFAP" + FSFUL = "FSFUL" + FSFULLR = "FSFULLR" + FSFULLRWD = "FSFULLRWD" + FTL = "FTL" + GD = "GD" + GFDL_1_1 = "GFDL-1.1" + GFDL_1_1_invariants_only = "GFDL-1.1-invariants-only" + GFDL_1_1_invariants_or_later = "GFDL-1.1-invariants-or-later" + GFDL_1_1_no_invariants_only = "GFDL-1.1-no-invariants-only" + GFDL_1_1_no_invariants_or_later = "GFDL-1.1-no-invariants-or-later" + GFDL_1_1_only = "GFDL-1.1-only" + GFDL_1_1_or_later = "GFDL-1.1-or-later" + GFDL_1_2 = "GFDL-1.2" + GFDL_1_2_invariants_only = "GFDL-1.2-invariants-only" + GFDL_1_2_invariants_or_later = "GFDL-1.2-invariants-or-later" + GFDL_1_2_no_invariants_only = "GFDL-1.2-no-invariants-only" + GFDL_1_2_no_invariants_or_later = "GFDL-1.2-no-invariants-or-later" + GFDL_1_2_only = "GFDL-1.2-only" + GFDL_1_2_or_later = "GFDL-1.2-or-later" + GFDL_1_3 = "GFDL-1.3" + GFDL_1_3_invariants_only = "GFDL-1.3-invariants-only" + GFDL_1_3_invariants_or_later = "GFDL-1.3-invariants-or-later" + GFDL_1_3_no_invariants_only = "GFDL-1.3-no-invariants-only" + GFDL_1_3_no_invariants_or_later = "GFDL-1.3-no-invariants-or-later" + GFDL_1_3_only = "GFDL-1.3-only" + GFDL_1_3_or_later = "GFDL-1.3-or-later" + Giftware = "Giftware" + GL2PS = "GL2PS" + Glide = "Glide" + Glulxe = "Glulxe" + GLWTPL = "GLWTPL" + gnuplot = "gnuplot" + GPL_1_0 = "GPL-1.0" + GPL_1_0_ = "GPL-1.0+" + GPL_1_0_only = "GPL-1.0-only" + GPL_1_0_or_later = "GPL-1.0-or-later" + GPL_2_0 = "GPL-2.0" + GPL_2_0_ = "GPL-2.0+" + GPL_2_0_only = "GPL-2.0-only" + GPL_2_0_or_later = "GPL-2.0-or-later" + GPL_2_0_with_autoconf_exception = "GPL-2.0-with-autoconf-exception" + GPL_2_0_with_bison_exception = "GPL-2.0-with-bison-exception" + GPL_2_0_with_classpath_exception = "GPL-2.0-with-classpath-exception" + GPL_2_0_with_font_exception = "GPL-2.0-with-font-exception" + GPL_2_0_with_GCC_exception = "GPL-2.0-with-GCC-exception" + GPL_3_0 = "GPL-3.0" + GPL_3_0_ = "GPL-3.0+" + GPL_3_0_only = "GPL-3.0-only" + GPL_3_0_or_later = "GPL-3.0-or-later" + GPL_3_0_with_autoconf_exception = "GPL-3.0-with-autoconf-exception" + GPL_3_0_with_GCC_exception = "GPL-3.0-with-GCC-exception" + Graphics_Gems = "Graphics-Gems" + gSOAP_1_3b = "gSOAP-1.3b" + HaskellReport = "HaskellReport" + Hippocratic_2_1 = "Hippocratic-2.1" + HP_1986 = "HP-1986" + HPND = "HPND" + HPND_export_US = "HPND-export-US" + HPND_Markus_Kuhn = "HPND-Markus-Kuhn" + HPND_sell_variant = "HPND-sell-variant" + HPND_sell_variant_MIT_disclaimer = "HPND-sell-variant-MIT-disclaimer" + HTMLTIDY = "HTMLTIDY" + IBM_pibs = "IBM-pibs" + ICU = "ICU" + IEC_Code_Components_EULA = "IEC-Code-Components-EULA" + IJG = "IJG" + IJG_short = "IJG-short" + ImageMagick = "ImageMagick" + iMatix = "iMatix" + Imlib2 = "Imlib2" + Info_ZIP = "Info-ZIP" + Inner_Net_2_0 = "Inner-Net-2.0" + Intel = "Intel" + Intel_ACPI = "Intel-ACPI" + Interbase_1_0 = "Interbase-1.0" + IPA = "IPA" + IPL_1_0 = "IPL-1.0" + ISC = "ISC" + Jam = "Jam" + JasPer_2_0 = "JasPer-2.0" + JPL_image = "JPL-image" + JPNIC = "JPNIC" + JSON = "JSON" + Kazlib = "Kazlib" + Knuth_CTAN = "Knuth-CTAN" + LAL_1_2 = "LAL-1.2" + LAL_1_3 = "LAL-1.3" + Latex2e = "Latex2e" + Latex2e_translated_notice = "Latex2e-translated-notice" + Leptonica = "Leptonica" + LGPL_2_0 = "LGPL-2.0" + LGPL_2_0_ = "LGPL-2.0+" + LGPL_2_0_only = "LGPL-2.0-only" + LGPL_2_0_or_later = "LGPL-2.0-or-later" + LGPL_2_1 = "LGPL-2.1" + LGPL_2_1_ = "LGPL-2.1+" + LGPL_2_1_only = "LGPL-2.1-only" + LGPL_2_1_or_later = "LGPL-2.1-or-later" + LGPL_3_0 = "LGPL-3.0" + LGPL_3_0_ = "LGPL-3.0+" + LGPL_3_0_only = "LGPL-3.0-only" + LGPL_3_0_or_later = "LGPL-3.0-or-later" + LGPLLR = "LGPLLR" + Libpng = "Libpng" + libpng_2_0 = "libpng-2.0" + libselinux_1_0 = "libselinux-1.0" + libtiff = "libtiff" + libutil_David_Nugent = "libutil-David-Nugent" + LiLiQ_P_1_1 = "LiLiQ-P-1.1" + LiLiQ_R_1_1 = "LiLiQ-R-1.1" + LiLiQ_Rplus_1_1 = "LiLiQ-Rplus-1.1" + Linux_man_pages_1_para = "Linux-man-pages-1-para" + Linux_man_pages_copyleft = "Linux-man-pages-copyleft" + Linux_man_pages_copyleft_2_para = "Linux-man-pages-copyleft-2-para" + Linux_man_pages_copyleft_var = "Linux-man-pages-copyleft-var" + Linux_OpenIB = "Linux-OpenIB" + LOOP = "LOOP" + LPL_1_0 = "LPL-1.0" + LPL_1_02 = "LPL-1.02" + LPPL_1_0 = "LPPL-1.0" + LPPL_1_1 = "LPPL-1.1" + LPPL_1_2 = "LPPL-1.2" + LPPL_1_3a = "LPPL-1.3a" + LPPL_1_3c = "LPPL-1.3c" + LZMA_SDK_9_11_to_9_20 = "LZMA-SDK-9.11-to-9.20" + LZMA_SDK_9_22 = "LZMA-SDK-9.22" + MakeIndex = "MakeIndex" + Martin_Birgmeier = "Martin-Birgmeier" + metamail = "metamail" + Minpack = "Minpack" + MirOS = "MirOS" + MIT = "MIT" + MIT_0 = "MIT-0" + MIT_advertising = "MIT-advertising" + MIT_CMU = "MIT-CMU" + MIT_enna = "MIT-enna" + MIT_feh = "MIT-feh" + MIT_Festival = "MIT-Festival" + MIT_Modern_Variant = "MIT-Modern-Variant" + MIT_open_group = "MIT-open-group" + MIT_Wu = "MIT-Wu" + MITNFA = "MITNFA" + Motosoto = "Motosoto" + mpi_permissive = "mpi-permissive" + mpich2 = "mpich2" + MPL_1_0 = "MPL-1.0" + MPL_1_1 = "MPL-1.1" + MPL_2_0 = "MPL-2.0" + MPL_2_0_no_copyleft_exception = "MPL-2.0-no-copyleft-exception" + mplus = "mplus" + MS_LPL = "MS-LPL" + MS_PL = "MS-PL" + MS_RL = "MS-RL" + MTLL = "MTLL" + MulanPSL_1_0 = "MulanPSL-1.0" + MulanPSL_2_0 = "MulanPSL-2.0" + Multics = "Multics" + Mup = "Mup" + NAIST_2003 = "NAIST-2003" + NASA_1_3 = "NASA-1.3" + Naumen = "Naumen" + NBPL_1_0 = "NBPL-1.0" + NCGL_UK_2_0 = "NCGL-UK-2.0" + NCSA = "NCSA" + Net_SNMP = "Net-SNMP" + NetCDF = "NetCDF" + Newsletr = "Newsletr" + NGPL = "NGPL" + NICTA_1_0 = "NICTA-1.0" + NIST_PD = "NIST-PD" + NIST_PD_fallback = "NIST-PD-fallback" + NIST_Software = "NIST-Software" + NLOD_1_0 = "NLOD-1.0" + NLOD_2_0 = "NLOD-2.0" + NLPL = "NLPL" + Nokia = "Nokia" + NOSL = "NOSL" + Noweb = "Noweb" + NPL_1_0 = "NPL-1.0" + NPL_1_1 = "NPL-1.1" + NPOSL_3_0 = "NPOSL-3.0" + NRL = "NRL" + NTP = "NTP" + NTP_0 = "NTP-0" + Nunit = "Nunit" + O_UDA_1_0 = "O-UDA-1.0" + OCCT_PL = "OCCT-PL" + OCLC_2_0 = "OCLC-2.0" + ODbL_1_0 = "ODbL-1.0" + ODC_By_1_0 = "ODC-By-1.0" + OFFIS = "OFFIS" + OFL_1_0 = "OFL-1.0" + OFL_1_0_no_RFN = "OFL-1.0-no-RFN" + OFL_1_0_RFN = "OFL-1.0-RFN" + OFL_1_1 = "OFL-1.1" + OFL_1_1_no_RFN = "OFL-1.1-no-RFN" + OFL_1_1_RFN = "OFL-1.1-RFN" + OGC_1_0 = "OGC-1.0" + OGDL_Taiwan_1_0 = "OGDL-Taiwan-1.0" + OGL_Canada_2_0 = "OGL-Canada-2.0" + OGL_UK_1_0 = "OGL-UK-1.0" + OGL_UK_2_0 = "OGL-UK-2.0" + OGL_UK_3_0 = "OGL-UK-3.0" + OGTSL = "OGTSL" + OLDAP_1_1 = "OLDAP-1.1" + OLDAP_1_2 = "OLDAP-1.2" + OLDAP_1_3 = "OLDAP-1.3" + OLDAP_1_4 = "OLDAP-1.4" + OLDAP_2_0 = "OLDAP-2.0" + OLDAP_2_0_1 = "OLDAP-2.0.1" + OLDAP_2_1 = "OLDAP-2.1" + OLDAP_2_2 = "OLDAP-2.2" + OLDAP_2_2_1 = "OLDAP-2.2.1" + OLDAP_2_2_2 = "OLDAP-2.2.2" + OLDAP_2_3 = "OLDAP-2.3" + OLDAP_2_4 = "OLDAP-2.4" + OLDAP_2_5 = "OLDAP-2.5" + OLDAP_2_6 = "OLDAP-2.6" + OLDAP_2_7 = "OLDAP-2.7" + OLDAP_2_8 = "OLDAP-2.8" + OLFL_1_3 = "OLFL-1.3" + OML = "OML" + OpenPBS_2_3 = "OpenPBS-2.3" + OpenSSL = "OpenSSL" + OPL_1_0 = "OPL-1.0" + OPL_UK_3_0 = "OPL-UK-3.0" + OPUBL_1_0 = "OPUBL-1.0" + OSET_PL_2_1 = "OSET-PL-2.1" + OSL_1_0 = "OSL-1.0" + OSL_1_1 = "OSL-1.1" + OSL_2_0 = "OSL-2.0" + OSL_2_1 = "OSL-2.1" + OSL_3_0 = "OSL-3.0" + Parity_6_0_0 = "Parity-6.0.0" + Parity_7_0_0 = "Parity-7.0.0" + PDDL_1_0 = "PDDL-1.0" + PHP_3_0 = "PHP-3.0" + PHP_3_01 = "PHP-3.01" + Plexus = "Plexus" + PolyForm_Noncommercial_1_0_0 = "PolyForm-Noncommercial-1.0.0" + PolyForm_Small_Business_1_0_0 = "PolyForm-Small-Business-1.0.0" + PostgreSQL = "PostgreSQL" + PSF_2_0 = "PSF-2.0" + psfrag = "psfrag" + psutils = "psutils" + Python_2_0 = "Python-2.0" + Python_2_0_1 = "Python-2.0.1" + Qhull = "Qhull" + QPL_1_0 = "QPL-1.0" + QPL_1_0_INRIA_2004 = "QPL-1.0-INRIA-2004" + Rdisc = "Rdisc" + RHeCos_1_1 = "RHeCos-1.1" + RPL_1_1 = "RPL-1.1" + RPL_1_5 = "RPL-1.5" + RPSL_1_0 = "RPSL-1.0" + RSA_MD = "RSA-MD" + RSCPL = "RSCPL" + Ruby = "Ruby" + SAX_PD = "SAX-PD" + Saxpath = "Saxpath" + SCEA = "SCEA" + SchemeReport = "SchemeReport" + Sendmail = "Sendmail" + Sendmail_8_23 = "Sendmail-8.23" + SGI_B_1_0 = "SGI-B-1.0" + SGI_B_1_1 = "SGI-B-1.1" + SGI_B_2_0 = "SGI-B-2.0" + SGP4 = "SGP4" + SHL_0_5 = "SHL-0.5" + SHL_0_51 = "SHL-0.51" + SimPL_2_0 = "SimPL-2.0" + SISSL = "SISSL" + SISSL_1_2 = "SISSL-1.2" + Sleepycat = "Sleepycat" + SMLNJ = "SMLNJ" + SMPPL = "SMPPL" + SNIA = "SNIA" + snprintf = "snprintf" + Spencer_86 = "Spencer-86" + Spencer_94 = "Spencer-94" + Spencer_99 = "Spencer-99" + SPL_1_0 = "SPL-1.0" + SSH_OpenSSH = "SSH-OpenSSH" + SSH_short = "SSH-short" + SSPL_1_0 = "SSPL-1.0" + StandardML_NJ = "StandardML-NJ" + SugarCRM_1_1_3 = "SugarCRM-1.1.3" + SunPro = "SunPro" + SWL = "SWL" + Symlinks = "Symlinks" + TAPR_OHL_1_0 = "TAPR-OHL-1.0" + TCL = "TCL" + TCP_wrappers = "TCP-wrappers" + TermReadKey = "TermReadKey" + TMate = "TMate" + TORQUE_1_1 = "TORQUE-1.1" + TOSL = "TOSL" + TPDL = "TPDL" + TPL_1_0 = "TPL-1.0" + TTWL = "TTWL" + TU_Berlin_1_0 = "TU-Berlin-1.0" + TU_Berlin_2_0 = "TU-Berlin-2.0" + UCAR = "UCAR" + UCL_1_0 = "UCL-1.0" + Unicode_DFS_2015 = "Unicode-DFS-2015" + Unicode_DFS_2016 = "Unicode-DFS-2016" + Unicode_TOU = "Unicode-TOU" + UnixCrypt = "UnixCrypt" + Unlicense = "Unlicense" + UPL_1_0 = "UPL-1.0" + Vim = "Vim" + VOSTROM = "VOSTROM" + VSL_1_0 = "VSL-1.0" + W3C = "W3C" + W3C_19980720 = "W3C-19980720" + W3C_20150513 = "W3C-20150513" + w3m = "w3m" + Watcom_1_0 = "Watcom-1.0" + Widget_Workshop = "Widget-Workshop" + Wsuipa = "Wsuipa" + WTFPL = "WTFPL" + wxWindows = "wxWindows" + X11 = "X11" + X11_distribute_modifications_variant = "X11-distribute-modifications-variant" + Xdebug_1_03 = "Xdebug-1.03" + Xerox = "Xerox" + Xfig = "Xfig" + XFree86_1_1 = "XFree86-1.1" + xinetd = "xinetd" + xlock = "xlock" + Xnet = "Xnet" + xpp = "xpp" + XSkat = "XSkat" + YPL_1_0 = "YPL-1.0" + YPL_1_1 = "YPL-1.1" + Zed = "Zed" + Zend_2_0 = "Zend-2.0" + Zimbra_1_3 = "Zimbra-1.3" + Zimbra_1_4 = "Zimbra-1.4" + Zlib = "Zlib" + zlib_acknowledgement = "zlib-acknowledgement" + ZPL_1_1 = "ZPL-1.1" + ZPL_2_0 = "ZPL-2.0" + ZPL_2_1 = "ZPL-2.1" + field_389_exception = "389-exception" + Asterisk_exception = "Asterisk-exception" + Autoconf_exception_2_0 = "Autoconf-exception-2.0" + Autoconf_exception_3_0 = "Autoconf-exception-3.0" + Autoconf_exception_generic = "Autoconf-exception-generic" + Autoconf_exception_macro = "Autoconf-exception-macro" + Bison_exception_2_2 = "Bison-exception-2.2" + Bootloader_exception = "Bootloader-exception" + Classpath_exception_2_0 = "Classpath-exception-2.0" + CLISP_exception_2_0 = "CLISP-exception-2.0" + cryptsetup_OpenSSL_exception = "cryptsetup-OpenSSL-exception" + DigiRule_FOSS_exception = "DigiRule-FOSS-exception" + eCos_exception_2_0 = "eCos-exception-2.0" + Fawkes_Runtime_exception = "Fawkes-Runtime-exception" + FLTK_exception = "FLTK-exception" + Font_exception_2_0 = "Font-exception-2.0" + freertos_exception_2_0 = "freertos-exception-2.0" + GCC_exception_2_0 = "GCC-exception-2.0" + GCC_exception_3_1 = "GCC-exception-3.1" + GNAT_exception = "GNAT-exception" + gnu_javamail_exception = "gnu-javamail-exception" + GPL_3_0_interface_exception = "GPL-3.0-interface-exception" + GPL_3_0_linking_exception = "GPL-3.0-linking-exception" + GPL_3_0_linking_source_exception = "GPL-3.0-linking-source-exception" + GPL_CC_1_0 = "GPL-CC-1.0" + GStreamer_exception_2005 = "GStreamer-exception-2005" + GStreamer_exception_2008 = "GStreamer-exception-2008" + i2p_gpl_java_exception = "i2p-gpl-java-exception" + KiCad_libraries_exception = "KiCad-libraries-exception" + LGPL_3_0_linking_exception = "LGPL-3.0-linking-exception" + libpri_OpenH323_exception = "libpri-OpenH323-exception" + Libtool_exception = "Libtool-exception" + Linux_syscall_note = "Linux-syscall-note" + LLGPL = "LLGPL" + LLVM_exception = "LLVM-exception" + LZMA_exception = "LZMA-exception" + mif_exception = "mif-exception" + Nokia_Qt_exception_1_1 = "Nokia-Qt-exception-1.1" + OCaml_LGPL_linking_exception = "OCaml-LGPL-linking-exception" + OCCT_exception_1_0 = "OCCT-exception-1.0" + OpenJDK_assembly_exception_1_0 = "OpenJDK-assembly-exception-1.0" + openvpn_openssl_exception = "openvpn-openssl-exception" + PS_or_PDF_font_exception_20170817 = "PS-or-PDF-font-exception-20170817" + QPL_1_0_INRIA_2004_exception = "QPL-1.0-INRIA-2004-exception" + Qt_GPL_exception_1_0 = "Qt-GPL-exception-1.0" + Qt_LGPL_exception_1_1 = "Qt-LGPL-exception-1.1" + Qwt_exception_1_0 = "Qwt-exception-1.0" + SHL_2_0 = "SHL-2.0" + SHL_2_1 = "SHL-2.1" + SWI_exception = "SWI-exception" + Swift_exception = "Swift-exception" + u_boot_exception_2_0 = "u-boot-exception-2.0" + Universal_FOSS_exception_1_0 = "Universal-FOSS-exception-1.0" + vsftpd_openssl_exception = "vsftpd-openssl-exception" + WxWindows_exception_3_1 = "WxWindows-exception-3.1" + x11vnc_openssl_exception = "x11vnc-openssl-exception" diff --git a/blint/cyclonedx/spec.py b/blint/cyclonedx/spec.py new file mode 100644 index 0000000..7956cc8 --- /dev/null +++ b/blint/cyclonedx/spec.py @@ -0,0 +1,3440 @@ +# generated by datamodel-codegen: +# filename: bom-1.5.schema.json +# timestamp: 2024-02-03T14:05:08+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import List, Optional, Union + +from pydantic import ( + AnyUrl, + AwareDatetime, + BaseModel, + ConfigDict, + EmailStr, + Field, + RootModel, + confloat, + conint, + constr, +) + +from . import spdx + + +class FieldSchema(Enum): + http___cyclonedx_org_schema_bom_1_5_schema_json = ( + "http://cyclonedx.org/schema/bom-1.5.schema.json" + ) + + +class BomFormat(Enum): + CycloneDX = "CycloneDX" + + +class RefType(RootModel[constr(min_length=1)]): + root: constr(min_length=1) = Field( + ..., + description="Identifier for referable and therefore interlink-able elements.", + ) + + +class RefLinkType(BaseModel): + pass + + +class BomLinkDocumentType( + RootModel[ + constr( + pattern=r"^urn:cdx:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[1-9][0-9]*$" + ) + ] +): + root: constr( + pattern=r"^urn:cdx:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[1-9][0-9]*$" + ) = Field( + ..., + description="Descriptor for another BOM document. See https://cyclonedx.org/capabilities/bomlink/", + title="BOM-Link Document", + ) + + +class BomLinkElementType( + RootModel[ + constr( + pattern=r"^urn:cdx:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[1-9][0-9]*#.+$" + ) + ] +): + root: constr( + pattern=r"^urn:cdx:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[1-9][0-9]*#.+$" + ) = Field( + ..., + description="Descriptor for an element in a BOM document. See https://cyclonedx.org/capabilities/bomlink/", + title="BOM-Link Element", + ) + + +class BomLink(RootModel[Union[BomLinkDocumentType, BomLinkElementType]]): + root: Union[BomLinkDocumentType, BomLinkElementType] + + +class Phase(Enum): + design = "design" + pre_build = "pre-build" + build = "build" + post_build = "post-build" + operations = "operations" + discovery = "discovery" + decommission = "decommission" + + +class Lifecycles(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + phase: Phase = Field( + ..., + description="A pre-defined phase in the product lifecycle.\n\n* __design__ = BOM produced early in the development lifecycle containing inventory of components and services that are proposed or planned to be used. The inventory may need to be procured, retrieved, or resourced prior to use.\n* __pre-build__ = BOM consisting of information obtained prior to a build process and may contain source files and development artifacts and manifests. The inventory may need to be resolved and retrieved prior to use.\n* __build__ = BOM consisting of information obtained during a build process where component inventory is available for use. The precise versions of resolved components are usually available at this time as well as the provenance of where the components were retrieved from.\n* __post-build__ = BOM consisting of information obtained after a build process has completed and the resulting components(s) are available for further analysis. Built components may exist as the result of a CI/CD process, may have been installed or deployed to a system or device, and may need to be retrieved or extracted from the system or device.\n* __operations__ = BOM produced that represents inventory that is running and operational. This may include staging or production environments and will generally encompass multiple SBOMs describing the applications and operating system, along with HBOMs describing the hardware that makes up the system. Operations Bill of Materials (OBOM) can provide full-stack inventory of runtime environments, configurations, and additional dependencies.\n* __discovery__ = BOM consisting of information observed through network discovery providing point-in-time enumeration of embedded, on-premise, and cloud-native services such as server applications, connected devices, microservices, and serverless functions.\n* __decommission__ = BOM containing inventory that will be, or has been retired from operations.", + title="Phase", + ) + + +class Lifecycles1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str = Field(..., description="The name of the lifecycle phase", title="Name") + description: Optional[str] = Field( + None, description="The description of the lifecycle phase", title="Description" + ) + + +class OrganizationalContact(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the object elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + name: Optional[str] = Field( + None, + description="The name of a contact", + examples=["Contact name"], + title="Name", + ) + email: Optional[EmailStr] = Field( + None, + description="The email address of the contact.", + examples=["firstname.lastname@example.com"], + title="Email Address", + ) + phone: Optional[str] = Field( + None, + description="The phone number of the contact.", + examples=["800-555-1212"], + title="Phone", + ) + + +class Type(Enum): + application = "application" + framework = "framework" + library = "library" + container = "container" + platform = "platform" + operating_system = "operating-system" + device = "device" + device_driver = "device-driver" + firmware = "firmware" + file = "file" + machine_learning_model = "machine-learning-model" + data = "data" + + +class Scope(Enum): + required = "required" + optional = "optional" + excluded = "excluded" + + +class Encoding(Enum): + base64 = "base64" + + +class Attachment(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + contentType: Optional[str] = Field( + "text/plain", + description="Specifies the content type of the text. Defaults to text/plain if not specified.", + title="Content-Type", + ) + encoding: Optional[Encoding] = Field( + None, + description="Specifies the optional encoding the text is represented in.", + title="Encoding", + ) + content: str = Field( + ..., + description="The attachment data. Proactive controls such as input validation and sanitization should be employed to prevent misuse of attachment text.", + title="Attachment Text", + ) + + +class HashAlg(Enum): + MD5 = "MD5" + SHA_1 = "SHA-1" + SHA_256 = "SHA-256" + SHA_384 = "SHA-384" + SHA_512 = "SHA-512" + SHA3_256 = "SHA3-256" + SHA3_384 = "SHA3-384" + SHA3_512 = "SHA3-512" + BLAKE2b_256 = "BLAKE2b-256" + BLAKE2b_384 = "BLAKE2b-384" + BLAKE2b_512 = "BLAKE2b-512" + BLAKE3 = "BLAKE3" + + +class HashContent( + RootModel[ + constr( + pattern=r"^([a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64}|[a-fA-F0-9]{96}|[a-fA-F0-9]{128})$" + ) + ] +): + root: constr( + pattern=r"^([a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64}|[a-fA-F0-9]{96}|[a-fA-F0-9]{128})$" + ) = Field( + ..., examples=["3942447fac867ae5cdb3229b658f4d48"], title="Hash Content (value)" + ) + + +class LicenseType(Enum): + academic = "academic" + appliance = "appliance" + client_access = "client-access" + concurrent_user = "concurrent-user" + core_points = "core-points" + custom_metric = "custom-metric" + device = "device" + evaluation = "evaluation" + named_user = "named-user" + node_locked = "node-locked" + oem = "oem" + perpetual = "perpetual" + processor_points = "processor-points" + subscription = "subscription" + user = "user" + other = "other" + + +class LicenseChoice(RootModel[List]): + root: List = Field( + ..., + description="EITHER (list of SPDX licenses and/or named licenses) OR (tuple of one SPDX License Expression)", + title="License Choice", + ) + + +class Type1(Enum): + unofficial = "unofficial" + monkey = "monkey" + backport = "backport" + cherry_pick = "cherry-pick" + + +class Diff(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + text: Optional[Attachment] = Field( + None, description="Specifies the optional text of the diff", title="Diff text" + ) + url: Optional[str] = Field( + None, description="Specifies the URL to the diff", title="URL" + ) + + +class Type2(Enum): + defect = "defect" + enhancement = "enhancement" + security = "security" + + +class Source(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = Field( + None, + description="The name of the source. For example 'National Vulnerability Database', 'NVD', and 'Apache'", + title="Name", + ) + url: Optional[str] = Field( + None, + description="The url of the issue documentation as provided by the source", + title="URL", + ) + + +class Issue(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Type2 = Field(..., description="Specifies the type of issue", title="Type") + id: Optional[str] = Field( + None, + description="The identifier of the issue assigned by the source of the issue", + title="ID", + ) + name: Optional[str] = Field(None, description="The name of the issue", title="Name") + description: Optional[str] = Field( + None, description="A description of the issue", title="Description" + ) + source: Optional[Source] = Field( + None, + description="The source of the issue where it is documented", + title="Source", + ) + references: Optional[List[str]] = Field( + None, + description="A collection of URL's for reference. Multiple URLs are allowed.", + examples=["https://example.com"], + title="References", + ) + + +class IdentifiableAction(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + timestamp: Optional[AwareDatetime] = Field( + None, + description="The timestamp in which the action occurred", + title="Timestamp", + ) + name: Optional[str] = Field( + None, + description="The name of the individual who performed the action", + title="Name", + ) + email: Optional[EmailStr] = Field( + None, + description="The email address of the individual who performed the action", + title="E-mail", + ) + + +class Type3(Enum): + vcs = "vcs" + issue_tracker = "issue-tracker" + website = "website" + advisories = "advisories" + bom = "bom" + mailing_list = "mailing-list" + social = "social" + chat = "chat" + documentation = "documentation" + support = "support" + distribution = "distribution" + distribution_intake = "distribution-intake" + license = "license" + build_meta = "build-meta" + build_system = "build-system" + release_notes = "release-notes" + security_contact = "security-contact" + model_card = "model-card" + log = "log" + configuration = "configuration" + evidence = "evidence" + formulation = "formulation" + attestation = "attestation" + threat_model = "threat-model" + adversary_model = "adversary-model" + risk_assessment = "risk-assessment" + vulnerability_assertion = "vulnerability-assertion" + exploitability_statement = "exploitability-statement" + pentest_report = "pentest-report" + static_analysis_report = "static-analysis-report" + dynamic_analysis_report = "dynamic-analysis-report" + runtime_analysis_report = "runtime-analysis-report" + component_analysis_report = "component-analysis-report" + maturity_report = "maturity-report" + certification_report = "certification-report" + codified_infrastructure = "codified-infrastructure" + quality_metrics = "quality-metrics" + poam = "poam" + other = "other" + + +class Dependency(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + ref: RefLinkType = Field( + ..., + description="References a component or service by its bom-ref attribute", + title="Reference", + ) + dependsOn: Optional[List[RefLinkType]] = Field( + None, + description="The bom-ref identifiers of the components or services that are dependencies of this dependency object.", + title="Depends On", + ) + + +class DataFlowDirection(Enum): + inbound = "inbound" + outbound = "outbound" + bi_directional = "bi-directional" + unknown = "unknown" + + +class Copyright(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + text: str = Field(..., title="Copyright Text") + + +class FieldModel(Enum): + group = "group" + name = "name" + version = "version" + purl = "purl" + cpe = "cpe" + swid = "swid" + hash = "hash" + + +class Technique(Enum): + source_code_analysis = "source-code-analysis" + binary_analysis = "binary-analysis" + manifest_analysis = "manifest-analysis" + ast_fingerprint = "ast-fingerprint" + hash_comparison = "hash-comparison" + instrumentation = "instrumentation" + dynamic_analysis = "dynamic-analysis" + filename = "filename" + attestation = "attestation" + other = "other" + + +class Method(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + technique: Technique = Field( + ..., + description="The technique used in this method of analysis.", + title="Technique", + ) + confidence: confloat(ge=0.0, le=1.0) = Field( + ..., + description="The confidence of the evidence from 0 - 1, where 1 is 100% confidence. Confidence is specific to the technique used. Each technique of analysis can have independent confidence.", + title="Confidence", + ) + value: Optional[str] = Field( + None, description="The value or contents of the evidence.", title="Value" + ) + + +class Identity(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + field: FieldModel = Field( + ..., + description="The identity field of the component which the evidence describes.", + title="Field", + ) + confidence: Optional[confloat(ge=0.0, le=1.0)] = Field( + None, + description="The overall confidence of the evidence from 0 - 1, where 1 is 100% confidence.", + title="Confidence", + ) + methods: Optional[List[Method]] = Field( + None, + description="The methods used to extract and/or analyze the evidence.", + title="Methods", + ) + tools: Optional[List[Union[RefLinkType, BomLinkElementType]]] = Field( + None, + description="The object in the BOM identified by its bom-ref. This is often a component or service, but may be any object type supporting bom-refs. Tools used for analysis should already be defined in the BOM, either in the metadata/tools, components, or formulation.", + title="BOM References", + ) + + +class Occurrence(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the occurrence elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + location: str = Field( + ..., + description="The location or path to where the component was found.", + title="Location", + ) + + +class Frame(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + package: Optional[str] = Field( + None, + description="A package organizes modules into namespaces, providing a unique namespace for each type it contains.", + title="Package", + ) + module: str = Field( + ..., + description="A module or class that encloses functions/methods and other code.", + title="Module", + ) + function: Optional[str] = Field( + None, + description="A block of code designed to perform a particular task.", + title="Function", + ) + parameters: Optional[List[str]] = Field( + None, + description="Optional arguments that are passed to the module or function.", + title="Parameters", + ) + line: Optional[int] = Field( + None, + description="The line number the code that is called resides on.", + title="Line", + ) + column: Optional[int] = Field( + None, description="The column the code that is called resides.", title="Column" + ) + fullFilename: Optional[str] = Field( + None, + description="The full path and filename of the module.", + title="Full Filename", + ) + + +class Callstack(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + frames: Optional[List[Frame]] = Field(None, title="Methods") + + +class ComponentEvidence(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + identity: Optional[Identity] = Field( + None, description="Evidence that substantiates the identity of a component." + ) + occurrences: Optional[List[Occurrence]] = Field( + None, + description="Evidence of individual instances of a component spread across multiple locations.", + title="Occurrences", + ) + callstack: Optional[Callstack] = Field( + None, description="Evidence of the components use through the callstack." + ) + licenses: Optional[LicenseChoice] = Field(None, title="Component License(s)") + copyright: Optional[List[Copyright]] = Field(None, title="Copyright") + + +class AggregateType(Enum): + complete = "complete" + incomplete = "incomplete" + incomplete_first_party_only = "incomplete_first_party_only" + incomplete_first_party_proprietary_only = "incomplete_first_party_proprietary_only" + incomplete_first_party_opensource_only = "incomplete_first_party_opensource_only" + incomplete_third_party_only = "incomplete_third_party_only" + incomplete_third_party_proprietary_only = "incomplete_third_party_proprietary_only" + incomplete_third_party_opensource_only = "incomplete_third_party_opensource_only" + unknown = "unknown" + not_specified = "not_specified" + + +class Property(BaseModel): + name: Optional[str] = Field( + None, + description="The name of the property. Duplicate names are allowed, each potentially having a different value.", + title="Name", + ) + value: Optional[str] = Field( + None, description="The value of the property.", title="Value" + ) + + +class LocaleType(RootModel[constr(pattern=r"^([a-z]{2})(-[A-Z]{2})?$")]): + root: constr(pattern=r"^([a-z]{2})(-[A-Z]{2})?$") = Field( + ..., + description="Defines a syntax for representing two character language code (ISO-639) followed by an optional two character country code. The language code MUST be lower case. If the country code is specified, the country code MUST be upper case. The language code and country code MUST be separated by a minus sign. Examples: en, en-US, fr, fr-CA", + title="Locale", + ) + + +class ReleaseType(RootModel[str]): + root: str = Field( + ..., + description="The software versioning type. It is RECOMMENDED that the release type use one of 'major', 'minor', 'patch', 'pre-release', or 'internal'. Representing all possible software release types is not practical, so standardizing on the recommended values, whenever possible, is strongly encouraged.\n\n* __major__ = A major release may contain significant changes or may introduce breaking changes.\n* __minor__ = A minor release, also known as an update, may contain a smaller number of changes than major releases.\n* __patch__ = Patch releases are typically unplanned and may resolve defects or important security issues.\n* __pre-release__ = A pre-release may include alpha, beta, or release candidates and typically have limited support. They provide the ability to preview a release prior to its general availability.\n* __internal__ = Internal releases are not for public consumption and are intended to be used exclusively by the project or manufacturer that produced it.", + examples=["major", "minor", "patch", "pre-release", "internal"], + ) + + +class Note(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + locale: Optional[LocaleType] = Field( + None, + description='The ISO-639 (or higher) language code and optional ISO-3166 (or higher) country code. Examples include: "en", "en-US", "fr" and "fr-CA"', + title="Locale", + ) + text: Attachment = Field( + ..., + description="Specifies the full content of the release note.", + title="Release note content", + ) + + +class ReleaseNotes(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: ReleaseType = Field( + ..., + description="The software versioning type the release note describes.", + title="Type", + ) + title: Optional[str] = Field( + None, description="The title of the release.", title="Title" + ) + featuredImage: Optional[str] = Field( + None, + description="The URL to an image that may be prominently displayed with the release note.", + title="Featured image", + ) + socialImage: Optional[str] = Field( + None, + description="The URL to an image that may be used in messaging on social media platforms.", + title="Social image", + ) + description: Optional[str] = Field( + None, description="A short description of the release.", title="Description" + ) + timestamp: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the release note was created.", + title="Timestamp", + ) + aliases: Optional[List[str]] = Field( + None, + description="One or more alternate names the release may be referred to. This may include unofficial terms used by development and marketing teams (e.g. code names).", + title="Aliases", + ) + tags: Optional[List[str]] = Field( + None, + description="One or more tags that may aid in search or retrieval of the release note.", + title="Tags", + ) + resolves: Optional[List[Issue]] = Field( + None, + description="A collection of issues that have been resolved.", + title="Resolves", + ) + notes: Optional[List[Note]] = Field( + None, + description="Zero or more release notes containing the locale and content. Multiple note objects may be specified to support release notes in a wide variety of languages.", + title="Notes", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + + +class Advisory(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + title: Optional[str] = Field( + None, description="An optional name of the advisory.", title="Title" + ) + url: str = Field( + ..., description="Location where the advisory can be obtained.", title="URL" + ) + + +class Cwe(RootModel[conint(ge=1)]): + root: conint(ge=1) = Field( + ..., + description="Integer representation of a Common Weaknesses Enumerations (CWE). For example 399 (of https://cwe.mitre.org/data/definitions/399.html)", + title="CWE", + ) + + +class Severity(Enum): + critical = "critical" + high = "high" + medium = "medium" + low = "low" + info = "info" + none = "none" + unknown = "unknown" + + +class ScoreMethod(Enum): + CVSSv2 = "CVSSv2" + CVSSv3 = "CVSSv3" + CVSSv31 = "CVSSv31" + CVSSv4 = "CVSSv4" + OWASP = "OWASP" + SSVC = "SSVC" + other = "other" + + +class ImpactAnalysisState(Enum): + resolved = "resolved" + resolved_with_pedigree = "resolved_with_pedigree" + exploitable = "exploitable" + in_triage = "in_triage" + false_positive = "false_positive" + not_affected = "not_affected" + + +class ImpactAnalysisJustification(Enum): + code_not_present = "code_not_present" + code_not_reachable = "code_not_reachable" + requires_configuration = "requires_configuration" + requires_dependency = "requires_dependency" + requires_environment = "requires_environment" + protected_by_compiler = "protected_by_compiler" + protected_at_runtime = "protected_at_runtime" + protected_at_perimeter = "protected_at_perimeter" + protected_by_mitigating_control = "protected_by_mitigating_control" + + +class VulnerabilitySource(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + url: Optional[str] = Field( + None, + description="The url of the vulnerability documentation as provided by the source.", + examples=["https://nvd.nist.gov/vuln/detail/CVE-2021-39182"], + title="URL", + ) + name: Optional[str] = Field( + None, + description="The name of the source.", + examples=[ + "NVD", + "National Vulnerability Database", + "OSS Index", + "VulnDB", + "GitHub Advisories", + ], + title="Name", + ) + + +class Reference(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: str = Field( + ..., + description="An identifier that uniquely identifies the vulnerability.", + examples=[ + "CVE-2021-39182", + "GHSA-35m5-8cvj-8783", + "SNYK-PYTHON-ENROCRYPT-1912876", + ], + title="ID", + ) + source: VulnerabilitySource = Field( + ..., description="The source that published the vulnerability." + ) + + +class ProofOfConcept(BaseModel): + reproductionSteps: Optional[str] = Field( + None, + description="Precise steps to reproduce the vulnerability.", + title="Steps to Reproduce", + ) + environment: Optional[str] = Field( + None, + description="A description of the environment in which reproduction was possible.", + title="Environment", + ) + supportingMaterial: Optional[List[Attachment]] = Field( + None, + description="Supporting material that helps in reproducing or understanding how reproduction is possible. This may include screenshots, payloads, and PoC exploit code.", + title="Supporting Material", + ) + + +class ResponseEnum(Enum): + can_not_fix = "can_not_fix" + will_not_fix = "will_not_fix" + update = "update" + rollback = "rollback" + workaround_available = "workaround_available" + + +class Analysis(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + state: Optional[ImpactAnalysisState] = None + justification: Optional[ImpactAnalysisJustification] = None + response: Optional[List[ResponseEnum]] = Field( + None, + description="A response to the vulnerability by the manufacturer, supplier, or project responsible for the affected component or service. More than one response is allowed. Responses are strongly encouraged for vulnerabilities where the analysis state is exploitable.", + title="Response", + ) + detail: Optional[str] = Field( + None, + description="Detailed description of the impact including methods used during assessment. If a vulnerability is not exploitable, this field should include specific details on why the component or service is not impacted by this vulnerability.", + title="Detail", + ) + firstIssued: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the analysis was first issued.", + title="First Issued", + ) + lastUpdated: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the analysis was last updated.", + title="Last Updated", + ) + + +class AffectedStatus(Enum): + affected = "affected" + unaffected = "unaffected" + unknown = "unknown" + + +class Version(RootModel[constr(min_length=1, max_length=1024)]): + root: constr(min_length=1, max_length=1024) = Field( + ..., description="A single version of a component or service." + ) + + +class Range(RootModel[constr(min_length=1, max_length=1024)]): + root: constr(min_length=1, max_length=1024) = Field( + ..., + description="A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst", + ) + + +class Type4(Enum): + supervised = "supervised" + unsupervised = "unsupervised" + reinforcement_learning = "reinforcement-learning" + semi_supervised = "semi-supervised" + self_supervised = "self-supervised" + + +class Approach(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Optional[Type4] = Field( + None, + description="Learning types describing the learning problem or hybrid learning problem.", + title="Learning Type", + ) + + +class Datasets(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + ref: Optional[Union[RefLinkType, BomLinkElementType]] = Field( + None, + description="References a data component by the components bom-ref attribute", + title="Reference", + ) + + +class InputOutputMLParameters(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + format: Optional[str] = Field( + None, + description="The data format for input/output to the model. Example formats include string, image, time-series", + ) + + +class Type5(Enum): + source_code = "source-code" + configuration = "configuration" + dataset = "dataset" + definition = "definition" + other = "other" + + +class Contents(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + attachment: Optional[Attachment] = Field( + None, + description="An optional way to include textual or encoded data.", + title="Data Attachment", + ) + url: Optional[str] = Field( + None, + description="The URL to where the data can be retrieved.", + title="Data URL", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document name-value parameters used for configuration.", + title="Configuration Properties", + ) + + +class Graphic(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = Field(None, description="The name of the graphic.") + image: Optional[Attachment] = Field( + None, + description="The graphic (vector or raster). Base64 encoding MUST be specified for binary images.", + title="Graphic Image", + ) + + +class ConfidenceInterval(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + lowerBound: Optional[str] = Field( + None, description="The lower bound of the confidence interval." + ) + upperBound: Optional[str] = Field( + None, description="The upper bound of the confidence interval." + ) + + +class PerformanceMetric(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Optional[str] = Field(None, description="The type of performance metric.") + value: Optional[str] = Field( + None, description="The value of the performance metric." + ) + slice: Optional[str] = Field( + None, + description="The name of the slice this metric was computed on. By default, assume this metric is not sliced.", + ) + confidenceInterval: Optional[ConfidenceInterval] = Field( + None, description="The confidence interval of the metric." + ) + + +class Risk(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = Field(None, description="The name of the risk.") + mitigationStrategy: Optional[str] = Field( + None, description="Strategy used to address this risk." + ) + + +class FairnessAssessment(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + groupAtRisk: Optional[str] = Field( + None, + description="The groups or individuals at risk of being systematically disadvantaged by the model.", + ) + benefits: Optional[str] = Field( + None, description="Expected benefits to the identified groups." + ) + harms: Optional[str] = Field( + None, description="Expected harms to the identified groups." + ) + mitigationStrategy: Optional[str] = Field( + None, + description="With respect to the benefits and harms outlined, please describe any mitigation strategy implemented.", + ) + + +class DataClassification(RootModel[str]): + root: str = Field( + ..., + description="Data classification tags data according to its type, sensitivity, and value if altered, stolen, or destroyed.", + title="Data Classification", + ) + + +class Command(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + executed: Optional[str] = Field( + None, + description="A text representation of the executed command.", + title="Executed", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class AccessMode(Enum): + read_only = "read-only" + read_write = "read-write" + read_write_once = "read-write-once" + write_once = "write-once" + write_only = "write-only" + + +class Mode(Enum): + filesystem = "filesystem" + block = "block" + + +class Volume(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + uid: Optional[str] = Field( + None, + description="The unique identifier for the volume instance within its deployment context.", + title="Unique Identifier (UID)", + ) + name: Optional[str] = Field( + None, description="The name of the volume instance", title="Name" + ) + mode: Optional[Mode] = Field( + "filesystem", description="The mode for the volume instance.", title="Mode" + ) + path: Optional[str] = Field( + None, + description="The underlying path created from the actual volume.", + title="Path", + ) + sizeAllocated: Optional[str] = Field( + None, + description="The allocated size of the volume accessible to the associated workspace. This should include the scalar size as well as IEC standard unit in either decimal or binary form.", + examples=["10GB", "2Ti", "1Pi"], + title="Size allocated", + ) + persistent: Optional[bool] = Field( + None, + description="Indicates if the volume persists beyond the life of the resource it is associated with.", + title="Persistent", + ) + remote: Optional[bool] = Field( + None, + description="Indicates if the volume is remotely (i.e., network) attached.", + title="Remote", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class Type6(Enum): + manual = "manual" + api = "api" + webhook = "webhook" + scheduled = "scheduled" + + +class Type7(Enum): + artifact = "artifact" + attestation = "attestation" + log = "log" + evidence = "evidence" + metrics = "metrics" + other = "other" + + +class Condition(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + description: Optional[str] = Field( + None, + description="Describes the set of conditions which cause the trigger to activate.", + title="Description", + ) + expression: Optional[str] = Field( + None, + description="The logical expression that was evaluated that determined the trigger should be fired.", + title="Expression", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class TaskType(Enum): + copy = "copy" + clone = "clone" + lint = "lint" + scan = "scan" + merge = "merge" + build = "build" + test = "test" + deliver = "deliver" + deploy = "deploy" + release = "release" + clean = "clean" + other = "other" + + +class Parameter(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = Field( + None, description="The name of the parameter.", title="Name" + ) + value: Optional[str] = Field( + None, description="The value of the parameter.", title="Value" + ) + dataType: Optional[str] = Field( + None, description="The data type of the parameter.", title="Data type" + ) + + +class Algorithm(Enum): + RS256 = "RS256" + RS384 = "RS384" + RS512 = "RS512" + PS256 = "PS256" + PS384 = "PS384" + PS512 = "PS512" + ES256 = "ES256" + ES384 = "ES384" + ES512 = "ES512" + Ed25519 = "Ed25519" + Ed448 = "Ed448" + HS256 = "HS256" + HS384 = "HS384" + HS512 = "HS512" + + +class KeyType(Enum): + EC = "EC" + OKP = "OKP" + RSA = "RSA" + + +class PublicKey(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + kty: KeyType + + +class OrganizationalEntity(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the object elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + name: Optional[str] = Field( + None, + description="The name of the organization", + examples=["Example Inc."], + title="Name", + ) + url: Optional[List[str]] = Field( + None, + description="The URL of the organization. Multiple URLs are allowed.", + examples=["https://example.com"], + title="URL", + ) + contact: Optional[List[OrganizationalContact]] = Field( + None, + description="A contact at the organization. Multiple contacts are allowed.", + title="Contact", + ) + + +class Swid(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + tagId: str = Field( + ..., description="Maps to the tagId of a SoftwareIdentity.", title="Tag ID" + ) + name: str = Field( + ..., description="Maps to the name of a SoftwareIdentity.", title="Name" + ) + version: Optional[str] = Field( + "0.0", description="Maps to the version of a SoftwareIdentity.", title="Version" + ) + tagVersion: Optional[int] = Field( + 0, + description="Maps to the tagVersion of a SoftwareIdentity.", + title="Tag Version", + ) + patch: Optional[bool] = Field( + False, description="Maps to the patch of a SoftwareIdentity.", title="Patch" + ) + text: Optional[Attachment] = Field( + None, + description="Specifies the metadata and content of the SWID tag.", + title="Attachment text", + ) + url: Optional[str] = Field( + None, description="The URL to the SWID file.", title="URL" + ) + + +class Hash(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + alg: HashAlg + content: HashContent + + +class Licensor(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field( + ..., + description="The organization that granted the license", + title="Licensor (Organization)", + ) + individual: Optional[OrganizationalContact] = Field( + None, + description="The individual, not associated with an organization, that granted the license", + title="Licensor (Individual)", + ) + + +class Licensor1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, + description="The organization that granted the license", + title="Licensor (Organization)", + ) + individual: OrganizationalContact = Field( + ..., + description="The individual, not associated with an organization, that granted the license", + title="Licensor (Individual)", + ) + + +class Licensee(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field( + ..., + description="The organization that was granted the license", + title="Licensee (Organization)", + ) + individual: Optional[OrganizationalContact] = Field( + None, + description="The individual, not associated with an organization, that was granted the license", + title="Licensee (Individual)", + ) + + +class Licensee1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, + description="The organization that was granted the license", + title="Licensee (Organization)", + ) + individual: OrganizationalContact = Field( + ..., + description="The individual, not associated with an organization, that was granted the license", + title="Licensee (Individual)", + ) + + +class Purchaser(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field( + ..., + description="The organization that purchased the license", + title="Purchaser (Organization)", + ) + individual: Optional[OrganizationalContact] = Field( + None, + description="The individual, not associated with an organization, that purchased the license", + title="Purchaser (Individual)", + ) + + +class Purchaser1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, + description="The organization that purchased the license", + title="Purchaser (Organization)", + ) + individual: OrganizationalContact = Field( + ..., + description="The individual, not associated with an organization, that purchased the license", + title="Purchaser (Individual)", + ) + + +class Licensing(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + altIds: Optional[List[str]] = Field( + None, + description="License identifiers that may be used to manage licenses and their lifecycle", + title="Alternate License Identifiers", + ) + licensor: Optional[Union[Licensor, Licensor1]] = Field( + None, + description="The individual or organization that grants a license to another individual or organization", + title="Licensor", + ) + licensee: Optional[Union[Licensee, Licensee1]] = Field( + None, + description="The individual or organization for which a license was granted to", + title="Licensee", + ) + purchaser: Optional[Union[Purchaser, Purchaser1]] = Field( + None, + description="The individual or organization that purchased the license", + title="Purchaser", + ) + purchaseOrder: Optional[str] = Field( + None, + description="The purchase order identifier the purchaser sent to a supplier or vendor to authorize a purchase", + title="Purchase Order", + ) + licenseTypes: Optional[List[LicenseType]] = Field( + None, + description="The type of license(s) that was granted to the licensee\n\n* __academic__ = A license that grants use of software solely for the purpose of education or research.\n* __appliance__ = A license covering use of software embedded in a specific piece of hardware.\n* __client-access__ = A Client Access License (CAL) allows client computers to access services provided by server software.\n* __concurrent-user__ = A Concurrent User license (aka floating license) limits the number of licenses for a software application and licenses are shared among a larger number of users.\n* __core-points__ = A license where the core of a computer's processor is assigned a specific number of points.\n* __custom-metric__ = A license for which consumption is measured by non-standard metrics.\n* __device__ = A license that covers a defined number of installations on computers and other types of devices.\n* __evaluation__ = A license that grants permission to install and use software for trial purposes.\n* __named-user__ = A license that grants access to the software to one or more pre-defined users.\n* __node-locked__ = A license that grants access to the software on one or more pre-defined computers or devices.\n* __oem__ = An Original Equipment Manufacturer license that is delivered with hardware, cannot be transferred to other hardware, and is valid for the life of the hardware.\n* __perpetual__ = A license where the software is sold on a one-time basis and the licensee can use a copy of the software indefinitely.\n* __processor-points__ = A license where each installation consumes points per processor.\n* __subscription__ = A license where the licensee pays a fee to use the software or service.\n* __user__ = A license that grants access to the software or service by a specified number of users.\n* __other__ = Another license type.\n", + title="License Type", + ) + lastRenewal: Optional[AwareDatetime] = Field( + None, + description="The timestamp indicating when the license was last renewed. For new purchases, this is often the purchase or acquisition date. For non-perpetual licenses or subscriptions, this is the timestamp of when the license was last renewed.", + title="Last Renewal", + ) + expiration: Optional[AwareDatetime] = Field( + None, + description="The timestamp indicating when the current license expires (if applicable).", + title="Expiration", + ) + + +class License1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the license elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + id: spdx.Schema = Field( + ..., + description="A valid SPDX license ID", + examples=["Apache-2.0"], + title="License ID (SPDX)", + ) + name: Optional[str] = Field( + None, + description="If SPDX does not define the license used, this field may be used to provide the license name", + examples=["Acme Software License"], + title="License Name", + ) + text: Optional[Attachment] = Field( + None, + description="An optional way to include the textual content of a license.", + title="License text", + ) + url: Optional[str] = Field( + None, + description="The URL to the license file. If specified, a 'license' externalReference should also be specified for completeness", + examples=["https://www.apache.org/licenses/LICENSE-2.0.txt"], + title="License URL", + ) + licensing: Optional[Licensing] = Field( + None, + description="Licensing details describing the licensor/licensee, license type, renewal and expiration dates, and other important metadata", + title="Licensing information", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + + +class Licensor2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field( + ..., + description="The organization that granted the license", + title="Licensor (Organization)", + ) + individual: Optional[OrganizationalContact] = Field( + None, + description="The individual, not associated with an organization, that granted the license", + title="Licensor (Individual)", + ) + + +class Licensor3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, + description="The organization that granted the license", + title="Licensor (Organization)", + ) + individual: OrganizationalContact = Field( + ..., + description="The individual, not associated with an organization, that granted the license", + title="Licensor (Individual)", + ) + + +class Licensee2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field( + ..., + description="The organization that was granted the license", + title="Licensee (Organization)", + ) + individual: Optional[OrganizationalContact] = Field( + None, + description="The individual, not associated with an organization, that was granted the license", + title="Licensee (Individual)", + ) + + +class Licensee3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, + description="The organization that was granted the license", + title="Licensee (Organization)", + ) + individual: OrganizationalContact = Field( + ..., + description="The individual, not associated with an organization, that was granted the license", + title="Licensee (Individual)", + ) + + +class Purchaser2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field( + ..., + description="The organization that purchased the license", + title="Purchaser (Organization)", + ) + individual: Optional[OrganizationalContact] = Field( + None, + description="The individual, not associated with an organization, that purchased the license", + title="Purchaser (Individual)", + ) + + +class Purchaser3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, + description="The organization that purchased the license", + title="Purchaser (Organization)", + ) + individual: OrganizationalContact = Field( + ..., + description="The individual, not associated with an organization, that purchased the license", + title="Purchaser (Individual)", + ) + + +class Licensing1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + altIds: Optional[List[str]] = Field( + None, + description="License identifiers that may be used to manage licenses and their lifecycle", + title="Alternate License Identifiers", + ) + licensor: Optional[Union[Licensor2, Licensor3]] = Field( + None, + description="The individual or organization that grants a license to another individual or organization", + title="Licensor", + ) + licensee: Optional[Union[Licensee2, Licensee3]] = Field( + None, + description="The individual or organization for which a license was granted to", + title="Licensee", + ) + purchaser: Optional[Union[Purchaser2, Purchaser3]] = Field( + None, + description="The individual or organization that purchased the license", + title="Purchaser", + ) + purchaseOrder: Optional[str] = Field( + None, + description="The purchase order identifier the purchaser sent to a supplier or vendor to authorize a purchase", + title="Purchase Order", + ) + licenseTypes: Optional[List[LicenseType]] = Field( + None, + description="The type of license(s) that was granted to the licensee\n\n* __academic__ = A license that grants use of software solely for the purpose of education or research.\n* __appliance__ = A license covering use of software embedded in a specific piece of hardware.\n* __client-access__ = A Client Access License (CAL) allows client computers to access services provided by server software.\n* __concurrent-user__ = A Concurrent User license (aka floating license) limits the number of licenses for a software application and licenses are shared among a larger number of users.\n* __core-points__ = A license where the core of a computer's processor is assigned a specific number of points.\n* __custom-metric__ = A license for which consumption is measured by non-standard metrics.\n* __device__ = A license that covers a defined number of installations on computers and other types of devices.\n* __evaluation__ = A license that grants permission to install and use software for trial purposes.\n* __named-user__ = A license that grants access to the software to one or more pre-defined users.\n* __node-locked__ = A license that grants access to the software on one or more pre-defined computers or devices.\n* __oem__ = An Original Equipment Manufacturer license that is delivered with hardware, cannot be transferred to other hardware, and is valid for the life of the hardware.\n* __perpetual__ = A license where the software is sold on a one-time basis and the licensee can use a copy of the software indefinitely.\n* __processor-points__ = A license where each installation consumes points per processor.\n* __subscription__ = A license where the licensee pays a fee to use the software or service.\n* __user__ = A license that grants access to the software or service by a specified number of users.\n* __other__ = Another license type.\n", + title="License Type", + ) + lastRenewal: Optional[AwareDatetime] = Field( + None, + description="The timestamp indicating when the license was last renewed. For new purchases, this is often the purchase or acquisition date. For non-perpetual licenses or subscriptions, this is the timestamp of when the license was last renewed.", + title="Last Renewal", + ) + expiration: Optional[AwareDatetime] = Field( + None, + description="The timestamp indicating when the current license expires (if applicable).", + title="Expiration", + ) + + +class License2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the license elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + id: Optional[spdx.Schema] = Field( + None, + description="A valid SPDX license ID", + examples=["Apache-2.0"], + title="License ID (SPDX)", + ) + name: str = Field( + ..., + description="If SPDX does not define the license used, this field may be used to provide the license name", + examples=["Acme Software License"], + title="License Name", + ) + text: Optional[Attachment] = Field( + None, + description="An optional way to include the textual content of a license.", + title="License text", + ) + url: Optional[str] = Field( + None, + description="The URL to the license file. If specified, a 'license' externalReference should also be specified for completeness", + examples=["https://www.apache.org/licenses/LICENSE-2.0.txt"], + title="License URL", + ) + licensing: Optional[Licensing1] = Field( + None, + description="Licensing details describing the licensor/licensee, license type, renewal and expiration dates, and other important metadata", + title="Licensing information", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + + +class License(RootModel[Union[License1, License2]]): + root: Union[License1, License2] = Field(..., title="License Object") + + +class Commit(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + uid: Optional[str] = Field( + None, + description="A unique identifier of the commit. This may be version control specific. For example, Subversion uses revision numbers whereas git uses commit hashes.", + title="UID", + ) + url: Optional[str] = Field( + None, + description="The URL to the commit. This URL will typically point to a commit in a version control system.", + title="URL", + ) + author: Optional[IdentifiableAction] = Field( + None, + description="The author who created the changes in the commit", + title="Author", + ) + committer: Optional[IdentifiableAction] = Field( + None, + description="The person who committed or pushed the commit", + title="Committer", + ) + message: Optional[str] = Field( + None, + description="The text description of the contents of the commit", + title="Message", + ) + + +class Patch(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Type1 = Field( + ..., + description="Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or functionality.\n\n* __unofficial__ = A patch which is not developed by the creators or maintainers of the software being patched. Refer to [https://en.wikipedia.org/wiki/Unofficial_patch](https://en.wikipedia.org/wiki/Unofficial_patch)\n* __monkey__ = A patch which dynamically modifies runtime behavior. Refer to [https://en.wikipedia.org/wiki/Monkey_patch](https://en.wikipedia.org/wiki/Monkey_patch)\n* __backport__ = A patch which takes code from a newer version of software and applies it to older versions of the same software. Refer to [https://en.wikipedia.org/wiki/Backporting](https://en.wikipedia.org/wiki/Backporting)\n* __cherry-pick__ = A patch created by selectively applying commits from other versions or branches of the same software.", + title="Type", + ) + diff: Optional[Diff] = Field( + None, + description="The patch file (or diff) that show changes. Refer to [https://en.wikipedia.org/wiki/Diff](https://en.wikipedia.org/wiki/Diff)", + title="Diff", + ) + resolves: Optional[List[Issue]] = Field( + None, description="A collection of issues the patch resolves", title="Resolves" + ) + + +class ExternalReference(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + url: Union[str, BomLink] = Field( + ..., + description="The URI (URL or URN) to the external reference. External references are URIs and therefore can accept any URL scheme including https ([RFC-7230](https://www.ietf.org/rfc/rfc7230.txt)), mailto ([RFC-2368](https://www.ietf.org/rfc/rfc2368.txt)), tel ([RFC-3966](https://www.ietf.org/rfc/rfc3966.txt)), and dns ([RFC-4501](https://www.ietf.org/rfc/rfc4501.txt)). External references may also include formally registered URNs such as [CycloneDX BOM-Link](https://cyclonedx.org/capabilities/bomlink/) to reference CycloneDX BOMs or any object within a BOM. BOM-Link transforms applicable external references into relationships that can be expressed in a BOM or across BOMs.", + title="URL", + ) + comment: Optional[str] = Field( + None, + description="An optional comment describing the external reference", + title="Comment", + ) + type: Type3 = Field( + ..., + description='Specifies the type of external reference.\n\n* __vcs__ = Version Control System\n* __issue-tracker__ = Issue or defect tracking system, or an Application Lifecycle Management (ALM) system\n* __website__ = Website\n* __advisories__ = Security advisories\n* __bom__ = Bill of Materials (SBOM, OBOM, HBOM, SaaSBOM, etc)\n* __mailing-list__ = Mailing list or discussion group\n* __social__ = Social media account\n* __chat__ = Real-time chat platform\n* __documentation__ = Documentation, guides, or how-to instructions\n* __support__ = Community or commercial support\n* __distribution__ = Direct or repository download location\n* __distribution-intake__ = The location where a component was published to. This is often the same as "distribution" but may also include specialized publishing processes that act as an intermediary\n* __license__ = The URL to the license file. If a license URL has been defined in the license node, it should also be defined as an external reference for completeness\n* __build-meta__ = Build-system specific meta file (i.e. pom.xml, package.json, .nuspec, etc)\n* __build-system__ = URL to an automated build system\n* __release-notes__ = URL to release notes\n* __security-contact__ = Specifies a way to contact the maintainer, supplier, or provider in the event of a security incident. Common URIs include links to a disclosure procedure, a mailto (RFC-2368) that specifies an email address, a tel (RFC-3966) that specifies a phone number, or dns (RFC-4501) that specifies the records containing DNS Security TXT\n* __model-card__ = A model card describes the intended uses of a machine learning model, potential limitations, biases, ethical considerations, training parameters, datasets used to train the model, performance metrics, and other relevant data useful for ML transparency\n* __log__ = A record of events that occurred in a computer system or application, such as problems, errors, or information on current operations\n* __configuration__ = Parameters or settings that may be used by other components or services\n* __evidence__ = Information used to substantiate a claim\n* __formulation__ = Describes how a component or service was manufactured or deployed\n* __attestation__ = Human or machine-readable statements containing facts, evidence, or testimony\n* __threat-model__ = An enumeration of identified weaknesses, threats, and countermeasures, dataflow diagram (DFD), attack tree, and other supporting documentation in human-readable or machine-readable format\n* __adversary-model__ = The defined assumptions, goals, and capabilities of an adversary.\n* __risk-assessment__ = Identifies and analyzes the potential of future events that may negatively impact individuals, assets, and/or the environment. Risk assessments may also include judgments on the tolerability of each risk.\n* __vulnerability-assertion__ = A Vulnerability Disclosure Report (VDR) which asserts the known and previously unknown vulnerabilities that affect a component, service, or product including the analysis and findings describing the impact (or lack of impact) that the reported vulnerability has on a component, service, or product.\n* __exploitability-statement__ = A Vulnerability Exploitability eXchange (VEX) which asserts the known vulnerabilities that do not affect a product, product family, or organization, and optionally the ones that do. The VEX should include the analysis and findings describing the impact (or lack of impact) that the reported vulnerability has on the product, product family, or organization.\n* __pentest-report__ = Results from an authorized simulated cyberattack on a component or service, otherwise known as a penetration test\n* __static-analysis-report__ = SARIF or proprietary machine or human-readable report for which static analysis has identified code quality, security, and other potential issues with the source code\n* __dynamic-analysis-report__ = Dynamic analysis report that has identified issues such as vulnerabilities and misconfigurations\n* __runtime-analysis-report__ = Report generated by analyzing the call stack of a running application\n* __component-analysis-report__ = Report generated by Software Composition Analysis (SCA), container analysis, or other forms of component analysis\n* __maturity-report__ = Report containing a formal assessment of an organization, business unit, or team against a maturity model\n* __certification-report__ = Industry, regulatory, or other certification from an accredited (if applicable) certification body\n* __quality-metrics__ = Report or system in which quality metrics can be obtained\n* __codified-infrastructure__ = Code or configuration that defines and provisions virtualized infrastructure, commonly referred to as Infrastructure as Code (IaC)\n* __poam__ = Plans of Action and Milestones (POAM) compliment an "attestation" external reference. POAM is defined by NIST as a "document that identifies tasks needing to be accomplished. It details resources required to accomplish the elements of the plan, any milestones in meeting the tasks and scheduled completion dates for the milestones".\n* __other__ = Use this if no other types accurately describe the purpose of the external reference', + title="Type", + ) + hashes: Optional[List[Hash]] = Field( + None, + description="The hashes of the external reference (if applicable).", + title="Hashes", + ) + + +class Rating(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + source: Optional[VulnerabilitySource] = Field( + None, + description="The source that calculated the severity or risk rating of the vulnerability.", + ) + score: Optional[float] = Field( + None, description="The numerical score of the rating.", title="Score" + ) + severity: Optional[Severity] = Field( + None, + description="Textual representation of the severity that corresponds to the numerical score of the rating.", + ) + method: Optional[ScoreMethod] = None + vector: Optional[str] = Field( + None, + description="Textual representation of the metric values used to score the vulnerability", + title="Vector", + ) + justification: Optional[str] = Field( + None, + description="An optional reason for rating the vulnerability as it was", + title="Justification", + ) + + +class Credits(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organizations: Optional[List[OrganizationalEntity]] = Field( + None, + description="The organizations credited with vulnerability discovery.", + title="Organizations", + ) + individuals: Optional[List[OrganizationalContact]] = Field( + None, + description="The individuals, not associated with organizations, that are credited with vulnerability discovery.", + title="Individuals", + ) + + +class Versions(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + version: Version = Field( + ..., description="A single version of a component or service." + ) + range: Optional[Range] = Field( + None, + description="A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst", + ) + status: Optional[AffectedStatus] = Field( + "affected", + description="The vulnerability status for the version or range of versions.", + ) + + +class Versions1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + version: Optional[Version] = Field( + None, description="A single version of a component or service." + ) + range: Range = Field( + ..., + description="A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst", + ) + status: Optional[AffectedStatus] = Field( + "affected", + description="The vulnerability status for the version or range of versions.", + ) + + +class Affect(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + ref: Union[RefLinkType, BomLinkElementType] = Field( + ..., + description="References a component or service by the objects bom-ref", + title="Reference", + ) + versions: Optional[List[Union[Versions, Versions1]]] = Field( + None, + description="Zero or more individual versions or range of versions.", + title="Versions", + ) + + +class Considerations(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + users: Optional[List[str]] = Field( + None, description="Who are the intended users of the model?", title="Users" + ) + useCases: Optional[List[str]] = Field( + None, + description="What are the intended use cases of the model?", + title="Use Cases", + ) + technicalLimitations: Optional[List[str]] = Field( + None, + description="What are the known technical limitations of the model? E.g. What kind(s) of data should the model be expected not to perform well on? What are the factors that might degrade model performance?", + title="Technical Limitations", + ) + performanceTradeoffs: Optional[List[str]] = Field( + None, + description="What are the known tradeoffs in accuracy/performance of the model?", + title="Performance Tradeoffs", + ) + ethicalConsiderations: Optional[List[Risk]] = Field( + None, + description="What are the ethical (or environmental) risks involved in the application of this model?", + title="Ethical Considerations", + ) + fairnessAssessments: Optional[List[FairnessAssessment]] = Field( + None, + description="How does the model affect groups at risk of being systematically disadvantaged? What are the harms and benefits to the various affected groups?", + title="Fairness Assessments", + ) + + +class DataGovernanceResponsibleParty1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field(..., title="Organization") + contact: Optional[OrganizationalContact] = Field(None, title="Individual") + + +class DataGovernanceResponsibleParty2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field(None, title="Organization") + contact: OrganizationalContact = Field(..., title="Individual") + + +class DataGovernanceResponsibleParty( + RootModel[Union[DataGovernanceResponsibleParty1, DataGovernanceResponsibleParty2]] +): + root: Union[DataGovernanceResponsibleParty1, DataGovernanceResponsibleParty2] + + +class GraphicsCollection(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + description: Optional[str] = Field( + None, description="A description of this collection of graphics." + ) + collection: Optional[List[Graphic]] = Field( + None, description="A collection of graphics." + ) + + +class Step(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = Field(None, description="A name for the step.", title="Name") + description: Optional[str] = Field( + None, description="A description of the step.", title="Description" + ) + commands: Optional[List[Command]] = Field( + None, + description="Ordered list of commands or directives for the step", + title="Commands", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class ResourceReferenceChoice1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + ref: Union[RefLinkType, BomLinkElementType] = Field( + ..., + description="References an object by its bom-ref attribute", + title="BOM Reference", + ) + externalReference: Optional[ExternalReference] = Field( + None, + description="Reference to an externally accessible resource.", + title="External reference", + ) + + +class ResourceReferenceChoice2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + ref: Optional[Union[RefLinkType, BomLinkElementType]] = Field( + None, + description="References an object by its bom-ref attribute", + title="BOM Reference", + ) + externalReference: ExternalReference = Field( + ..., + description="Reference to an externally accessible resource.", + title="External reference", + ) + + +class ResourceReferenceChoice( + RootModel[Union[ResourceReferenceChoice1, ResourceReferenceChoice2]] +): + root: Union[ResourceReferenceChoice1, ResourceReferenceChoice2] = Field( + ..., + description="A reference to a locally defined resource (e.g., a bom-ref) or an externally accessible resource.", + title="Resource reference choice", + ) + + +class Signer(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + algorithm: Union[Algorithm, AnyUrl] + keyId: Optional[str] = Field( + None, + description="Optional. Application specific string identifying the signature key.", + title="Key ID", + ) + publicKey: Optional[PublicKey] = Field( + None, description="Optional. Public key object.", title="Public key" + ) + certificatePath: Optional[List[str]] = Field( + None, + description="Optional. Sorted array of X.509 [RFC5280] certificates, where the first element must contain the signature certificate. The certificate path must be contiguous but is not required to be complete.", + title="Certificate path", + ) + excludes: Optional[List[str]] = Field( + None, + description='Optional. Array holding the names of one or more application level properties that must be excluded from the signature process. Note that the "excludes" property itself, must also be excluded from the signature process. Since both the "excludes" property and the associated data it points to are unsigned, a conforming JSF implementation must provide options for specifying which properties to accept.', + title="Excludes", + ) + value: str = Field( + ..., + description="The signature data. Note that the binary representation must follow the JWA [RFC7518] specifications.", + title="Signature", + ) + + +class Tool(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + vendor: Optional[str] = Field( + None, + description="The name of the vendor who created the tool", + title="Tool Vendor", + ) + name: Optional[str] = Field( + None, description="The name of the tool", title="Tool Name" + ) + version: Optional[str] = Field( + None, description="The version of the tool", title="Tool Version" + ) + hashes: Optional[List[Hash]] = Field( + None, description="The hashes of the tool (if applicable).", title="Hashes" + ) + externalReferences: Optional[List[ExternalReference]] = Field( + None, + description="External references provide a way to document systems, sites, and information that may be relevant, but are not included with the BOM. They may also establish specific relationships within or external to the BOM.", + title="External References", + ) + + +class QuantitativeAnalysis(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + performanceMetrics: Optional[List[PerformanceMetric]] = Field( + None, + description="The model performance metrics being reported. Examples may include accuracy, F1 score, precision, top-3 error rates, MSC, etc.", + title="Performance Metrics", + ) + graphics: Optional[GraphicsCollection] = None + + +class DataGovernance(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + custodians: Optional[List[DataGovernanceResponsibleParty]] = Field( + None, + description="Data custodians are responsible for the safe custody, transport, and storage of data.", + title="Data Custodians", + ) + stewards: Optional[List[DataGovernanceResponsibleParty]] = Field( + None, + description="Data stewards are responsible for data content, context, and associated business rules.", + title="Data Stewards", + ) + owners: Optional[List[DataGovernanceResponsibleParty]] = Field( + None, + description="Data owners are concerned with risk and appropriate access to data.", + title="Data Owners", + ) + + +class Workspace(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: RefType = Field( + ..., + alias="bom-ref", + description="An optional identifier which can be used to reference the workspace elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + uid: str = Field( + ..., + description="The unique identifier for the resource instance within its deployment context.", + title="Unique Identifier (UID)", + ) + name: Optional[str] = Field( + None, description="The name of the resource instance.", title="Name" + ) + aliases: Optional[List[str]] = Field( + None, + description="The names for the workspace as referenced by other workflow tasks. Effectively, a name mapping so other tasks can use their own local name in their steps.", + title="Aliases", + ) + description: Optional[str] = Field( + None, description="A description of the resource instance.", title="Description" + ) + resourceReferences: Optional[List[ResourceReferenceChoice]] = Field( + None, + description="References to component or service resources that are used to realize the resource instance.", + title="Resource references", + ) + accessMode: Optional[AccessMode] = Field( + None, + description="Describes the read-write access control for the workspace relative to the owning resource instance.", + title="Access mode", + ) + mountPath: Optional[str] = Field( + None, + description="A path to a location on disk where the workspace will be available to the associated task's steps.", + title="Mount path", + ) + managedDataType: Optional[str] = Field( + None, + description="The name of a domain-specific data type the workspace represents.", + examples=["ConfigMap", "Secret"], + title="Managed data type", + ) + volumeRequest: Optional[str] = Field( + None, + description="Identifies the reference to the request for a specific volume type and parameters.", + examples=["a kubernetes Persistent Volume Claim (PVC) name"], + title="Volume request", + ) + volume: Optional[Volume] = Field( + None, + description="Information about the actual volume instance allocated to the workspace.", + examples=[ + "see https://kubernetes.io/docs/concepts/storage/persistent-volumes/" + ], + title="Volume", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class Event(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + uid: Optional[str] = Field( + None, + description="The unique identifier of the event.", + title="Unique Identifier (UID)", + ) + description: Optional[str] = Field( + None, description="A description of the event.", title="Description" + ) + timeReceived: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the event was received.", + title="Time Received", + ) + data: Optional[Attachment] = Field( + None, description="Encoding of the raw event data.", title="Data" + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="References the component or service that was the source of the event", + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="References the component or service that was the target of the event", + title="Target", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class InputType1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="A references to the component or service that provided the input to the task (e.g., reference to a service with data flow value of `inbound`)", + examples=["source code repository", "database"], + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to the component or service that received or stored the input if not the task itself (e.g., a local, named storage workspace)", + examples=["workspace", "directory"], + title="Target", + ) + resource: ResourceReferenceChoice = Field( + ..., + description="A reference to an independent resource provided as an input to a task by the workflow runtime.", + examples=[ + "reference to a configuration file in a repository (i.e., a bom-ref)", + "reference to a scanning service used in a task (i.e., a bom-ref)", + ], + title="Resource", + ) + parameters: Optional[List[Parameter]] = Field( + None, + description="Inputs that have the form of parameters with names and values.", + title="Parameters", + ) + environmentVars: Optional[List[Union[Property, str]]] = Field( + None, + description="Inputs that have the form of parameters with names and values.", + title="Environment variables", + ) + data: Optional[Attachment] = Field( + None, description="Inputs that have the form of data.", title="Data" + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class InputType2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="A references to the component or service that provided the input to the task (e.g., reference to a service with data flow value of `inbound`)", + examples=["source code repository", "database"], + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to the component or service that received or stored the input if not the task itself (e.g., a local, named storage workspace)", + examples=["workspace", "directory"], + title="Target", + ) + resource: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to an independent resource provided as an input to a task by the workflow runtime.", + examples=[ + "reference to a configuration file in a repository (i.e., a bom-ref)", + "reference to a scanning service used in a task (i.e., a bom-ref)", + ], + title="Resource", + ) + parameters: List[Parameter] = Field( + ..., + description="Inputs that have the form of parameters with names and values.", + title="Parameters", + ) + environmentVars: Optional[List[Union[Property, str]]] = Field( + None, + description="Inputs that have the form of parameters with names and values.", + title="Environment variables", + ) + data: Optional[Attachment] = Field( + None, description="Inputs that have the form of data.", title="Data" + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class InputType3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="A references to the component or service that provided the input to the task (e.g., reference to a service with data flow value of `inbound`)", + examples=["source code repository", "database"], + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to the component or service that received or stored the input if not the task itself (e.g., a local, named storage workspace)", + examples=["workspace", "directory"], + title="Target", + ) + resource: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to an independent resource provided as an input to a task by the workflow runtime.", + examples=[ + "reference to a configuration file in a repository (i.e., a bom-ref)", + "reference to a scanning service used in a task (i.e., a bom-ref)", + ], + title="Resource", + ) + parameters: Optional[List[Parameter]] = Field( + None, + description="Inputs that have the form of parameters with names and values.", + title="Parameters", + ) + environmentVars: List[Union[Property, str]] = Field( + ..., + description="Inputs that have the form of parameters with names and values.", + title="Environment variables", + ) + data: Optional[Attachment] = Field( + None, description="Inputs that have the form of data.", title="Data" + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class InputType4(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="A references to the component or service that provided the input to the task (e.g., reference to a service with data flow value of `inbound`)", + examples=["source code repository", "database"], + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to the component or service that received or stored the input if not the task itself (e.g., a local, named storage workspace)", + examples=["workspace", "directory"], + title="Target", + ) + resource: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to an independent resource provided as an input to a task by the workflow runtime.", + examples=[ + "reference to a configuration file in a repository (i.e., a bom-ref)", + "reference to a scanning service used in a task (i.e., a bom-ref)", + ], + title="Resource", + ) + parameters: Optional[List[Parameter]] = Field( + None, + description="Inputs that have the form of parameters with names and values.", + title="Parameters", + ) + environmentVars: Optional[List[Union[Property, str]]] = Field( + None, + description="Inputs that have the form of parameters with names and values.", + title="Environment variables", + ) + data: Attachment = Field( + ..., description="Inputs that have the form of data.", title="Data" + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class InputType(RootModel[Union[InputType1, InputType2, InputType3, InputType4]]): + root: Union[InputType1, InputType2, InputType3, InputType4] = Field( + ..., + description="Type that represents various input data types and formats.", + title="Input type", + ) + + +class OutputType1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Optional[Type7] = Field( + None, description="Describes the type of data output.", title="Type" + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="Component or service that generated or provided the output from the task (e.g., a build tool)", + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="Component or service that received the output from the task (e.g., reference to an artifactory service with data flow value of `outbound`)", + examples=[ + "a log file described as an `externalReference` within its target domain." + ], + title="Target", + ) + resource: ResourceReferenceChoice = Field( + ..., + description="A reference to an independent resource generated as output by the task.", + examples=["configuration file", "source code", "scanning service"], + title="Resource", + ) + data: Optional[Attachment] = Field( + None, description="Outputs that have the form of data.", title="Data" + ) + environmentVars: Optional[List[Union[Property, str]]] = Field( + None, + description="Outputs that have the form of environment variables.", + title="Environment variables", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class OutputType2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Optional[Type7] = Field( + None, description="Describes the type of data output.", title="Type" + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="Component or service that generated or provided the output from the task (e.g., a build tool)", + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="Component or service that received the output from the task (e.g., reference to an artifactory service with data flow value of `outbound`)", + examples=[ + "a log file described as an `externalReference` within its target domain." + ], + title="Target", + ) + resource: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to an independent resource generated as output by the task.", + examples=["configuration file", "source code", "scanning service"], + title="Resource", + ) + data: Optional[Attachment] = Field( + None, description="Outputs that have the form of data.", title="Data" + ) + environmentVars: List[Union[Property, str]] = Field( + ..., + description="Outputs that have the form of environment variables.", + title="Environment variables", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class OutputType3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Optional[Type7] = Field( + None, description="Describes the type of data output.", title="Type" + ) + source: Optional[ResourceReferenceChoice] = Field( + None, + description="Component or service that generated or provided the output from the task (e.g., a build tool)", + title="Source", + ) + target: Optional[ResourceReferenceChoice] = Field( + None, + description="Component or service that received the output from the task (e.g., reference to an artifactory service with data flow value of `outbound`)", + examples=[ + "a log file described as an `externalReference` within its target domain." + ], + title="Target", + ) + resource: Optional[ResourceReferenceChoice] = Field( + None, + description="A reference to an independent resource generated as output by the task.", + examples=["configuration file", "source code", "scanning service"], + title="Resource", + ) + data: Attachment = Field( + ..., description="Outputs that have the form of data.", title="Data" + ) + environmentVars: Optional[List[Union[Property, str]]] = Field( + None, + description="Outputs that have the form of environment variables.", + title="Environment variables", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class OutputType(RootModel[Union[OutputType1, OutputType2, OutputType3]]): + root: Union[OutputType1, OutputType2, OutputType3] + + +class Signature1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + signers: Optional[List[Signer]] = Field( + None, + description="Unique top level property for Multiple Signatures. (multisignature)", + title="Signature", + ) + + +class Signature2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + chain: Optional[List[Signer]] = Field( + None, + description="Unique top level property for Signature Chains. (signaturechain)", + title="Signature", + ) + + +class Signature(RootModel[Union[Signature1, Signature2, Signer]]): + root: Union[Signature1, Signature2, Signer] = Field(..., title="Signature") + + +class ServiceData(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + flow: DataFlowDirection = Field( + ..., + description="Specifies the flow direction of the data. Direction is relative to the service. Inbound flow states that data enters the service. Outbound flow states that data leaves the service. Bi-directional states that data flows both ways, and unknown states that the direction is not known.", + title="Directional Flow", + ) + classification: DataClassification + name: Optional[str] = Field( + None, + description="Name for the defined data", + examples=["Credit card reporting"], + title="Name", + ) + description: Optional[str] = Field( + None, + description="Short description of the data content and usage", + examples=[ + "Credit card information being exchanged in between the web app and the database" + ], + title="Description", + ) + governance: Optional[DataGovernance] = Field(None, title="Data Governance") + source: Optional[List[Union[str, BomLinkElementType]]] = Field( + None, + description="The URI, URL, or BOM-Link of the components or services the data came in from", + title="Source", + ) + destination: Optional[List[Union[str, BomLinkElementType]]] = Field( + None, + description="The URI, URL, or BOM-Link of the components or services the data is sent to", + title="Destination", + ) + + +class ComponentData(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the dataset elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + type: Type5 = Field( + ..., + description="The general theme or subject matter of the data being specified.\n\n* __source-code__ = Any type of code, code snippet, or data-as-code.\n* __configuration__ = Parameters or settings that may be used by other components.\n* __dataset__ = A collection of data.\n* __definition__ = Data that can be used to create new instances of what the definition defines.\n* __other__ = Any other type of data that does not fit into existing definitions.", + title="Type of Data", + ) + name: Optional[str] = Field(None, description="The name of the dataset.") + contents: Optional[Contents] = Field( + None, + description="The contents or references to the contents of the data being described.", + title="Data Contents", + ) + classification: Optional[DataClassification] = None + sensitiveData: Optional[List[str]] = Field( + None, description="A description of any sensitive data in a dataset." + ) + graphics: Optional[GraphicsCollection] = None + description: Optional[str] = Field( + None, + description="A description of the dataset. Can describe size of dataset, whether it's used for source code, training, testing, or validation, etc.", + ) + governance: Optional[DataGovernance] = Field(None, title="Data Governance") + + +class Trigger(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: RefType = Field( + ..., + alias="bom-ref", + description="An optional identifier which can be used to reference the trigger elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + uid: str = Field( + ..., + description="The unique identifier for the resource instance within its deployment context.", + title="Unique Identifier (UID)", + ) + name: Optional[str] = Field( + None, description="The name of the resource instance.", title="Name" + ) + description: Optional[str] = Field( + None, description="A description of the resource instance.", title="Description" + ) + resourceReferences: Optional[List[ResourceReferenceChoice]] = Field( + None, + description="References to component or service resources that are used to realize the resource instance.", + title="Resource references", + ) + type: Type6 = Field( + ..., + description="The source type of event which caused the trigger to fire.", + title="Type", + ) + event: Optional[Event] = Field( + None, + description="The event data that caused the associated trigger to activate.", + title="Event", + ) + conditions: Optional[List[Condition]] = None + timeActivated: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the trigger was activated.", + title="Time activated", + ) + inputs: Optional[List[InputType]] = Field( + None, + description="Represents resources and data brought into a task at runtime by executor or task commands", + examples=[ + "a `configuration` file which was declared as a local `component` or `externalReference`" + ], + title="Inputs", + ) + outputs: Optional[List[OutputType]] = Field( + None, + description="Represents resources and data output from a task at runtime by executor or task commands", + examples=["a log file or metrics data produced by the task"], + title="Outputs", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class Service(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + provider: Optional[OrganizationalEntity] = Field( + None, + description="The organization that provides the service.", + title="Provider", + ) + group: Optional[str] = Field( + None, + description="The grouping name, namespace, or identifier. This will often be a shortened, single name of the company or project that produced the service or domain name. Whitespace and special characters should be avoided.", + examples=["com.acme"], + title="Service Group", + ) + name: str = Field( + ..., + description="The name of the service. This will often be a shortened, single name of the service.", + examples=["ticker-service"], + title="Service Name", + ) + version: Optional[str] = Field( + None, + description="The service version.", + examples=["1.0.0"], + title="Service Version", + ) + description: Optional[str] = Field( + None, + description="Specifies a description for the service", + title="Service Description", + ) + endpoints: Optional[List[str]] = Field( + None, + description="The endpoint URIs of the service. Multiple endpoints are allowed.", + examples=["https://example.com/api/v1/ticker"], + title="Endpoints", + ) + authenticated: Optional[bool] = Field( + None, + description="A boolean value indicating if the service requires authentication. A value of true indicates the service requires authentication prior to use. A value of false indicates the service does not require authentication.", + title="Authentication Required", + ) + x_trust_boundary: Optional[bool] = Field( + None, + alias="x-trust-boundary", + description="A boolean value indicating if use of the service crosses a trust zone or boundary. A value of true indicates that by using the service, a trust boundary is crossed. A value of false indicates that by using the service, a trust boundary is not crossed.", + title="Crosses Trust Boundary", + ) + trustZone: Optional[str] = Field( + None, + description="The name of the trust zone the service resides in.", + title="Trust Zone", + ) + data: Optional[List[ServiceData]] = Field( + None, + description="Specifies information about the data including the directional flow of data and the data classification.", + title="Data", + ) + licenses: Optional[LicenseChoice] = Field(None, title="Component License(s)") + externalReferences: Optional[List[ExternalReference]] = Field( + None, + description="External references provide a way to document systems, sites, and information that may be relevant, but are not included with the BOM. They may also establish specific relationships within or external to the BOM.", + title="External References", + ) + services: Optional[List[Service]] = Field( + None, + description="A list of services included or deployed behind the parent service. This is not a dependency tree. It provides a way to specify a hierarchical representation of service assemblies.", + title="Services", + ) + releaseNotes: Optional[ReleaseNotes] = Field( + None, description="Specifies optional release notes.", title="Release notes" + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + signature: Optional[Signature] = Field( + None, + description="Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html).", + title="Signature", + ) + + +class Compositions(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the composition elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + aggregate: AggregateType = Field( + ..., + description="Specifies an aggregate type that describe how complete a relationship is.\n\n* __complete__ = The relationship is complete. No further relationships including constituent components, services, or dependencies are known to exist.\n* __incomplete__ = The relationship is incomplete. Additional relationships exist and may include constituent components, services, or dependencies.\n* __incomplete_first_party_only__ = The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented.\n* __incomplete_first_party_proprietary_only__ = The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.\n* __incomplete_first_party_opensource_only__ = The relationship is incomplete. Only relationships for first-party components, services, or their dependencies are represented, limited specifically to those that are opensource.\n* __incomplete_third_party_only__ = The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented.\n* __incomplete_third_party_proprietary_only__ = The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are proprietary.\n* __incomplete_third_party_opensource_only__ = The relationship is incomplete. Only relationships for third-party components, services, or their dependencies are represented, limited specifically to those that are opensource.\n* __unknown__ = The relationship may be complete or incomplete. This usually signifies a 'best-effort' to obtain constituent components, services, or dependencies but the completeness is inconclusive.\n* __not_specified__ = The relationship completeness is not specified.\n", + title="Aggregate", + ) + assemblies: Optional[List[Union[RefLinkType, BomLinkElementType]]] = Field( + None, + description="The bom-ref identifiers of the components or services being described. Assemblies refer to nested relationships whereby a constituent part may include other constituent parts. References do not cascade to child parts. References are explicit for the specified constituent part only.", + title="BOM references", + ) + dependencies: Optional[List[str]] = Field( + None, + description="The bom-ref identifiers of the components or services being described. Dependencies refer to a relationship whereby an independent constituent part requires another independent constituent part. References do not cascade to transitive dependencies. References are explicit for the specified dependency only.", + title="BOM references", + ) + vulnerabilities: Optional[List[str]] = Field( + None, + description="The bom-ref identifiers of the vulnerabilities being described.", + title="BOM references", + ) + signature: Optional[Signature] = Field( + None, + description="Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html).", + title="Signature", + ) + + +class ModelParameters(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + approach: Optional[Approach] = Field( + None, + description="The overall approach to learning used by the model for problem solving.", + title="Approach", + ) + task: Optional[str] = Field( + None, + description="Directly influences the input and/or output. Examples include classification, regression, clustering, etc.", + title="Task", + ) + architectureFamily: Optional[str] = Field( + None, + description="The model architecture family such as transformer network, convolutional neural network, residual neural network, LSTM neural network, etc.", + title="Architecture Family", + ) + modelArchitecture: Optional[str] = Field( + None, + description="The specific architecture of the model such as GPT-1, ResNet-50, YOLOv3, etc.", + title="Model Architecture", + ) + datasets: Optional[List[Union[ComponentData, Datasets]]] = Field( + None, + description="The datasets used to train and evaluate the model.", + title="Datasets", + ) + inputs: Optional[List[InputOutputMLParameters]] = Field( + None, description="The input format(s) of the model", title="Inputs" + ) + outputs: Optional[List[InputOutputMLParameters]] = Field( + None, description="The output format(s) from the model", title="Outputs" + ) + + +class ModelCard(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the model card elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + modelParameters: Optional[ModelParameters] = Field( + None, + description="Hyper-parameters for construction of the model.", + title="Model Parameters", + ) + quantitativeAnalysis: Optional[QuantitativeAnalysis] = Field( + None, + description="A quantitative analysis of the model", + title="Quantitative Analysis", + ) + considerations: Optional[Considerations] = Field( + None, + description="What considerations should be taken into account regarding the model's construction, training, and application?", + title="Considerations", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + + +class Task(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: RefType = Field( + ..., + alias="bom-ref", + description="An optional identifier which can be used to reference the task elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + uid: str = Field( + ..., + description="The unique identifier for the resource instance within its deployment context.", + title="Unique Identifier (UID)", + ) + name: Optional[str] = Field( + None, description="The name of the resource instance.", title="Name" + ) + description: Optional[str] = Field( + None, description="A description of the resource instance.", title="Description" + ) + resourceReferences: Optional[List[ResourceReferenceChoice]] = Field( + None, + description="References to component or service resources that are used to realize the resource instance.", + title="Resource references", + ) + taskTypes: List[TaskType] = Field( + ..., + description="Indicates the types of activities performed by the set of workflow tasks.", + title="Task types", + ) + trigger: Optional[Trigger] = Field( + None, description="The trigger that initiated the task.", title="Trigger" + ) + steps: Optional[List[Step]] = Field( + None, description="The sequence of steps for the task.", title="Steps" + ) + inputs: Optional[List[InputType]] = Field( + None, + description="Represents resources and data brought into a task at runtime by executor or task commands", + examples=[ + "a `configuration` file which was declared as a local `component` or `externalReference`" + ], + title="Inputs", + ) + outputs: Optional[List[OutputType]] = Field( + None, + description="Represents resources and data output from a task at runtime by executor or task commands", + examples=["a log file or metrics data produced by the task"], + title="Outputs", + ) + timeStart: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the task started.", + title="Time start", + ) + timeEnd: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the task ended.", + title="Time end", + ) + workspaces: Optional[List[Workspace]] = Field( + None, + description="A set of named filesystem or data resource shareable by workflow tasks.", + title="Workspaces", + ) + runtimeTopology: Optional[List[Dependency]] = Field( + None, + description="A graph of the component runtime topology for task's instance.", + title="Runtime topology", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class Workflow(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: RefType = Field( + ..., + alias="bom-ref", + description="An optional identifier which can be used to reference the workflow elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + uid: str = Field( + ..., + description="The unique identifier for the resource instance within its deployment context.", + title="Unique Identifier (UID)", + ) + name: Optional[str] = Field( + None, description="The name of the resource instance.", title="Name" + ) + description: Optional[str] = Field( + None, description="A description of the resource instance.", title="Description" + ) + resourceReferences: Optional[List[ResourceReferenceChoice]] = Field( + None, + description="References to component or service resources that are used to realize the resource instance.", + title="Resource references", + ) + tasks: Optional[List[Task]] = Field( + None, description="The tasks that comprise the workflow.", title="Tasks" + ) + taskDependencies: Optional[List[Dependency]] = Field( + None, + description="The graph of dependencies between tasks within the workflow.", + title="Task dependency graph", + ) + taskTypes: List[TaskType] = Field( + ..., + description="Indicates the types of activities performed by the set of workflow tasks.", + title="Task types", + ) + trigger: Optional[Trigger] = Field( + None, description="The trigger that initiated the task.", title="Trigger" + ) + steps: Optional[List[Step]] = Field( + None, description="The sequence of steps for the task.", title="Steps" + ) + inputs: Optional[List[InputType]] = Field( + None, + description="Represents resources and data brought into a task at runtime by executor or task commands", + examples=[ + "a `configuration` file which was declared as a local `component` or `externalReference`" + ], + title="Inputs", + ) + outputs: Optional[List[OutputType]] = Field( + None, + description="Represents resources and data output from a task at runtime by executor or task commands", + examples=["a log file or metrics data produced by the task"], + title="Outputs", + ) + timeStart: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the task started.", + title="Time start", + ) + timeEnd: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the task ended.", + title="Time end", + ) + workspaces: Optional[List[Workspace]] = Field( + None, + description="A set of named filesystem or data resource shareable by workflow tasks.", + title="Workspaces", + ) + runtimeTopology: Optional[List[Dependency]] = Field( + None, + description="A graph of the component runtime topology for workflow's instance.", + title="Runtime topology", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +class CyclonedxSoftwareBillOfMaterialsStandard(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + field_schema: Optional[FieldSchema] = Field(None, alias="$schema") + bomFormat: BomFormat = Field( + ..., + description='Specifies the format of the BOM. This helps to identify the file as CycloneDX since BOMs do not have a filename convention nor does JSON schema support namespaces. This value MUST be "CycloneDX".', + title="BOM Format", + ) + specVersion: str = Field( + ..., + description="The version of the CycloneDX specification a BOM conforms to (starting at version 1.2).", + examples=["1.5"], + title="CycloneDX Specification Version", + ) + serialNumber: Optional[ + constr( + pattern=r"^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + ) + ] = Field( + None, + description="Every BOM generated SHOULD have a unique serial number, even if the contents of the BOM have not changed over time. If specified, the serial number MUST conform to RFC-4122. Use of serial numbers are RECOMMENDED.", + examples=["urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"], + title="BOM Serial Number", + ) + version: Optional[conint(ge=1)] = Field( + 1, + description="Whenever an existing BOM is modified, either manually or through automated processes, the version of the BOM SHOULD be incremented by 1. When a system is presented with multiple BOMs with identical serial numbers, the system SHOULD use the most recent version of the BOM. The default version is '1'.", + examples=[1], + title="BOM Version", + ) + metadata: Optional[Metadata] = Field( + None, + description="Provides additional information about a BOM.", + title="BOM Metadata", + ) + components: Optional[List[Component]] = Field( + None, + description="A list of software and hardware components.", + title="Components", + ) + services: Optional[List[Service]] = Field( + None, + description="A list of services. This may include microservices, function-as-a-service, and other types of network or intra-process services.", + title="Services", + ) + externalReferences: Optional[List[ExternalReference]] = Field( + None, + description="External references provide a way to document systems, sites, and information that may be relevant, but are not included with the BOM. They may also establish specific relationships within or external to the BOM.", + title="External References", + ) + dependencies: Optional[List[Dependency]] = Field( + None, + description="Provides the ability to document dependency relationships.", + title="Dependencies", + ) + compositions: Optional[List[Compositions]] = Field( + None, + description="Compositions describe constituent parts (including components, services, and dependency relationships) and their completeness. The completeness of vulnerabilities expressed in a BOM may also be described.", + title="Compositions", + ) + vulnerabilities: Optional[List[Vulnerability]] = Field( + None, + description="Vulnerabilities identified in components or services.", + title="Vulnerabilities", + ) + annotations: Optional[List[Annotations]] = Field( + None, + description="Comments made by people, organizations, or tools about any object with a bom-ref, such as components, services, vulnerabilities, or the BOM itself. Unlike inventory information, annotations may contain opinion or commentary from various stakeholders. Annotations may be inline (with inventory) or externalized via BOM-Link, and may optionally be signed.", + title="Annotations", + ) + formulation: Optional[List[Formula]] = Field( + None, + description="Describes how a component or service was manufactured or deployed. This is achieved through the use of formulas, workflows, tasks, and steps, which declare the precise steps to reproduce along with the observed formulas describing the steps which transpired in the manufacturing process.", + title="Formulation", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + signature: Optional[Signature] = Field( + None, + description="Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html).", + title="Signature", + ) + + +class Tools(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + components: Optional[List[Component]] = Field( + None, + description="A list of software and hardware components used as tools", + title="Components", + ) + services: Optional[List[Service]] = Field( + None, + description="A list of services used as tools. This may include microservices, function-as-a-service, and other types of network or intra-process services.", + title="Services", + ) + + +class Metadata(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + timestamp: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the BOM was created.", + title="Timestamp", + ) + lifecycles: Optional[List[Union[Lifecycles, Lifecycles1]]] = Field( + None, description="", title="Lifecycles" + ) + tools: Optional[Union[Tools, List[Tool]]] = None + authors: Optional[List[OrganizationalContact]] = Field( + None, + description="The person(s) who created the BOM. Authors are common in BOMs created through manual processes. BOMs created through automated means may not have authors.", + title="Authors", + ) + component: Optional[Component] = Field( + None, description="The component that the BOM describes.", title="Component" + ) + manufacture: Optional[OrganizationalEntity] = Field( + None, + description="The organization that manufactured the component that the BOM describes.", + title="Manufacture", + ) + supplier: Optional[OrganizationalEntity] = Field( + None, + description=" The organization that supplied the component that the BOM describes. The supplier may often be the manufacturer, but may also be a distributor or repackager.", + title="Supplier", + ) + licenses: Optional[LicenseChoice] = Field(None, title="BOM License(s)") + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + + +class Pedigree(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + ancestors: Optional[List[Component]] = Field( + None, + description="Describes zero or more components in which a component is derived from. This is commonly used to describe forks from existing projects where the forked version contains a ancestor node containing the original component it was forked from. For example, Component A is the original component. Component B is the component being used and documented in the BOM. However, Component B contains a pedigree node with a single ancestor documenting Component A - the original component from which Component B is derived from.", + title="Ancestors", + ) + descendants: Optional[List[Component]] = Field( + None, + description="Descendants are the exact opposite of ancestors. This provides a way to document all forks (and their forks) of an original or root component.", + title="Descendants", + ) + variants: Optional[List[Component]] = Field( + None, + description="Variants describe relations where the relationship between the components are not known. For example, if Component A contains nearly identical code to Component B. They are both related, but it is unclear if one is derived from the other, or if they share a common ancestor.", + title="Variants", + ) + commits: Optional[List[Commit]] = Field( + None, + description="A list of zero or more commits which provide a trail describing how the component deviates from an ancestor, descendant, or variant.", + title="Commits", + ) + patches: Optional[List[Patch]] = Field( + None, + description=">A list of zero or more patches describing how the component deviates from an ancestor, descendant, or variant. Patches may be complimentary to commits or may be used in place of commits.", + title="Patches", + ) + notes: Optional[str] = Field( + None, + description="Notes, observations, and other non-structured commentary describing the components pedigree.", + title="Notes", + ) + + +class Component(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Type = Field( + ..., + description="Specifies the type of component. For software components, classify as application if no more specific appropriate classification is available or cannot be determined for the component. Types include:\n\n* __application__ = A software application. Refer to [https://en.wikipedia.org/wiki/Application_software](https://en.wikipedia.org/wiki/Application_software) for information about applications.\n* __framework__ = A software framework. Refer to [https://en.wikipedia.org/wiki/Software_framework](https://en.wikipedia.org/wiki/Software_framework) for information on how frameworks vary slightly from libraries.\n* __library__ = A software library. Refer to [https://en.wikipedia.org/wiki/Library_(computing)](https://en.wikipedia.org/wiki/Library_(computing))\n for information about libraries. All third-party and open source reusable components will likely be a library. If the library also has key features of a framework, then it should be classified as a framework. If not, or is unknown, then specifying library is RECOMMENDED.\n* __container__ = A packaging and/or runtime format, not specific to any particular technology, which isolates software inside the container from software outside of a container through virtualization technology. Refer to [https://en.wikipedia.org/wiki/OS-level_virtualization](https://en.wikipedia.org/wiki/OS-level_virtualization)\n* __platform__ = A runtime environment which interprets or executes software. This may include runtimes such as those that execute bytecode or low-code/no-code application platforms.\n* __operating-system__ = A software operating system without regard to deployment model (i.e. installed on physical hardware, virtual machine, image, etc) Refer to [https://en.wikipedia.org/wiki/Operating_system](https://en.wikipedia.org/wiki/Operating_system)\n* __device__ = A hardware device such as a processor, or chip-set. A hardware device containing firmware SHOULD include a component for the physical hardware itself, and another component of type 'firmware' or 'operating-system' (whichever is relevant), describing information about the software running on the device.\n See also the list of [known device properties](https://github.com/CycloneDX/cyclonedx-property-taxonomy/blob/main/cdx/device.md).\n* __device-driver__ = A special type of software that operates or controls a particular type of device. Refer to [https://en.wikipedia.org/wiki/Device_driver](https://en.wikipedia.org/wiki/Device_driver)\n* __firmware__ = A special type of software that provides low-level control over a devices hardware. Refer to [https://en.wikipedia.org/wiki/Firmware](https://en.wikipedia.org/wiki/Firmware)\n* __file__ = A computer file. Refer to [https://en.wikipedia.org/wiki/Computer_file](https://en.wikipedia.org/wiki/Computer_file) for information about files.\n* __machine-learning-model__ = A model based on training data that can make predictions or decisions without being explicitly programmed to do so.\n* __data__ = A collection of discrete values that convey information.", + examples=["library"], + title="Component Type", + ) + mime_type: Optional[constr(pattern=r"^[-+a-z0-9.]+/[-+a-z0-9.]+$")] = Field( + None, + alias="mime-type", + description="The optional mime-type of the component. When used on file components, the mime-type can provide additional context about the kind of file being represented such as an image, font, or executable. Some library or framework components may also have an associated mime-type.", + examples=["image/jpeg"], + title="Mime-Type", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + supplier: Optional[OrganizationalEntity] = Field( + None, + description=" The organization that supplied the component. The supplier may often be the manufacturer, but may also be a distributor or repackager.", + title="Component Supplier", + ) + author: Optional[str] = Field( + None, + description="The person(s) or organization(s) that authored the component", + examples=["Acme Inc"], + title="Component Author", + ) + publisher: Optional[str] = Field( + None, + description="The person(s) or organization(s) that published the component", + examples=["Acme Inc"], + title="Component Publisher", + ) + group: Optional[str] = Field( + None, + description="The grouping name or identifier. This will often be a shortened, single name of the company or project that produced the component, or the source package or domain name. Whitespace and special characters should be avoided. Examples include: apache, org.apache.commons, and apache.org.", + examples=["com.acme"], + title="Component Group", + ) + name: str = Field( + ..., + description="The name of the component. This will often be a shortened, single name of the component. Examples: commons-lang3 and jquery", + examples=["tomcat-catalina"], + title="Component Name", + ) + version: Optional[str] = Field( + None, + description="The component version. The version should ideally comply with semantic versioning but is not enforced.", + examples=["9.0.14"], + title="Component Version", + ) + description: Optional[str] = Field( + None, + description="Specifies a description for the component", + title="Component Description", + ) + scope: Optional[Scope] = Field( + "required", + description="Specifies the scope of the component. If scope is not specified, 'required' scope SHOULD be assumed by the consumer of the BOM.", + title="Component Scope", + ) + hashes: Optional[List[Hash]] = Field(None, title="Component Hashes") + licenses: Optional[LicenseChoice] = Field(None, title="Component License(s)") + copyright: Optional[str] = Field( + None, + description="A copyright notice informing users of the underlying claims to copyright ownership in a published work.", + examples=["Acme Inc"], + title="Component Copyright", + ) + cpe: Optional[str] = Field( + None, + description="Specifies a well-formed CPE name that conforms to the CPE 2.2 or 2.3 specification. See [https://nvd.nist.gov/products/cpe](https://nvd.nist.gov/products/cpe)", + examples=["cpe:2.3:a:acme:component_framework:-:*:*:*:*:*:*:*"], + title="Component Common Platform Enumeration (CPE)", + ) + purl: Optional[str] = Field( + None, + description="Specifies the package-url (purl). The purl, if specified, MUST be valid and conform to the specification defined at: [https://github.com/package-url/purl-spec](https://github.com/package-url/purl-spec)", + examples=["pkg:maven/com.acme/tomcat-catalina@9.0.14?packaging=jar"], + title="Component Package URL (purl)", + ) + swid: Optional[Swid] = Field( + None, + description="Specifies metadata and content for [ISO-IEC 19770-2 Software Identification (SWID) Tags](https://www.iso.org/standard/65666.html).", + title="SWID Tag", + ) + modified: Optional[bool] = Field( + None, + description="[Deprecated] - DO NOT USE. This will be removed in a future version. Use the pedigree element instead to supply information on exactly how the component was modified. A boolean value indicating if the component has been modified from the original. A value of true indicates the component is a derivative of the original. A value of false indicates the component has not been modified from the original.", + title="Component Modified From Original", + ) + pedigree: Optional[Pedigree] = Field( + None, + description="Component pedigree is a way to document complex supply chain scenarios where components are created, distributed, modified, redistributed, combined with other components, etc. Pedigree supports viewing this complex chain from the beginning, the end, or anywhere in the middle. It also provides a way to document variants where the exact relation may not be known.", + title="Component Pedigree", + ) + externalReferences: Optional[List[ExternalReference]] = Field( + None, + description="External references provide a way to document systems, sites, and information that may be relevant, but are not included with the BOM. They may also establish specific relationships within or external to the BOM.", + title="External References", + ) + components: Optional[List[Component]] = Field( + None, + description="A list of software and hardware components included in the parent component. This is not a dependency tree. It provides a way to specify a hierarchical representation of component assemblies, similar to system → subsystem → parts assembly in physical supply chains.", + title="Components", + ) + evidence: Optional[ComponentEvidence] = Field( + None, + description="Provides the ability to document evidence collected through various forms of extraction or analysis.", + title="Evidence", + ) + releaseNotes: Optional[ReleaseNotes] = Field( + None, description="Specifies optional release notes.", title="Release notes" + ) + modelCard: Optional[ModelCard] = Field(None, title="Machine Learning Model Card") + data: Optional[List[ComponentData]] = Field( + None, + description="This object SHOULD be specified for any component of type `data` and MUST NOT be specified for other component types.", + title="Data", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + signature: Optional[Signature] = Field( + None, + description="Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html).", + title="Signature", + ) + + +class Vulnerability(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the vulnerability elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + id: Optional[str] = Field( + None, + description="The identifier that uniquely identifies the vulnerability.", + examples=[ + "CVE-2021-39182", + "GHSA-35m5-8cvj-8783", + "SNYK-PYTHON-ENROCRYPT-1912876", + ], + title="ID", + ) + source: Optional[VulnerabilitySource] = Field( + None, description="The source that published the vulnerability." + ) + references: Optional[List[Reference]] = Field( + None, + description="Zero or more pointers to vulnerabilities that are the equivalent of the vulnerability specified. Often times, the same vulnerability may exist in multiple sources of vulnerability intelligence, but have different identifiers. References provide a way to correlate vulnerabilities across multiple sources of vulnerability intelligence.", + title="References", + ) + ratings: Optional[List[Rating]] = Field( + None, description="List of vulnerability ratings", title="Ratings" + ) + cwes: Optional[List[Cwe]] = Field( + None, + description="List of Common Weaknesses Enumerations (CWEs) codes that describes this vulnerability. For example 399 (of https://cwe.mitre.org/data/definitions/399.html)", + examples=[399], + title="CWEs", + ) + description: Optional[str] = Field( + None, + description="A description of the vulnerability as provided by the source.", + title="Description", + ) + detail: Optional[str] = Field( + None, + description="If available, an in-depth description of the vulnerability as provided by the source organization. Details often include information useful in understanding root cause.", + title="Details", + ) + recommendation: Optional[str] = Field( + None, + description="Recommendations of how the vulnerability can be remediated or mitigated.", + title="Recommendation", + ) + workaround: Optional[str] = Field( + None, + description="A bypass, usually temporary, of the vulnerability that reduces its likelihood and/or impact. Workarounds often involve changes to configuration or deployments.", + title="Workarounds", + ) + proofOfConcept: Optional[ProofOfConcept] = Field( + None, + description="Evidence used to reproduce the vulnerability.", + title="Proof of Concept", + ) + advisories: Optional[List[Advisory]] = Field( + None, + description="Published advisories of the vulnerability if provided.", + title="Advisories", + ) + created: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the vulnerability record was created in the vulnerability database.", + title="Created", + ) + published: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the vulnerability record was first published.", + title="Published", + ) + updated: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the vulnerability record was last updated.", + title="Updated", + ) + rejected: Optional[AwareDatetime] = Field( + None, + description="The date and time (timestamp) when the vulnerability record was rejected (if applicable).", + title="Rejected", + ) + credits: Optional[Credits] = Field( + None, + description="Individuals or organizations credited with the discovery of the vulnerability.", + title="Credits", + ) + tools: Optional[Union[Tools, List[Tool]]] = None + analysis: Optional[Analysis] = Field( + None, + description="An assessment of the impact and exploitability of the vulnerability.", + title="Impact Analysis", + ) + affects: Optional[List[Affect]] = Field( + None, + description="The components or services that are affected by the vulnerability.", + title="Affects", + ) + properties: Optional[List[Property]] = Field( + None, + description="Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.", + title="Properties", + ) + + +class Annotator(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: OrganizationalEntity = Field( + ..., description="The organization that created the annotation" + ) + individual: Optional[OrganizationalContact] = Field( + None, description="The person that created the annotation" + ) + component: Optional[Component] = Field( + None, description="The tool or component that created the annotation" + ) + service: Optional[Service] = Field( + None, description="The service that created the annotation" + ) + + +class Annotator1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, description="The organization that created the annotation" + ) + individual: OrganizationalContact = Field( + ..., description="The person that created the annotation" + ) + component: Optional[Component] = Field( + None, description="The tool or component that created the annotation" + ) + service: Optional[Service] = Field( + None, description="The service that created the annotation" + ) + + +class Annotator2(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, description="The organization that created the annotation" + ) + individual: Optional[OrganizationalContact] = Field( + None, description="The person that created the annotation" + ) + component: Component = Field( + ..., description="The tool or component that created the annotation" + ) + service: Optional[Service] = Field( + None, description="The service that created the annotation" + ) + + +class Annotator3(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + organization: Optional[OrganizationalEntity] = Field( + None, description="The organization that created the annotation" + ) + individual: Optional[OrganizationalContact] = Field( + None, description="The person that created the annotation" + ) + component: Optional[Component] = Field( + None, description="The tool or component that created the annotation" + ) + service: Service = Field(..., description="The service that created the annotation") + + +class Annotations(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the annotation elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + subjects: List[Union[RefLinkType, BomLinkElementType]] = Field( + ..., + description="The object in the BOM identified by its bom-ref. This is often a component or service, but may be any object type supporting bom-refs.", + title="BOM References", + ) + annotator: Union[Annotator, Annotator1, Annotator2, Annotator3] = Field( + ..., + description="The organization, person, component, or service which created the textual content of the annotation.", + title="Annotator", + ) + timestamp: AwareDatetime = Field( + ..., + description="The date and time (timestamp) when the annotation was created.", + title="Timestamp", + ) + text: str = Field( + ..., description="The textual content of the annotation.", title="Text" + ) + signature: Optional[Signature] = Field( + None, + description="Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html).", + title="Signature", + ) + + +class Formula(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + bom_ref: Optional[RefType] = Field( + None, + alias="bom-ref", + description="An optional identifier which can be used to reference the formula elsewhere in the BOM. Every bom-ref MUST be unique within the BOM.", + title="BOM Reference", + ) + components: Optional[List[Component]] = Field( + None, + description="Transient components that are used in tasks that constitute one or more of this formula's workflows", + title="Components", + ) + services: Optional[List[Service]] = Field( + None, + description="Transient services that are used in tasks that constitute one or more of this formula's workflows", + title="Services", + ) + workflows: Optional[List[Workflow]] = Field( + None, + description="List of workflows that can be declared to accomplish specific orchestrated goals and independently triggered.", + title="Workflows", + ) + properties: Optional[List[Property]] = Field(None, title="Properties") + + +Service.model_rebuild() +CyclonedxSoftwareBillOfMaterialsStandard.model_rebuild() +Tools.model_rebuild() +Metadata.model_rebuild() +Pedigree.model_rebuild() diff --git a/blint/logger.py b/blint/logger.py index 812f93f..8d5de42 100644 --- a/blint/logger.py +++ b/blint/logger.py @@ -10,8 +10,9 @@ log_time=False, log_path=False, theme=custom_theme, - width=280, - color_system="auto", + color_system="256", + force_terminal=True, + highlight=True, record=True, ) @@ -32,3 +33,7 @@ LOG.setLevel(logging.DEBUG) DEBUG = logging.DEBUG + +for log_name, log_obj in logging.Logger.manager.loggerDict.items(): + if log_name != __name__: + log_obj.disabled = True diff --git a/blint/sbom.py b/blint/sbom.py new file mode 100644 index 0000000..db9b0f9 --- /dev/null +++ b/blint/sbom.py @@ -0,0 +1,106 @@ +import json +import os +import sys +import uuid +from collections import defaultdict +from datetime import datetime +from pathlib import Path + +from rich.progress import Progress + +from blint.android import collect_app_metadata +from blint.cyclonedx.spec import ( + BomFormat, + Component, + CyclonedxSoftwareBillOfMaterialsStandard, + Lifecycles, + Metadata, + Phase, + Tools, + Type, +) +from blint.logger import LOG, console +from blint.utils import find_android_files, get_version + + +def default_parent(src_dirs): + return Component( + type=Type.application, name=os.path.basename(src_dirs[0]), version="latest" + ) + + +def default_metadata(src_dirs): + metadata = Metadata() + metadata.timestamp = datetime.now() + metadata.component = default_parent(src_dirs) + metadata.tools = [ + Tools( + components=[ + Component( + type=Type.application, + author="OWASP Foundation", + publisher="OWASP Foundation", + group="owasp-dep-scan", + name="blint", + version=get_version(), + purl=f"pkg:pypi/blint@{get_version()}", + ) + ] + ) + ] + metadata.lifecycles = [Lifecycles(phase=Phase.post_build)] + return metadata + + +def generate(src_dirs, output_file): + android_files = [] + components = [] + sbom = CyclonedxSoftwareBillOfMaterialsStandard( + bomFormat=BomFormat.CycloneDX, + specVersion="1.5", + version=1, + serialNumber=f"urn:uuid:{uuid.uuid4()}", + ) + sbom.metadata = default_metadata(src_dirs) + for src in src_dirs: + files = find_android_files(src) + if files: + android_files += files + if not android_files: + return False + with Progress( + transient=True, + redirect_stderr=True, + redirect_stdout=True, + refresh_per_second=1, + ) as progress: + task = progress.add_task( + f"[green] Parsing {len(android_files)} android apps", + total=len(android_files), + start=True, + ) + for f in android_files: + progress.update(task, description=f"Processing [bold]{f}[/bold]") + parent_component, app_components = collect_app_metadata(f) + if parent_component: + if not sbom.metadata.component.components: + sbom.metadata.component.components = [] + sbom.metadata.component.components.append(parent_component) + if app_components: + components += app_components + sbom.components = components + # If we have only one parent component then promote it to metadata.component + if ( + sbom.metadata.component.components + and len(sbom.metadata.component.components) == 1 + ): + sbom.metadata.component = sbom.metadata.component.components[0] + LOG.debug("SBOM includes %d components", len(components)) + with open(output_file, mode="w") as fp: + fp.write( + sbom.model_dump_json( + indent=2, exclude_none=True, exclude_defaults=True, warnings=False + ) + ) + LOG.debug("SBOM file generated successfully at %s", output_file) + return True diff --git a/blint/utils.py b/blint/utils.py index 26f75b1..633f5b8 100644 --- a/blint/utils.py +++ b/blint/utils.py @@ -2,7 +2,10 @@ import math import os import re +import shutil import string +import zipfile +from importlib.metadata import distribution from pathlib import Path from defusedxml.ElementTree import fromstring @@ -1421,6 +1424,36 @@ def find_exe_files(src): return result +def find_android_files(path): + """ + Method to find android app files + + :param path: Project directory + :return: List of android files + """ + app_extns = [".apk", ".aab"] + return find_files(path, app_extns) + + +def find_files(path, extns): + """ + Method to find files matching an extension + """ + result = [] + if os.path.isfile(path): + for ext in extns: + if path.endswith(ext): + result.append(path) + else: + for root, dirs, files in os.walk(path): + filter_ignored_dirs(dirs) + for file in files: + for ext in extns: + if file.endswith(ext): + result.append(os.path.join(root, file)) + return result + + def bomstrip(manifest): """ Function to delete UTF-8 BOM character in "string" @@ -1455,3 +1488,25 @@ def is_fuzzable_name(name_str): if n.lower() in name_str: return True return False + + +def unzip_unsafe(zf, to_dir): + """Method to unzip the file in an unsafe manne""" + with zipfile.ZipFile(zf, "r") as zip_ref: + zip_ref.extractall(to_dir) + + +def check_command(cmd): + """ + Method to check if command is available + :return True if command is available in PATH. False otherwise + """ + cpath = shutil.which(cmd, mode=os.F_OK | os.X_OK) + return cpath is not None + + +def get_version(): + """ + Returns the version of depscan + """ + return distribution("blint").version diff --git a/poetry.lock b/poetry.lock index 381e5e6..6b0a128 100644 --- a/poetry.lock +++ b/poetry.lock @@ -11,38 +11,46 @@ files = [ {file = "altgraph-0.17.4.tar.gz", hash = "sha256:1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406"}, ] +[[package]] +name = "annotated-types" +version = "0.6.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, + {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, +] + [[package]] name = "black" -version = "23.3.0" +version = "23.12.1" description = "The uncompromising code formatter." optional = false -python-versions = ">=3.7" -files = [ - {file = "black-23.3.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:0945e13506be58bf7db93ee5853243eb368ace1c08a24c65ce108986eac65915"}, - {file = "black-23.3.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:67de8d0c209eb5b330cce2469503de11bca4085880d62f1628bd9972cc3366b9"}, - {file = "black-23.3.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:7c3eb7cea23904399866c55826b31c1f55bbcd3890ce22ff70466b907b6775c2"}, - {file = "black-23.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32daa9783106c28815d05b724238e30718f34155653d4d6e125dc7daec8e260c"}, - {file = "black-23.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:35d1381d7a22cc5b2be2f72c7dfdae4072a3336060635718cc7e1ede24221d6c"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:a8a968125d0a6a404842fa1bf0b349a568634f856aa08ffaff40ae0dfa52e7c6"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:c7ab5790333c448903c4b721b59c0d80b11fe5e9803d8703e84dcb8da56fec1b"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:a6f6886c9869d4daae2d1715ce34a19bbc4b95006d20ed785ca00fa03cba312d"}, - {file = "black-23.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f3c333ea1dd6771b2d3777482429864f8e258899f6ff05826c3a4fcc5ce3f70"}, - {file = "black-23.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:11c410f71b876f961d1de77b9699ad19f939094c3a677323f43d7a29855fe326"}, - {file = "black-23.3.0-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:1d06691f1eb8de91cd1b322f21e3bfc9efe0c7ca1f0e1eb1db44ea367dff656b"}, - {file = "black-23.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50cb33cac881766a5cd9913e10ff75b1e8eb71babf4c7104f2e9c52da1fb7de2"}, - {file = "black-23.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e114420bf26b90d4b9daa597351337762b63039752bdf72bf361364c1aa05925"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:48f9d345675bb7fbc3dd85821b12487e1b9a75242028adad0333ce36ed2a6d27"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:714290490c18fb0126baa0fca0a54ee795f7502b44177e1ce7624ba1c00f2331"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:064101748afa12ad2291c2b91c960be28b817c0c7eaa35bec09cc63aa56493c5"}, - {file = "black-23.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:562bd3a70495facf56814293149e51aa1be9931567474993c7942ff7d3533961"}, - {file = "black-23.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:e198cf27888ad6f4ff331ca1c48ffc038848ea9f031a3b40ba36aced7e22f2c8"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:3238f2aacf827d18d26db07524e44741233ae09a584273aa059066d644ca7b30"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:f0bd2f4a58d6666500542b26354978218a9babcdc972722f4bf90779524515f3"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:92c543f6854c28a3c7f39f4d9b7694f9a6eb9d3c5e2ece488c327b6e7ea9b266"}, - {file = "black-23.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a150542a204124ed00683f0db1f5cf1c2aaaa9cc3495b7a3b5976fb136090ab"}, - {file = "black-23.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:6b39abdfb402002b8a7d030ccc85cf5afff64ee90fa4c5aebc531e3ad0175ddb"}, - {file = "black-23.3.0-py3-none-any.whl", hash = "sha256:ec751418022185b0c1bb7d7736e6933d40bbb14c14a0abcf9123d1b159f98dd4"}, - {file = "black-23.3.0.tar.gz", hash = "sha256:1c7b8d606e728a41ea1ccbd7264677e494e87cf630e399262ced92d4a8dac940"}, +python-versions = ">=3.8" +files = [ + {file = "black-23.12.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2"}, + {file = "black-23.12.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba"}, + {file = "black-23.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a920b569dc6b3472513ba6ddea21f440d4b4c699494d2e972a1753cdc25df7b0"}, + {file = "black-23.12.1-cp310-cp310-win_amd64.whl", hash = "sha256:3fa4be75ef2a6b96ea8d92b1587dd8cb3a35c7e3d51f0738ced0781c3aa3a5a3"}, + {file = "black-23.12.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba"}, + {file = "black-23.12.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b"}, + {file = "black-23.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59"}, + {file = "black-23.12.1-cp311-cp311-win_amd64.whl", hash = "sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50"}, + {file = "black-23.12.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e"}, + {file = "black-23.12.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec"}, + {file = "black-23.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e"}, + {file = "black-23.12.1-cp312-cp312-win_amd64.whl", hash = "sha256:ae76c22bde5cbb6bfd211ec343ded2163bba7883c7bc77f6b756a1049436fbb9"}, + {file = "black-23.12.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1fa88a0f74e50e4487477bc0bb900c6781dbddfdfa32691e780bf854c3b4a47f"}, + {file = "black-23.12.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a4d6a9668e45ad99d2f8ec70d5c8c04ef4f32f648ef39048d010b0689832ec6d"}, + {file = "black-23.12.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b18fb2ae6c4bb63eebe5be6bd869ba2f14fd0259bda7d18a46b764d8fb86298a"}, + {file = "black-23.12.1-cp38-cp38-win_amd64.whl", hash = "sha256:c04b6d9d20e9c13f43eee8ea87d44156b8505ca8a3c878773f68b4e4812a421e"}, + {file = "black-23.12.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3e1b38b3135fd4c025c28c55ddfc236b05af657828a8a6abe5deec419a0b7055"}, + {file = "black-23.12.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4f0031eaa7b921db76decd73636ef3a12c942ed367d8c3841a0739412b260a54"}, + {file = "black-23.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97e56155c6b737854e60a9ab1c598ff2533d57e7506d97af5481141671abf3ea"}, + {file = "black-23.12.1-cp39-cp39-win_amd64.whl", hash = "sha256:dd15245c8b68fe2b6bd0f32c1556509d11bb33aec9b5d0866dd8e2ed3dba09c2"}, + {file = "black-23.12.1-py3-none-any.whl", hash = "sha256:78baad24af0f033958cad29731e27363183e140962595def56423e626f4bee3e"}, + {file = "black-23.12.1.tar.gz", hash = "sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5"}, ] [package.dependencies] @@ -52,12 +60,11 @@ packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] +d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] @@ -74,7 +81,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -89,71 +95,63 @@ files = [ [[package]] name = "coverage" -version = "7.2.7" +version = "7.4.1" description = "Code coverage measurement for Python" optional = false -python-versions = ">=3.7" -files = [ - {file = "coverage-7.2.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d39b5b4f2a66ccae8b7263ac3c8170994b65266797fb96cbbfd3fb5b23921db8"}, - {file = "coverage-7.2.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6d040ef7c9859bb11dfeb056ff5b3872436e3b5e401817d87a31e1750b9ae2fb"}, - {file = "coverage-7.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba90a9563ba44a72fda2e85302c3abc71c5589cea608ca16c22b9804262aaeb6"}, - {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7d9405291c6928619403db1d10bd07888888ec1abcbd9748fdaa971d7d661b2"}, - {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31563e97dae5598556600466ad9beea39fb04e0229e61c12eaa206e0aa202063"}, - {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ebba1cd308ef115925421d3e6a586e655ca5a77b5bf41e02eb0e4562a111f2d1"}, - {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cb017fd1b2603ef59e374ba2063f593abe0fc45f2ad9abdde5b4d83bd922a353"}, - {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62a5c7dad11015c66fbb9d881bc4caa5b12f16292f857842d9d1871595f4495"}, - {file = "coverage-7.2.7-cp310-cp310-win32.whl", hash = "sha256:ee57190f24fba796e36bb6d3aa8a8783c643d8fa9760c89f7a98ab5455fbf818"}, - {file = "coverage-7.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:f75f7168ab25dd93110c8a8117a22450c19976afbc44234cbf71481094c1b850"}, - {file = "coverage-7.2.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06a9a2be0b5b576c3f18f1a241f0473575c4a26021b52b2a85263a00f034d51f"}, - {file = "coverage-7.2.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5baa06420f837184130752b7c5ea0808762083bf3487b5038d68b012e5937dbe"}, - {file = "coverage-7.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fdec9e8cbf13a5bf63290fc6013d216a4c7232efb51548594ca3631a7f13c3a3"}, - {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:52edc1a60c0d34afa421c9c37078817b2e67a392cab17d97283b64c5833f427f"}, - {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63426706118b7f5cf6bb6c895dc215d8a418d5952544042c8a2d9fe87fcf09cb"}, - {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:afb17f84d56068a7c29f5fa37bfd38d5aba69e3304af08ee94da8ed5b0865833"}, - {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:48c19d2159d433ccc99e729ceae7d5293fbffa0bdb94952d3579983d1c8c9d97"}, - {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0e1f928eaf5469c11e886fe0885ad2bf1ec606434e79842a879277895a50942a"}, - {file = "coverage-7.2.7-cp311-cp311-win32.whl", hash = "sha256:33d6d3ea29d5b3a1a632b3c4e4f4ecae24ef170b0b9ee493883f2df10039959a"}, - {file = "coverage-7.2.7-cp311-cp311-win_amd64.whl", hash = "sha256:5b7540161790b2f28143191f5f8ec02fb132660ff175b7747b95dcb77ac26562"}, - {file = "coverage-7.2.7-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f2f67fe12b22cd130d34d0ef79206061bfb5eda52feb6ce0dba0644e20a03cf4"}, - {file = "coverage-7.2.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a342242fe22407f3c17f4b499276a02b01e80f861f1682ad1d95b04018e0c0d4"}, - {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:171717c7cb6b453aebac9a2ef603699da237f341b38eebfee9be75d27dc38e01"}, - {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49969a9f7ffa086d973d91cec8d2e31080436ef0fb4a359cae927e742abfaaa6"}, - {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b46517c02ccd08092f4fa99f24c3b83d8f92f739b4657b0f146246a0ca6a831d"}, - {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:a3d33a6b3eae87ceaefa91ffdc130b5e8536182cd6dfdbfc1aa56b46ff8c86de"}, - {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:976b9c42fb2a43ebf304fa7d4a310e5f16cc99992f33eced91ef6f908bd8f33d"}, - {file = "coverage-7.2.7-cp312-cp312-win32.whl", hash = "sha256:8de8bb0e5ad103888d65abef8bca41ab93721647590a3f740100cd65c3b00511"}, - {file = "coverage-7.2.7-cp312-cp312-win_amd64.whl", hash = "sha256:9e31cb64d7de6b6f09702bb27c02d1904b3aebfca610c12772452c4e6c21a0d3"}, - {file = "coverage-7.2.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:58c2ccc2f00ecb51253cbe5d8d7122a34590fac9646a960d1430d5b15321d95f"}, - {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d22656368f0e6189e24722214ed8d66b8022db19d182927b9a248a2a8a2f67eb"}, - {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a895fcc7b15c3fc72beb43cdcbdf0ddb7d2ebc959edac9cef390b0d14f39f8a9"}, - {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e84606b74eb7de6ff581a7915e2dab7a28a0517fbe1c9239eb227e1354064dcd"}, - {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:0a5f9e1dbd7fbe30196578ca36f3fba75376fb99888c395c5880b355e2875f8a"}, - {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:419bfd2caae268623dd469eff96d510a920c90928b60f2073d79f8fe2bbc5959"}, - {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2aee274c46590717f38ae5e4650988d1af340fe06167546cc32fe2f58ed05b02"}, - {file = "coverage-7.2.7-cp37-cp37m-win32.whl", hash = "sha256:61b9a528fb348373c433e8966535074b802c7a5d7f23c4f421e6c6e2f1697a6f"}, - {file = "coverage-7.2.7-cp37-cp37m-win_amd64.whl", hash = "sha256:b1c546aca0ca4d028901d825015dc8e4d56aac4b541877690eb76490f1dc8ed0"}, - {file = "coverage-7.2.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:54b896376ab563bd38453cecb813c295cf347cf5906e8b41d340b0321a5433e5"}, - {file = "coverage-7.2.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3d376df58cc111dc8e21e3b6e24606b5bb5dee6024f46a5abca99124b2229ef5"}, - {file = "coverage-7.2.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e330fc79bd7207e46c7d7fd2bb4af2963f5f635703925543a70b99574b0fea9"}, - {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e9d683426464e4a252bf70c3498756055016f99ddaec3774bf368e76bbe02b6"}, - {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d13c64ee2d33eccf7437961b6ea7ad8673e2be040b4f7fd4fd4d4d28d9ccb1e"}, - {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b7aa5f8a41217360e600da646004f878250a0d6738bcdc11a0a39928d7dc2050"}, - {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8fa03bce9bfbeeef9f3b160a8bed39a221d82308b4152b27d82d8daa7041fee5"}, - {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:245167dd26180ab4c91d5e1496a30be4cd721a5cf2abf52974f965f10f11419f"}, - {file = "coverage-7.2.7-cp38-cp38-win32.whl", hash = "sha256:d2c2db7fd82e9b72937969bceac4d6ca89660db0a0967614ce2481e81a0b771e"}, - {file = "coverage-7.2.7-cp38-cp38-win_amd64.whl", hash = "sha256:2e07b54284e381531c87f785f613b833569c14ecacdcb85d56b25c4622c16c3c"}, - {file = "coverage-7.2.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:537891ae8ce59ef63d0123f7ac9e2ae0fc8b72c7ccbe5296fec45fd68967b6c9"}, - {file = "coverage-7.2.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:06fb182e69f33f6cd1d39a6c597294cff3143554b64b9825d1dc69d18cc2fff2"}, - {file = "coverage-7.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:201e7389591af40950a6480bd9edfa8ed04346ff80002cec1a66cac4549c1ad7"}, - {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f6951407391b639504e3b3be51b7ba5f3528adbf1a8ac3302b687ecababf929e"}, - {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f48351d66575f535669306aa7d6d6f71bc43372473b54a832222803eb956fd1"}, - {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b29019c76039dc3c0fd815c41392a044ce555d9bcdd38b0fb60fb4cd8e475ba9"}, - {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:81c13a1fc7468c40f13420732805a4c38a105d89848b7c10af65a90beff25250"}, - {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:975d70ab7e3c80a3fe86001d8751f6778905ec723f5b110aed1e450da9d4b7f2"}, - {file = "coverage-7.2.7-cp39-cp39-win32.whl", hash = "sha256:7ee7d9d4822c8acc74a5e26c50604dff824710bc8de424904c0982e25c39c6cb"}, - {file = "coverage-7.2.7-cp39-cp39-win_amd64.whl", hash = "sha256:eb393e5ebc85245347950143969b241d08b52b88a3dc39479822e073a1a8eb27"}, - {file = "coverage-7.2.7-pp37.pp38.pp39-none-any.whl", hash = "sha256:b7b4c971f05e6ae490fef852c218b0e79d4e52f79ef0c8475566584a8fb3e01d"}, - {file = "coverage-7.2.7.tar.gz", hash = "sha256:924d94291ca674905fe9481f12294eb11f2d3d3fd1adb20314ba89e94f44ed59"}, +python-versions = ">=3.8" +files = [ + {file = "coverage-7.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:077d366e724f24fc02dbfe9d946534357fda71af9764ff99d73c3c596001bbd7"}, + {file = "coverage-7.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0193657651f5399d433c92f8ae264aff31fc1d066deee4b831549526433f3f61"}, + {file = "coverage-7.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d17bbc946f52ca67adf72a5ee783cd7cd3477f8f8796f59b4974a9b59cacc9ee"}, + {file = "coverage-7.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3277f5fa7483c927fe3a7b017b39351610265308f5267ac6d4c2b64cc1d8d25"}, + {file = "coverage-7.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6dceb61d40cbfcf45f51e59933c784a50846dc03211054bd76b421a713dcdf19"}, + {file = "coverage-7.4.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6008adeca04a445ea6ef31b2cbaf1d01d02986047606f7da266629afee982630"}, + {file = "coverage-7.4.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c61f66d93d712f6e03369b6a7769233bfda880b12f417eefdd4f16d1deb2fc4c"}, + {file = "coverage-7.4.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b9bb62fac84d5f2ff523304e59e5c439955fb3b7f44e3d7b2085184db74d733b"}, + {file = "coverage-7.4.1-cp310-cp310-win32.whl", hash = "sha256:f86f368e1c7ce897bf2457b9eb61169a44e2ef797099fb5728482b8d69f3f016"}, + {file = "coverage-7.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:869b5046d41abfea3e381dd143407b0d29b8282a904a19cb908fa24d090cc018"}, + {file = "coverage-7.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b8ffb498a83d7e0305968289441914154fb0ef5d8b3157df02a90c6695978295"}, + {file = "coverage-7.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3cacfaefe6089d477264001f90f55b7881ba615953414999c46cc9713ff93c8c"}, + {file = "coverage-7.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d6850e6e36e332d5511a48a251790ddc545e16e8beaf046c03985c69ccb2676"}, + {file = "coverage-7.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18e961aa13b6d47f758cc5879383d27b5b3f3dcd9ce8cdbfdc2571fe86feb4dd"}, + {file = "coverage-7.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dfd1e1b9f0898817babf840b77ce9fe655ecbe8b1b327983df485b30df8cc011"}, + {file = "coverage-7.4.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6b00e21f86598b6330f0019b40fb397e705135040dbedc2ca9a93c7441178e74"}, + {file = "coverage-7.4.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:536d609c6963c50055bab766d9951b6c394759190d03311f3e9fcf194ca909e1"}, + {file = "coverage-7.4.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7ac8f8eb153724f84885a1374999b7e45734bf93a87d8df1e7ce2146860edef6"}, + {file = "coverage-7.4.1-cp311-cp311-win32.whl", hash = "sha256:f3771b23bb3675a06f5d885c3630b1d01ea6cac9e84a01aaf5508706dba546c5"}, + {file = "coverage-7.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:9d2f9d4cc2a53b38cabc2d6d80f7f9b7e3da26b2f53d48f05876fef7956b6968"}, + {file = "coverage-7.4.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f68ef3660677e6624c8cace943e4765545f8191313a07288a53d3da188bd8581"}, + {file = "coverage-7.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:23b27b8a698e749b61809fb637eb98ebf0e505710ec46a8aa6f1be7dc0dc43a6"}, + {file = "coverage-7.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e3424c554391dc9ef4a92ad28665756566a28fecf47308f91841f6c49288e66"}, + {file = "coverage-7.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0860a348bf7004c812c8368d1fc7f77fe8e4c095d661a579196a9533778e156"}, + {file = "coverage-7.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe558371c1bdf3b8fa03e097c523fb9645b8730399c14fe7721ee9c9e2a545d3"}, + {file = "coverage-7.4.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3468cc8720402af37b6c6e7e2a9cdb9f6c16c728638a2ebc768ba1ef6f26c3a1"}, + {file = "coverage-7.4.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:02f2edb575d62172aa28fe00efe821ae31f25dc3d589055b3fb64d51e52e4ab1"}, + {file = "coverage-7.4.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ca6e61dc52f601d1d224526360cdeab0d0712ec104a2ce6cc5ccef6ed9a233bc"}, + {file = "coverage-7.4.1-cp312-cp312-win32.whl", hash = "sha256:ca7b26a5e456a843b9b6683eada193fc1f65c761b3a473941efe5a291f604c74"}, + {file = "coverage-7.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:85ccc5fa54c2ed64bd91ed3b4a627b9cce04646a659512a051fa82a92c04a448"}, + {file = "coverage-7.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8bdb0285a0202888d19ec6b6d23d5990410decb932b709f2b0dfe216d031d218"}, + {file = "coverage-7.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:918440dea04521f499721c039863ef95433314b1db00ff826a02580c1f503e45"}, + {file = "coverage-7.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:379d4c7abad5afbe9d88cc31ea8ca262296480a86af945b08214eb1a556a3e4d"}, + {file = "coverage-7.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b094116f0b6155e36a304ff912f89bbb5067157aff5f94060ff20bbabdc8da06"}, + {file = "coverage-7.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2f5968608b1fe2a1d00d01ad1017ee27efd99b3437e08b83ded9b7af3f6f766"}, + {file = "coverage-7.4.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:10e88e7f41e6197ea0429ae18f21ff521d4f4490aa33048f6c6f94c6045a6a75"}, + {file = "coverage-7.4.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a4a3907011d39dbc3e37bdc5df0a8c93853c369039b59efa33a7b6669de04c60"}, + {file = "coverage-7.4.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6d224f0c4c9c98290a6990259073f496fcec1b5cc613eecbd22786d398ded3ad"}, + {file = "coverage-7.4.1-cp38-cp38-win32.whl", hash = "sha256:23f5881362dcb0e1a92b84b3c2809bdc90db892332daab81ad8f642d8ed55042"}, + {file = "coverage-7.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:a07f61fc452c43cd5328b392e52555f7d1952400a1ad09086c4a8addccbd138d"}, + {file = "coverage-7.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8e738a492b6221f8dcf281b67129510835461132b03024830ac0e554311a5c54"}, + {file = "coverage-7.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46342fed0fff72efcda77040b14728049200cbba1279e0bf1188f1f2078c1d70"}, + {file = "coverage-7.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9641e21670c68c7e57d2053ddf6c443e4f0a6e18e547e86af3fad0795414a628"}, + {file = "coverage-7.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aeb2c2688ed93b027eb0d26aa188ada34acb22dceea256d76390eea135083950"}, + {file = "coverage-7.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d12c923757de24e4e2110cf8832d83a886a4cf215c6e61ed506006872b43a6d1"}, + {file = "coverage-7.4.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0491275c3b9971cdbd28a4595c2cb5838f08036bca31765bad5e17edf900b2c7"}, + {file = "coverage-7.4.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:8dfc5e195bbef80aabd81596ef52a1277ee7143fe419efc3c4d8ba2754671756"}, + {file = "coverage-7.4.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1a78b656a4d12b0490ca72651fe4d9f5e07e3c6461063a9b6265ee45eb2bdd35"}, + {file = "coverage-7.4.1-cp39-cp39-win32.whl", hash = "sha256:f90515974b39f4dea2f27c0959688621b46d96d5a626cf9c53dbc653a895c05c"}, + {file = "coverage-7.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:64e723ca82a84053dd7bfcc986bdb34af8d9da83c521c19d6b472bc6880e191a"}, + {file = "coverage-7.4.1-pp38.pp39.pp310-none-any.whl", hash = "sha256:32a8d985462e37cfdab611a6f95b09d7c091d07668fdc26e47a725ee575fe166"}, + {file = "coverage-7.4.1.tar.gz", hash = "sha256:1ed4b95480952b1a26d863e546fa5094564aa0065e1e5f0d4d0041f293251d04"}, ] [package.dependencies] @@ -199,29 +197,28 @@ files = [ ] [package.dependencies] -importlib-metadata = {version = "<4.3", markers = "python_version < \"3.8\""} mccabe = ">=0.6.0,<0.7.0" pycodestyle = ">=2.8.0,<2.9.0" pyflakes = ">=2.4.0,<2.5.0" [[package]] name = "importlib-metadata" -version = "4.2.0" +version = "7.0.1" description = "Read metadata from Python packages" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "importlib_metadata-4.2.0-py3-none-any.whl", hash = "sha256:057e92c15bc8d9e8109738a48db0ccb31b4d9d5cfbee5a8670879a30be66304b"}, - {file = "importlib_metadata-4.2.0.tar.gz", hash = "sha256:b7e52a1f8dec14a75ea73e0891f3060099ca1d8e6a462a4dff11c3e119ea1b31"}, + {file = "importlib_metadata-7.0.1-py3-none-any.whl", hash = "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e"}, + {file = "importlib_metadata-7.0.1.tar.gz", hash = "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"}, ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] -docs = ["jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "sphinx"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pep517", "pyfakefs", "pytest (>=4.6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-flake8", "pytest-mypy"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +perf = ["ipython"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] [[package]] name = "iniconfig" @@ -293,18 +290,17 @@ altgraph = ">=0.17" [[package]] name = "markdown-it-py" -version = "2.2.0" +version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "markdown-it-py-2.2.0.tar.gz", hash = "sha256:7c9a5e412688bc771c67432cbfebcdd686c93ce6484913dccf06cb5a0bea35a1"}, - {file = "markdown_it_py-2.2.0-py3-none-any.whl", hash = "sha256:5a35f8d1870171d9acc47b99612dc146129b631baf04970128b568f190d0cc30"}, + {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, + {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, ] [package.dependencies] mdurl = ">=0.1,<1.0" -typing_extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} [package.extras] benchmarking = ["psutil", "pytest", "pytest-benchmark"] @@ -313,7 +309,7 @@ compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "mistletoe (>=1.0 linkify = ["linkify-it-py (>=1,<3)"] plugins = ["mdit-py-plugins"] profiling = ["gprof2dot"] -rtd = ["attrs", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] +rtd = ["jupyter_sphinx", "mdit-py-plugins", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] [[package]] @@ -362,13 +358,13 @@ files = [ [[package]] name = "pathspec" -version = "0.11.2" +version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"}, - {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] [[package]] @@ -384,36 +380,30 @@ files = [ [[package]] name = "platformdirs" -version = "4.0.0" +version = "4.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "platformdirs-4.0.0-py3-none-any.whl", hash = "sha256:118c954d7e949b35437270383a3f2531e99dd93cf7ce4dc8340d3356d30f173b"}, - {file = "platformdirs-4.0.0.tar.gz", hash = "sha256:cb633b2bcf10c51af60beb0ab06d2f1d69064b43abf4c185ca6b28865f3f9731"}, + {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, + {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.7.1", markers = "python_version < \"3.8\""} - [package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] +docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] [[package]] name = "pluggy" -version = "1.2.0" +version = "1.4.0" description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, - {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, + {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, + {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -429,6 +419,116 @@ files = [ {file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"}, ] +[[package]] +name = "pydantic" +version = "2.6.0" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.6.0-py3-none-any.whl", hash = "sha256:1440966574e1b5b99cf75a13bec7b20e3512e8a61b894ae252f56275e2c465ae"}, + {file = "pydantic-2.6.0.tar.gz", hash = "sha256:ae887bd94eb404b09d86e4d12f93893bdca79d766e738528c6fa1c849f3c6bcf"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.16.1" +typing-extensions = ">=4.6.1" + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.16.1" +description = "" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.16.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:300616102fb71241ff477a2cbbc847321dbec49428434a2f17f37528721c4948"}, + {file = "pydantic_core-2.16.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5511f962dd1b9b553e9534c3b9c6a4b0c9ded3d8c2be96e61d56f933feef9e1f"}, + {file = "pydantic_core-2.16.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:98f0edee7ee9cc7f9221af2e1b95bd02810e1c7a6d115cfd82698803d385b28f"}, + {file = "pydantic_core-2.16.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9795f56aa6b2296f05ac79d8a424e94056730c0b860a62b0fdcfe6340b658cc8"}, + {file = "pydantic_core-2.16.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c45f62e4107ebd05166717ac58f6feb44471ed450d07fecd90e5f69d9bf03c48"}, + {file = "pydantic_core-2.16.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:462d599299c5971f03c676e2b63aa80fec5ebc572d89ce766cd11ca8bcb56f3f"}, + {file = "pydantic_core-2.16.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21ebaa4bf6386a3b22eec518da7d679c8363fb7fb70cf6972161e5542f470798"}, + {file = "pydantic_core-2.16.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:99f9a50b56713a598d33bc23a9912224fc5d7f9f292444e6664236ae471ddf17"}, + {file = "pydantic_core-2.16.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:8ec364e280db4235389b5e1e6ee924723c693cbc98e9d28dc1767041ff9bc388"}, + {file = "pydantic_core-2.16.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:653a5dfd00f601a0ed6654a8b877b18d65ac32c9d9997456e0ab240807be6cf7"}, + {file = "pydantic_core-2.16.1-cp310-none-win32.whl", hash = "sha256:1661c668c1bb67b7cec96914329d9ab66755911d093bb9063c4c8914188af6d4"}, + {file = "pydantic_core-2.16.1-cp310-none-win_amd64.whl", hash = "sha256:561be4e3e952c2f9056fba5267b99be4ec2afadc27261505d4992c50b33c513c"}, + {file = "pydantic_core-2.16.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:102569d371fadc40d8f8598a59379c37ec60164315884467052830b28cc4e9da"}, + {file = "pydantic_core-2.16.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:735dceec50fa907a3c314b84ed609dec54b76a814aa14eb90da31d1d36873a5e"}, + {file = "pydantic_core-2.16.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e83ebbf020be727d6e0991c1b192a5c2e7113eb66e3def0cd0c62f9f266247e4"}, + {file = "pydantic_core-2.16.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:30a8259569fbeec49cfac7fda3ec8123486ef1b729225222f0d41d5f840b476f"}, + {file = "pydantic_core-2.16.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:920c4897e55e2881db6a6da151198e5001552c3777cd42b8a4c2f72eedc2ee91"}, + {file = "pydantic_core-2.16.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f5247a3d74355f8b1d780d0f3b32a23dd9f6d3ff43ef2037c6dcd249f35ecf4c"}, + {file = "pydantic_core-2.16.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d5bea8012df5bb6dda1e67d0563ac50b7f64a5d5858348b5c8cb5043811c19d"}, + {file = "pydantic_core-2.16.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ed3025a8a7e5a59817b7494686d449ebfbe301f3e757b852c8d0d1961d6be864"}, + {file = "pydantic_core-2.16.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:06f0d5a1d9e1b7932477c172cc720b3b23c18762ed7a8efa8398298a59d177c7"}, + {file = "pydantic_core-2.16.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:150ba5c86f502c040b822777e2e519b5625b47813bd05f9273a8ed169c97d9ae"}, + {file = "pydantic_core-2.16.1-cp311-none-win32.whl", hash = "sha256:d6cbdf12ef967a6aa401cf5cdf47850559e59eedad10e781471c960583f25aa1"}, + {file = "pydantic_core-2.16.1-cp311-none-win_amd64.whl", hash = "sha256:afa01d25769af33a8dac0d905d5c7bb2d73c7c3d5161b2dd6f8b5b5eea6a3c4c"}, + {file = "pydantic_core-2.16.1-cp311-none-win_arm64.whl", hash = "sha256:1a2fe7b00a49b51047334d84aafd7e39f80b7675cad0083678c58983662da89b"}, + {file = "pydantic_core-2.16.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:0f478ec204772a5c8218e30eb813ca43e34005dff2eafa03931b3d8caef87d51"}, + {file = "pydantic_core-2.16.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f1936ef138bed2165dd8573aa65e3095ef7c2b6247faccd0e15186aabdda7f66"}, + {file = "pydantic_core-2.16.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99d3a433ef5dc3021c9534a58a3686c88363c591974c16c54a01af7efd741f13"}, + {file = "pydantic_core-2.16.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bd88f40f2294440d3f3c6308e50d96a0d3d0973d6f1a5732875d10f569acef49"}, + {file = "pydantic_core-2.16.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3fac641bbfa43d5a1bed99d28aa1fded1984d31c670a95aac1bf1d36ac6ce137"}, + {file = "pydantic_core-2.16.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:72bf9308a82b75039b8c8edd2be2924c352eda5da14a920551a8b65d5ee89253"}, + {file = "pydantic_core-2.16.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb4363e6c9fc87365c2bc777a1f585a22f2f56642501885ffc7942138499bf54"}, + {file = "pydantic_core-2.16.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:20f724a023042588d0f4396bbbcf4cffd0ddd0ad3ed4f0d8e6d4ac4264bae81e"}, + {file = "pydantic_core-2.16.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:fb4370b15111905bf8b5ba2129b926af9470f014cb0493a67d23e9d7a48348e8"}, + {file = "pydantic_core-2.16.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:23632132f1fd608034f1a56cc3e484be00854db845b3a4a508834be5a6435a6f"}, + {file = "pydantic_core-2.16.1-cp312-none-win32.whl", hash = "sha256:b9f3e0bffad6e238f7acc20c393c1ed8fab4371e3b3bc311020dfa6020d99212"}, + {file = "pydantic_core-2.16.1-cp312-none-win_amd64.whl", hash = "sha256:a0b4cfe408cd84c53bab7d83e4209458de676a6ec5e9c623ae914ce1cb79b96f"}, + {file = "pydantic_core-2.16.1-cp312-none-win_arm64.whl", hash = "sha256:d195add190abccefc70ad0f9a0141ad7da53e16183048380e688b466702195dd"}, + {file = "pydantic_core-2.16.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:502c062a18d84452858f8aea1e520e12a4d5228fc3621ea5061409d666ea1706"}, + {file = "pydantic_core-2.16.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d8c032ccee90b37b44e05948b449a2d6baed7e614df3d3f47fe432c952c21b60"}, + {file = "pydantic_core-2.16.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:920f4633bee43d7a2818e1a1a788906df5a17b7ab6fe411220ed92b42940f818"}, + {file = "pydantic_core-2.16.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9f5d37ff01edcbace53a402e80793640c25798fb7208f105d87a25e6fcc9ea06"}, + {file = "pydantic_core-2.16.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:399166f24c33a0c5759ecc4801f040dbc87d412c1a6d6292b2349b4c505effc9"}, + {file = "pydantic_core-2.16.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ac89ccc39cd1d556cc72d6752f252dc869dde41c7c936e86beac5eb555041b66"}, + {file = "pydantic_core-2.16.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73802194f10c394c2bedce7a135ba1d8ba6cff23adf4217612bfc5cf060de34c"}, + {file = "pydantic_core-2.16.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8fa00fa24ffd8c31fac081bf7be7eb495be6d248db127f8776575a746fa55c95"}, + {file = "pydantic_core-2.16.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:601d3e42452cd4f2891c13fa8c70366d71851c1593ed42f57bf37f40f7dca3c8"}, + {file = "pydantic_core-2.16.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07982b82d121ed3fc1c51faf6e8f57ff09b1325d2efccaa257dd8c0dd937acca"}, + {file = "pydantic_core-2.16.1-cp38-none-win32.whl", hash = "sha256:d0bf6f93a55d3fa7a079d811b29100b019784e2ee6bc06b0bb839538272a5610"}, + {file = "pydantic_core-2.16.1-cp38-none-win_amd64.whl", hash = "sha256:fbec2af0ebafa57eb82c18c304b37c86a8abddf7022955d1742b3d5471a6339e"}, + {file = "pydantic_core-2.16.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a497be217818c318d93f07e14502ef93d44e6a20c72b04c530611e45e54c2196"}, + {file = "pydantic_core-2.16.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:694a5e9f1f2c124a17ff2d0be613fd53ba0c26de588eb4bdab8bca855e550d95"}, + {file = "pydantic_core-2.16.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d4dfc66abea3ec6d9f83e837a8f8a7d9d3a76d25c9911735c76d6745950e62c"}, + {file = "pydantic_core-2.16.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8655f55fe68c4685673265a650ef71beb2d31871c049c8b80262026f23605ee3"}, + {file = "pydantic_core-2.16.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:21e3298486c4ea4e4d5cc6fb69e06fb02a4e22089304308817035ac006a7f506"}, + {file = "pydantic_core-2.16.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:71b4a48a7427f14679f0015b13c712863d28bb1ab700bd11776a5368135c7d60"}, + {file = "pydantic_core-2.16.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10dca874e35bb60ce4f9f6665bfbfad050dd7573596608aeb9e098621ac331dc"}, + {file = "pydantic_core-2.16.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fa496cd45cda0165d597e9d6f01e36c33c9508f75cf03c0a650018c5048f578e"}, + {file = "pydantic_core-2.16.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5317c04349472e683803da262c781c42c5628a9be73f4750ac7d13040efb5d2d"}, + {file = "pydantic_core-2.16.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:42c29d54ed4501a30cd71015bf982fa95e4a60117b44e1a200290ce687d3e640"}, + {file = "pydantic_core-2.16.1-cp39-none-win32.whl", hash = "sha256:ba07646f35e4e49376c9831130039d1b478fbfa1215ae62ad62d2ee63cf9c18f"}, + {file = "pydantic_core-2.16.1-cp39-none-win_amd64.whl", hash = "sha256:2133b0e412a47868a358713287ff9f9a328879da547dc88be67481cdac529118"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:d25ef0c33f22649b7a088035fd65ac1ce6464fa2876578df1adad9472f918a76"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:99c095457eea8550c9fa9a7a992e842aeae1429dab6b6b378710f62bfb70b394"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b49c604ace7a7aa8af31196abbf8f2193be605db6739ed905ecaf62af31ccae0"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c56da23034fe66221f2208c813d8aa509eea34d97328ce2add56e219c3a9f41c"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cebf8d56fee3b08ad40d332a807ecccd4153d3f1ba8231e111d9759f02edfd05"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:1ae8048cba95f382dba56766525abca438328455e35c283bb202964f41a780b0"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:780daad9e35b18d10d7219d24bfb30148ca2afc309928e1d4d53de86822593dc"}, + {file = "pydantic_core-2.16.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:c94b5537bf6ce66e4d7830c6993152940a188600f6ae044435287753044a8fe2"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:adf28099d061a25fbcc6531febb7a091e027605385de9fe14dd6a97319d614cf"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:644904600c15816a1f9a1bafa6aab0d21db2788abcdf4e2a77951280473f33e1"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87bce04f09f0552b66fca0c4e10da78d17cb0e71c205864bab4e9595122cb9d9"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:877045a7969ace04d59516d5d6a7dee13106822f99a5d8df5e6822941f7bedc8"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9c46e556ee266ed3fb7b7a882b53df3c76b45e872fdab8d9cf49ae5e91147fd7"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:4eebbd049008eb800f519578e944b8dc8e0f7d59a5abb5924cc2d4ed3a1834ff"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:c0be58529d43d38ae849a91932391eb93275a06b93b79a8ab828b012e916a206"}, + {file = "pydantic_core-2.16.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b1fc07896fc1851558f532dffc8987e526b682ec73140886c831d773cef44b76"}, + {file = "pydantic_core-2.16.1.tar.gz", hash = "sha256:daff04257b49ab7f4b3f73f98283d3dbb1a65bf3500d55c7beac3c66c310fe34"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pyflakes" version = "2.4.0" @@ -478,7 +578,6 @@ files = [ [package.dependencies] altgraph = "*" -importlib-metadata = {version = ">=1.4", markers = "python_version < \"3.8\""} macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""} pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""} pyinstaller-hooks-contrib = ">=2021.4" @@ -491,30 +590,34 @@ hook-testing = ["execnet (>=1.5.0)", "psutil", "pytest (>=2.7.3)"] [[package]] name = "pyinstaller-hooks-contrib" -version = "2023.10" +version = "2024.0" description = "Community maintained hooks for PyInstaller" optional = false python-versions = ">=3.7" files = [ - {file = "pyinstaller-hooks-contrib-2023.10.tar.gz", hash = "sha256:4b4a998036abb713774cb26534ca06b7e6e09e4c628196017a10deb11a48747f"}, - {file = "pyinstaller_hooks_contrib-2023.10-py2.py3-none-any.whl", hash = "sha256:6dc1786a8f452941245d5bb85893e2a33632ebdcbc4c23eea41f2ee08281b0c0"}, + {file = "pyinstaller-hooks-contrib-2024.0.tar.gz", hash = "sha256:a7118c1a5c9788595e5c43ad058a7a5b7b6d59e1eceb42362f6ec1f0b61986b0"}, + {file = "pyinstaller_hooks_contrib-2024.0-py2.py3-none-any.whl", hash = "sha256:469b5690df53223e2e8abffb2e44d6ee596e7d79d4b1eed9465123b67439875a"}, ] +[package.dependencies] +importlib-metadata = {version = ">=4.6", markers = "python_version < \"3.10\""} +packaging = ">=22.0" +setuptools = ">=42.0.0" + [[package]] name = "pytest" -version = "7.4.3" +version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, - {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, ] [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -625,26 +728,25 @@ files = [ [package.dependencies] markdown-it-py = ">=2.2.0" pygments = ">=2.13.0,<3.0.0" -typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "setuptools" -version = "68.0.0" +version = "69.0.3" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "setuptools-68.0.0-py3-none-any.whl", hash = "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f"}, - {file = "setuptools-68.0.0.tar.gz", hash = "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235"}, + {file = "setuptools-69.0.3-py3-none-any.whl", hash = "sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05"}, + {file = "setuptools-69.0.3.tar.gz", hash = "sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "tomli" @@ -657,83 +759,33 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "typed-ast" -version = "1.5.5" -description = "a fork of Python 2 and 3 ast modules with type comment support" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typed_ast-1.5.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4bc1efe0ce3ffb74784e06460f01a223ac1f6ab31c6bc0376a21184bf5aabe3b"}, - {file = "typed_ast-1.5.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f7a8c46a8b333f71abd61d7ab9255440d4a588f34a21f126bbfc95f6049e686"}, - {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:597fc66b4162f959ee6a96b978c0435bd63791e31e4f410622d19f1686d5e769"}, - {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d41b7a686ce653e06c2609075d397ebd5b969d821b9797d029fccd71fdec8e04"}, - {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5fe83a9a44c4ce67c796a1b466c270c1272e176603d5e06f6afbc101a572859d"}, - {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d5c0c112a74c0e5db2c75882a0adf3133adedcdbfd8cf7c9d6ed77365ab90a1d"}, - {file = "typed_ast-1.5.5-cp310-cp310-win_amd64.whl", hash = "sha256:e1a976ed4cc2d71bb073e1b2a250892a6e968ff02aa14c1f40eba4f365ffec02"}, - {file = "typed_ast-1.5.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c631da9710271cb67b08bd3f3813b7af7f4c69c319b75475436fcab8c3d21bee"}, - {file = "typed_ast-1.5.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b445c2abfecab89a932b20bd8261488d574591173d07827c1eda32c457358b18"}, - {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc95ffaaab2be3b25eb938779e43f513e0e538a84dd14a5d844b8f2932593d88"}, - {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61443214d9b4c660dcf4b5307f15c12cb30bdfe9588ce6158f4a005baeb167b2"}, - {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6eb936d107e4d474940469e8ec5b380c9b329b5f08b78282d46baeebd3692dc9"}, - {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e48bf27022897577d8479eaed64701ecaf0467182448bd95759883300ca818c8"}, - {file = "typed_ast-1.5.5-cp311-cp311-win_amd64.whl", hash = "sha256:83509f9324011c9a39faaef0922c6f720f9623afe3fe220b6d0b15638247206b"}, - {file = "typed_ast-1.5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:44f214394fc1af23ca6d4e9e744804d890045d1643dd7e8229951e0ef39429b5"}, - {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:118c1ce46ce58fda78503eae14b7664163aa735b620b64b5b725453696f2a35c"}, - {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be4919b808efa61101456e87f2d4c75b228f4e52618621c77f1ddcaae15904fa"}, - {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:fc2b8c4e1bc5cd96c1a823a885e6b158f8451cf6f5530e1829390b4d27d0807f"}, - {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:16f7313e0a08c7de57f2998c85e2a69a642e97cb32f87eb65fbfe88381a5e44d"}, - {file = "typed_ast-1.5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:2b946ef8c04f77230489f75b4b5a4a6f24c078be4aed241cfabe9cbf4156e7e5"}, - {file = "typed_ast-1.5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2188bc33d85951ea4ddad55d2b35598b2709d122c11c75cffd529fbc9965508e"}, - {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0635900d16ae133cab3b26c607586131269f88266954eb04ec31535c9a12ef1e"}, - {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57bfc3cf35a0f2fdf0a88a3044aafaec1d2f24d8ae8cd87c4f58d615fb5b6311"}, - {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:fe58ef6a764de7b4b36edfc8592641f56e69b7163bba9f9c8089838ee596bfb2"}, - {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d09d930c2d1d621f717bb217bf1fe2584616febb5138d9b3e8cdd26506c3f6d4"}, - {file = "typed_ast-1.5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:d40c10326893ecab8a80a53039164a224984339b2c32a6baf55ecbd5b1df6431"}, - {file = "typed_ast-1.5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:fd946abf3c31fb50eee07451a6aedbfff912fcd13cf357363f5b4e834cc5e71a"}, - {file = "typed_ast-1.5.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ed4a1a42df8a3dfb6b40c3d2de109e935949f2f66b19703eafade03173f8f437"}, - {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:045f9930a1550d9352464e5149710d56a2aed23a2ffe78946478f7b5416f1ede"}, - {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:381eed9c95484ceef5ced626355fdc0765ab51d8553fec08661dce654a935db4"}, - {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:bfd39a41c0ef6f31684daff53befddae608f9daf6957140228a08e51f312d7e6"}, - {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8c524eb3024edcc04e288db9541fe1f438f82d281e591c548903d5b77ad1ddd4"}, - {file = "typed_ast-1.5.5-cp38-cp38-win_amd64.whl", hash = "sha256:7f58fabdde8dcbe764cef5e1a7fcb440f2463c1bbbec1cf2a86ca7bc1f95184b"}, - {file = "typed_ast-1.5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:042eb665ff6bf020dd2243307d11ed626306b82812aba21836096d229fdc6a10"}, - {file = "typed_ast-1.5.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:622e4a006472b05cf6ef7f9f2636edc51bda670b7bbffa18d26b255269d3d814"}, - {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1efebbbf4604ad1283e963e8915daa240cb4bf5067053cf2f0baadc4d4fb51b8"}, - {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0aefdd66f1784c58f65b502b6cf8b121544680456d1cebbd300c2c813899274"}, - {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:48074261a842acf825af1968cd912f6f21357316080ebaca5f19abbb11690c8a"}, - {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:429ae404f69dc94b9361bb62291885894b7c6fb4640d561179548c849f8492ba"}, - {file = "typed_ast-1.5.5-cp39-cp39-win_amd64.whl", hash = "sha256:335f22ccb244da2b5c296e6f96b06ee9bed46526db0de38d2f0e5a6597b81155"}, - {file = "typed_ast-1.5.5.tar.gz", hash = "sha256:94282f7a354f36ef5dbce0ef3467ebf6a258e370ab33d5b40c249fa996e590dd"}, -] - [[package]] name = "typing-extensions" -version = "4.7.1" -description = "Backported and Experimental Type Hints for Python 3.7+" +version = "4.9.0" +description = "Backported and Experimental Type Hints for Python 3.8+" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, - {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, + {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, + {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, ] [[package]] name = "zipp" -version = "3.15.0" +version = "3.17.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, - {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, + {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, + {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] [metadata] lock-version = "2.0" -python-versions = ">=3.7,<3.12" -content-hash = "eb3be781e9f724cb32e1e6430c5b2f85e8e0885ccf232e1995ef55997fcd5435" +python-versions = ">=3.9,<3.12" +content-hash = "ada829cdd7cff1fe545590d19e21cbe8d1ebf2c989c3dc220caf8b1875622ca5" diff --git a/pyproject.toml b/pyproject.toml index 66e9864..71373dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "blint" -version = "1.0.35" +version = "2.0.0" description = "Linter for binary files powered by lief" authors = ["Prabhu Subramanian "] license = "Apache-2.0" @@ -14,8 +14,6 @@ classifiers = [ "Intended Audience :: System Administrators", "Topic :: Utilities", "Topic :: Security", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -30,11 +28,12 @@ include = ["blint/data/*.yml"] blint = 'blint.cli:main' [tool.poetry.dependencies] -python = ">=3.7,<3.12" +python = ">=3.9,<3.12" lief = "^0.12.3" rich = "^13.4.1" PyYAML = "^6.0" defusedxml = "^0.7.1" +pydantic = "^2.6.0" [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" diff --git a/tests/data/apk-features.txt b/tests/data/apk-features.txt new file mode 100644 index 0000000..b47f20a --- /dev/null +++ b/tests/data/apk-features.txt @@ -0,0 +1,2 @@ +android.hardware.location implied: requested android.permission.ACCESS_COARSE_LOCATION permission, and requested android.permission.ACCESS_FINE_LOCATION permission +android.hardware.wifi implied: requested android.permission.ACCESS_WIFI_STATE permission, and requested android.permission.CHANGE_WIFI_MULTICAST_STATE permission diff --git a/tests/data/apk-manifest.txt b/tests/data/apk-manifest.txt new file mode 100644 index 0000000..ae48d3b --- /dev/null +++ b/tests/data/apk-manifest.txt @@ -0,0 +1,1923 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/data/apk-permissions.txt b/tests/data/apk-permissions.txt new file mode 100644 index 0000000..25929e2 --- /dev/null +++ b/tests/data/apk-permissions.txt @@ -0,0 +1,42 @@ +android.permission.BLUETOOTH_ADMIN' maxSdkVersion='30 +android.permission.CALL_PHONE +android.permission.FOREGROUND_SERVICE +android.permission.SYSTEM_ALERT_WINDOW +io.homeassistant.companion.android.debug.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION +android.permission.READ_EXTERNAL_STORAGE' maxSdkVersion='28 +android.permission.RECEIVE_BOOT_COMPLETED +android.permission.NFC +android.permission.BLUETOOTH' maxSdkVersion='30 +android.permission.BLUETOOTH_ADVERTISE +android.permission.ACCESS_FINE_LOCATION +android.permission.ACCESS_NOTIFICATION_POLICY +android.permission.ACCESS_COARSE_LOCATION +android.permission.ACCESS_NETWORK_STATE +android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS +android.permission.WAKE_LOCK +android.permission.ACCESS_WIFI_STATE +android.permission.USE_FINGERPRINT +com.google.android.gms.permission.CAR_FUEL +android.permission.POST_NOTIFICATIONS +com.google.android.c2dm.permission.RECEIVE +com.google.android.gms.permission.CAR_MILEAGE +android.permission.PACKAGE_USAGE_STATS +android.permission.BLUETOOTH_SCAN +android.permission.ACCESS_BACKGROUND_LOCATION +android.permission.QUERY_ALL_PACKAGES +android.permission.CHANGE_WIFI_MULTICAST_STATE +android.permission.VIBRATE +android.permission.RECORD_AUDIO +com.android.alarm.permission.SET_ALARM +android.permission.FOREGROUND_SERVICE_LOCATION +android.permission.SCHEDULE_EXACT_ALARM +android.permission.INTERNET +android.permission.USE_BIOMETRIC +android.permission.ACTIVITY_RECOGNITION +android.permission.CAMERA +android.permission.MODIFY_AUDIO_SETTINGS +android.permission.WRITE_EXTERNAL_STORAGE' maxSdkVersion='28 +android.permission.BLUETOOTH_CONNECT +android.permission.READ_PHONE_STATE +android.permission.WRITE_SETTINGS +com.google.android.gms.permission.ACTIVITY_RECOGNITION diff --git a/tests/data/apk-summary.txt b/tests/data/apk-summary.txt new file mode 100644 index 0000000..d4c68e9 --- /dev/null +++ b/tests/data/apk-summary.txt @@ -0,0 +1 @@ +io.homeassistant.companion.android.debug 1 2024.2.1-beta.0.0+20240202T181312Z-full diff --git a/tests/test_android.py b/tests/test_android.py new file mode 100644 index 0000000..02e104b --- /dev/null +++ b/tests/test_android.py @@ -0,0 +1,10 @@ +from pathlib import Path + +from blint.android import parse_apk_summary + + +def test_parse_summary(): + test_summary_file = Path(__file__).parent / "data" / "apk-summary.txt" + with open(test_summary_file) as fp: + comp = parse_apk_summary(fp.read()) + assert comp