Skip to content

Commit 5746d0c

Browse files
committed
rekor: remove timeout for now
* The timeout was a little misleading (since requests timeout is not the total maximum time of the request) and we don't have specific timeouts elsewhere either. * Also remove some unused variables Signed-off-by: Jussi Kukkonen <[email protected]>
1 parent d80c25c commit 5746d0c

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

sigstore/_internal/rekor/client_v2.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,14 @@
3737

3838
_logger = logging.getLogger(__name__)
3939

40-
DEFAULT_REKOR_URL = "https://rekor.sigstore.dev"
41-
STAGING_REKOR_URL = "https://rekor.sigstage.dev"
42-
43-
# TODO: Link to merged documenation.
44-
# See https://github.com/sigstore/rekor-tiles/pull/255/files#diff-eb568acf84d583e4d3734b07773e96912277776bad39c560392aa33ea2cf2210R196
45-
CREATE_ENTRIES_TIMEOUT_SECONDS = 20
46-
4740
DEFAULT_KEY_DETAILS = common_v1.PublicKeyDetails.PKIX_ECDSA_P384_SHA_256
4841

4942

5043
class RekorV2Client(RekorLogSubmitter):
51-
"""The internal Rekor client for the v2 API"""
44+
"""The internal Rekor client for the v2 API
5245
53-
# TODO: implement get_tile, get_entry_bundle, get_checkpoint.
46+
See https://github.com/sigstore/rekor-tiles/blob/main/CLIENTS.md
47+
"""
5448

5549
def __init__(self, base_url: str) -> None:
5650
"""
@@ -75,12 +69,15 @@ def __del__(self) -> None:
7569
def create_entry(self, payload: EntryRequest) -> LogEntry:
7670
"""
7771
Submit a new entry for inclusion in the Rekor log.
72+
73+
Note that this call can take a fairly long time as the log
74+
only responds after the entry has been included in the log.
75+
https://github.com/sigstore/rekor-tiles/blob/main/CLIENTS.md#handling-longer-requests
7876
"""
7977
_logger.debug(f"proposed: {json.dumps(payload)}")
8078
resp = self.session.post(
8179
f"{self.url}/log/entries",
8280
json=payload,
83-
timeout=CREATE_ENTRIES_TIMEOUT_SECONDS,
8481
)
8582

8683
try:

test/unit/internal/rekor/test_client_v2.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
ALPHA_REKOR_V2_URL = "https://log2025-alpha1.rekor.sigstage.dev"
1313

14+
1415
@pytest.mark.staging
1516
@pytest.mark.ambient_oidc
1617
def test_rekor_v2_create_entry_dsse(staging):
17-
# This is not a real unit test: it requires not only staging rekor but also TUF
18+
# This is not a real unit test: it requires not only staging rekor but also TUF
1819
# fulcio and oidc -- maybe useful only until we have real integration tests in place
1920
sign_ctx_cls, _, identity = staging
2021

@@ -50,18 +51,16 @@ def test_rekor_v2_create_entry_dsse(staging):
5051
@pytest.mark.staging
5152
@pytest.mark.ambient_oidc
5253
def test_rekor_v2_create_entry_hashed_rekord(staging):
53-
# This is not a real unit test: it requires not only staging rekor but also TUF
54+
# This is not a real unit test: it requires not only staging rekor but also TUF
5455
# fulcio and oidc -- maybe useful only until we have real integration tests in place
5556
sign_ctx_cls, _, identity = staging
5657

5758
# Hack to run Signer.sign() with staging rekor v2
5859
sign_ctx = sign_ctx_cls()
5960
sign_ctx._rekor = RekorV2Client(ALPHA_REKOR_V2_URL)
6061

61-
6262
with sign_ctx.signer(identity) as signer:
6363
bundle = signer.sign_artifact(b"")
6464

6565
assert isinstance(bundle.log_entry, LogEntry)
6666
assert isinstance(bundle.log_entry._to_rekor(), rekor_v1.TransparencyLogEntry)
67-

0 commit comments

Comments
 (0)