1
1
import hashlib
2
- import os
3
2
import secrets
4
3
5
4
import pytest
6
- from id import (
7
- detect_credential ,
8
- )
9
5
10
6
from sigstore import dsse
11
- from sigstore ._internal .rekor .client import STAGING_REKOR_URL
7
+ from sigstore ._internal .rekor .client import DEFAULT_REKOR_URL , STAGING_REKOR_URL
12
8
from sigstore ._internal .rekor .client_v2 import (
13
9
DEFAULT_KEY_DETAILS ,
14
10
Certificate ,
20
16
v2 ,
21
17
v2_intoto ,
22
18
)
23
- from sigstore ._internal .trust import ClientTrustConfig
24
19
from sigstore ._utils import sha256_digest
25
20
from sigstore .models import rekor_v1
26
- from sigstore .oidc import _DEFAULT_AUDIENCE , IdentityToken
27
- from sigstore .sign import SigningContext , ec
21
+ from sigstore .sign import ec
28
22
29
23
ALPHA_REKOR_V2_URL = "https://log2025-alpha1.rekor.sigstage.dev"
30
24
LOCAL_REKOR_V2_URL = "http://localhost:3000"
37
31
params = [
38
32
ALPHA_REKOR_V2_URL ,
39
33
pytest .param (STAGING_REKOR_URL , marks = pytest .mark .xfail ),
40
- # pytest.param(DEFAULT_REKOR_URL, marks=pytest.mark.xfail ),
41
- # pytest.param(LOCAL_REKOR_V2_URL, marks=pytest.mark.xfail ),
34
+ pytest .param (DEFAULT_REKOR_URL , marks = pytest .mark .skip ),
35
+ pytest .param (LOCAL_REKOR_V2_URL , marks = pytest .mark .skip ),
42
36
],
43
37
)
44
38
def client (request ) -> RekorV2Client :
@@ -50,19 +44,14 @@ def client(request) -> RekorV2Client:
50
44
51
45
52
46
@pytest .fixture (scope = "session" )
53
- def sample_cert_and_private_key () -> tuple [Certificate , ec .EllipticCurvePrivateKey ]:
47
+ def sample_cert_and_private_key (
48
+ staging ,
49
+ ) -> tuple [Certificate , ec .EllipticCurvePrivateKey ]:
54
50
"""
55
51
Returns a sample Certificate and ec.EllipticCurvePrivateKey.
56
52
"""
57
- # Detect env variable for local interactive tests.
58
- token = os .getenv ("SIGSTORE_IDENTITY_TOKEN_staging" )
59
- if not token :
60
- # If the variable is not defined, try getting an ambient token.
61
- token = detect_credential (_DEFAULT_AUDIENCE )
62
-
63
- with SigningContext .from_trust_config (ClientTrustConfig .staging ()).signer (
64
- IdentityToken (token )
65
- ) as signer :
53
+ sign_ctx_cls , _ , identity = staging
54
+ with sign_ctx_cls ().signer (identity ) as signer :
66
55
return signer ._signing_cert (), signer ._private_key
67
56
68
57
0 commit comments