Skip to content

Commit dc25a80

Browse files
committed
chore: add integration test for asset information
Signed-off-by: Ben Selwyn-Smith <[email protected]>
1 parent 1e00428 commit dc25a80

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

src/macaron/slsa_analyzer/checks/provenance_available_check.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
logger: logging.Logger = logging.getLogger(__name__)
2121

22-
# TODO replace this check with the provenance verification check.
23-
2422

2523
class ProvenanceAvailableException(MacaronError):
2624
"""When there is an error while checking if a provenance is available."""
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* Copyright (c) 2025 - 2025, Oracle and/or its affiliates. All rights reserved. */
2+
/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */
3+
4+
#include "prelude.dl"
5+
6+
Policy("test_policy", component_id, "") :-
7+
check_passed(component_id, "mcn_provenance_available_1"),
8+
provenance_available_check(_, asset_name, asset_url),
9+
asset_name = "toga",
10+
asset_url = "https://pypi.org/integrity/toga/0.5.1/toga-0.5.1-py3-none-any.whl/provenance".
11+
12+
apply_policy_to("test_policy", component_id) :-
13+
is_component(component_id, "pkg:pypi/[email protected]").
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2025 - 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
3+
4+
description: |
5+
Analyzing a PyPI PURL that has provenance available on the PyPI registry.
6+
7+
tags:
8+
- macaron-python-package
9+
10+
steps:
11+
- name: Run macaron analyze
12+
kind: analyze
13+
options:
14+
command_args:
15+
- -purl
16+
- pkg:pypi/[email protected]
17+
- name: Run macaron verify-policy to verify passed/failed checks
18+
kind: verify
19+
options:
20+
policy: policy.dl

0 commit comments

Comments
 (0)