1
0
mirror of https://github.com/goharbor/harbor.git synced 2026-10-24 21:59:32 +03:00
Files
harbor/tests/apitests/python/library/notation.py
Ikram ALOUI ee315015ad test: add API test for signature inheritance on OCI index children (#23707)
Covers the inherited_accessories field added in #23540. The test signs an
index with cosign and with notation, then checks that a child of that index
reports both signatures as inherited with the index digest as their subject,
while owning no accessory of its own and returning nothing extra on a request
that does not ask for them.

notation cert generate-test refuses to overwrite an existing key, so
generate_cert takes a common name and this test uses one of its own instead of
colliding with test_notation_sign_artifact.py in the same suite.

Signed-off-by: Ikram Aloui <ikram@container-registry.com>
Co-authored-by: Ikram Aloui <ikram@container-registry.com>
Co-authored-by: Prasanth Baskar <prasanth@8gears.com>
Co-authored-by: Wang Yan <wangyan_0219@hotmail.com>
2026-08-17 06:50:41 +00:00

13 lines
499 B
Python

# -*- coding: utf-8 -*-
import base
def generate_cert(common_name = "wabbit-networks.io"):
# notation refuses to overwrite an existing key, so a test that runs in the same suite as
# another notation test has to ask for a common name of its own.
command = ["notation", "cert", "generate-test", "--default", common_name]
base.run_command(command)
def sign_artifact(artifact):
command = ["notation", "sign", "-d", "--allow-referrers-api", artifact]
base.run_command(command)