INNER CODE UNIT · Python

verify

wolfSSL/wolfssl · scripts/bomsh_verify.py:160

def verify(spdx_glob, omnibor_dir):
    """Orchestrate the two checks.  Returns (ok: bool, messages:
    List[str]).  `messages` is appended to in success and failure both,
    so callers can log the success lines ('OK: N gitoid(s) verified' +
    '    objects round-trip: M blobs') even when ok is True."""
    messages: List[str] = []

    spdx_paths = sorted(_glob.glob(spdx_glob))
    if not spdx_paths:
        return False, [f'no SPDX matched {spdx_glob!r}']
    spdx_path = spdx_paths[0]
    try:
        spdx_gitoids = load_spdx_gitoids(spdx_path)
    except (json.JSONDecodeError, ValueError) as e:
        return False, [f'could not load SPDX gitoids: {e}']
    if not spdx_gitoids:
        return False, [f'no gitoid externalRefs in {spdx_path}']

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…