Skip to content

Commit

Permalink
sigstore: RekorEntryMissing -> LogEntryMissing (#414)
Browse files Browse the repository at this point in the history
* sigstore: `RekorEntryMissing -> `LogEntryMissing`

Signed-off-by: William Woodruff <william@trailofbits.com>

* CHANGELOG: record changes

Signed-off-by: William Woodruff <william@trailofbits.com>

Signed-off-by: William Woodruff <william@trailofbits.com>
Signed-off-by: Jack Leightcap <jack.leightcap@trailofbits.com>
  • Loading branch information
woodruffw authored and jleightcap committed Jan 31, 2023
1 parent f73ee06 commit b07be9b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ All versions prior to 0.9.0 are untracked.
have been renamed to removed implementation detail references
([#402](https://github.com/sigstore/sigstore-python/pull/402))

* `sigstore.transparency.RekorEntryMissing` is now `LogEntryMissing`
([#414](https://github.com/sigstore/sigstore-python/pull/414))

## [0.10.0]

### Added
Expand Down
6 changes: 3 additions & 3 deletions sigstore/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from sigstore.transparency import LogEntry
from sigstore.verify import (
CertificateVerificationFailure,
RekorEntryMissing,
LogEntryMissing,
VerificationFailure,
VerificationMaterials,
Verifier,
Expand Down Expand Up @@ -852,7 +852,7 @@ def _verify_identity(args: argparse.Namespace) -> None:
),
file=sys.stderr,
)
elif isinstance(result, RekorEntryMissing):
elif isinstance(result, LogEntryMissing):
# If Rekor lookup failed, it's because the certificate either
# wasn't logged after creation or because the user requested the
# wrong Rekor instance (e.g., staging instead of production).
Expand Down Expand Up @@ -943,7 +943,7 @@ def _verify_github(args: argparse.Namespace) -> None:
),
file=sys.stderr,
)
elif isinstance(result, RekorEntryMissing):
elif isinstance(result, LogEntryMissing):
# If Rekor lookup failed, it's because the certificate either
# wasn't logged after creation or because the user requested the
# wrong Rekor instance (e.g., staging instead of production).
Expand Down
4 changes: 2 additions & 2 deletions sigstore/verify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
)
from sigstore.verify.verifier import (
CertificateVerificationFailure,
RekorEntryMissing,
LogEntryMissing,
Verifier,
)

__all__ = [
"CertificateVerificationFailure",
"RekorEntryMissing",
"LogEntryMissing",
"Verifier",
"VerificationResult",
"VerificationSuccess",
Expand Down
10 changes: 6 additions & 4 deletions sigstore/verify/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@
logger = logging.getLogger(__name__)


class RekorEntryMissing(VerificationFailure):
class LogEntryMissing(VerificationFailure):
"""
A specialization of `VerificationFailure` for Rekor lookup failures,
A specialization of `VerificationFailure` for transparency log lookup failures,
with additional lookup context.
"""

reason: str = "Rekor has no entry for the given verification materials"
reason: str = (
"The transparency log has no entry for the given verification materials"
)

signature: str
"""
Expand Down Expand Up @@ -232,7 +234,7 @@ def verify(
try:
entry = materials.rekor_entry(self._rekor)
except RekorEntryMissingError:
return RekorEntryMissing(
return LogEntryMissing(
signature=base64.b64encode(materials.signature).decode(),
artifact_hash=materials.input_digest.hex(),
)
Expand Down

0 comments on commit b07be9b

Please sign in to comment.