Skip to content

Commit 43dc468

Browse files
Revert "betterproto: avoid assigning a var of type Optional[InclusionPromise] to TransparencyLogEntry.inclusion_promise"
This reverts commit 46b0087. Signed-off-by: Ramon Petgrave <[email protected]>
1 parent c961b52 commit 43dc468

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ All versions prior to 0.9.0 are untracked.
1010

1111
### Fixed
1212

13-
* Avoid pydantic's instantiation issues with `TransparencyLogEntry` when `InclusionPromise` is not present.
14-
1513
* TSA: Changed the Timestamp Authority requests to explicitly use sha256 for message digests.
1614
[#1373](https://github.com/sigstore/sigstore-python/pull/1373)
1715

sigstore/models.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ def _to_rekor(self) -> rekor_v1.TransparencyLogEntry:
243243
244244
@private
245245
"""
246+
inclusion_promise: rekor_v1.InclusionPromise | None = None
247+
if self.inclusion_promise:
248+
inclusion_promise = rekor_v1.InclusionPromise(
249+
signed_entry_timestamp=base64.b64decode(self.inclusion_promise)
250+
)
251+
246252
inclusion_proof = rekor_v1.InclusionProof(
247253
log_index=self.inclusion_proof.log_index,
248254
root_hash=bytes.fromhex(self.inclusion_proof.root_hash),
@@ -255,14 +261,10 @@ def _to_rekor(self) -> rekor_v1.TransparencyLogEntry:
255261
log_index=self.log_index,
256262
log_id=common_v1.LogId(key_id=bytes.fromhex(self.log_id)),
257263
integrated_time=self.integrated_time,
264+
inclusion_promise=inclusion_promise, # type: ignore[arg-type]
258265
inclusion_proof=inclusion_proof,
259266
canonicalized_body=base64.b64decode(self.body),
260267
)
261-
if self.inclusion_promise:
262-
inclusion_promise = rekor_v1.InclusionPromise(
263-
signed_entry_timestamp=base64.b64decode(self.inclusion_promise)
264-
)
265-
tlog_entry.inclusion_promise = inclusion_promise
266268

267269
# Fill in the appropriate kind
268270
body_entry: ProposedEntry = TypeAdapter(ProposedEntry).validate_json(

0 commit comments

Comments
 (0)