Skip to content

Commit 4278e24

Browse files
authored
tests: Remove hacks that were needed before staging rekorv2 (#1519)
1 parent c8d3138 commit 4278e24

File tree

5 files changed

+6
-227
lines changed

5 files changed

+6
-227
lines changed

test/assets/trust_config/staging-but-sign-with-rekor-v2.json

Lines changed: 0 additions & 183 deletions
This file was deleted.

test/integration/cli/test_sign.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ def test_sign_success_multiple_artifacts_rekor_v2(
140140
sigstore(
141141
*get_cli_params(
142142
artifact_paths=artifacts,
143-
trust_config_path=asset("trust_config/staging-but-sign-with-rekor-v2.json"),
144143
output_directory=tmp_path,
145144
)
146145
)

test/unit/conftest.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from id import (
3232
detect_credential,
3333
)
34-
from sigstore_models.trustroot.v1 import Service
3534
from tuf.api.exceptions import DownloadHTTPError
3635
from tuf.ngclient import FetcherInterface, updater
3736

@@ -238,38 +237,6 @@ def signer():
238237
return signer, verifier, IdentityToken(token)
239238

240239

241-
@pytest.fixture
242-
def staging_with_rekorv2() -> tuple[
243-
type[SigningContext], type[Verifier], IdentityToken
244-
]:
245-
"""
246-
Returns a SigningContext, Verifier, and IdentityToken for the staging environment.
247-
The signingContext will use the Rekor V2 instance even if it is not yet enabled in
248-
staging signing config.
249-
"""
250-
251-
def signer():
252-
trust_config = ClientTrustConfig.staging()
253-
trust_config.signing_config._tlogs.append(
254-
Service(
255-
url="https://log2025-alpha1.rekor.sigstage.dev",
256-
major_api_version=2,
257-
operator="sigstage.dev",
258-
)
259-
)
260-
return SigningContext.from_trust_config(trust_config)
261-
262-
verifier = Verifier.staging
263-
264-
# Detect env variable for local interactive tests.
265-
token = os.getenv("SIGSTORE_IDENTITY_TOKEN_staging")
266-
if not token:
267-
# If the variable is not defined, try getting an ambient token.
268-
token = detect_credential(TEST_CLIENT_ID)
269-
270-
return signer, verifier, IdentityToken(token)
271-
272-
273240
@pytest.fixture
274241
def dummy_jwt():
275242
def _dummy_jwt(claims: dict):

test/unit/internal/rekor/test_client_v2.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@
2222

2323
@pytest.mark.staging
2424
@pytest.mark.ambient_oidc
25-
def test_rekor_v2_create_entry_dsse(staging_with_rekorv2):
25+
def test_rekor_v2_create_entry_dsse(staging):
2626
# This is not a real unit test: it requires not only staging rekor but also TUF
2727
# fulcio and oidc -- maybe useful only until we have real integration tests in place
28-
sign_ctx_cls, _, identity = staging_with_rekorv2
29-
30-
# Hack to run Signer.sign() with staging rekor v2
28+
sign_ctx_cls, _, identity = staging
3129
sign_ctx = sign_ctx_cls()
3230

3331
stmt = (
@@ -56,12 +54,10 @@ def test_rekor_v2_create_entry_dsse(staging_with_rekorv2):
5654

5755
@pytest.mark.staging
5856
@pytest.mark.ambient_oidc
59-
def test_rekor_v2_create_entry_hashed_rekord(staging_with_rekorv2):
57+
def test_rekor_v2_create_entry_hashed_rekord(staging):
6058
# This is not a real unit test: it requires not only staging rekor but also TUF
6159
# fulcio and oidc -- maybe useful only until we have real integration tests in place
62-
sign_ctx_cls, _, identity = staging_with_rekorv2
63-
64-
# Hack to run Signer.sign() with staging rekor v2
60+
sign_ctx_cls, _, identity = staging
6561
sign_ctx = sign_ctx_cls()
6662

6763
with sign_ctx.signer(identity) as signer:

test/unit/test_sign.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def test_sign_rekor_entry_consistent(request, sign_ctx_and_ident_for_env):
5959

6060
@pytest.mark.staging
6161
@pytest.mark.ambient_oidc
62-
def test_sign_with_staging_rekor_v2(staging_with_rekorv2, null_policy):
63-
ctx_cls, verifier_cls, identity = staging_with_rekorv2
62+
def test_sign_with_staging(staging, null_policy):
63+
ctx_cls, verifier_cls, identity = staging
6464

6565
ctx: SigningContext = ctx_cls()
6666
verifier = verifier_cls()

0 commit comments

Comments
 (0)