Skip to content

Commit

Permalink
pyproject: bump sigstore-rekor-types
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Cameron <[email protected]>
  • Loading branch information
tetsuo-cpp committed Dec 14, 2023
1 parent b32979b commit c24d8f7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ dependencies = [
"rich ~= 13.0",
"securesystemslib",
"sigstore-protobuf-specs ~= 0.2.2",
# NOTE(ww): Under active development, so strictly pinned.
"sigstore-rekor-types == 0.0.11",
"sigstore-rekor-types == 0.0.12",
"tuf >= 2.1,< 4.0",
]
requires-python = ">=3.8"
Expand Down
6 changes: 3 additions & 3 deletions sigstore/_internal/rekor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
from typing import Any, Dict, NewType, Optional
from urllib.parse import urljoin

import rekor_types
import requests
import sigstore_rekor_types

from sigstore._internal.ctfe import CTKeyring
from sigstore._internal.keyring import Keyring
Expand Down Expand Up @@ -137,7 +137,7 @@ def get(

def post(
self,
proposed_entry: sigstore_rekor_types.Hashedrekord,
proposed_entry: rekor_types.Hashedrekord,
) -> LogEntry:
"""
Submit a new entry for inclusion in the Rekor log.
Expand Down Expand Up @@ -170,7 +170,7 @@ class RekorEntriesRetrieve(_Endpoint):

def post(
self,
expected_entry: sigstore_rekor_types.Hashedrekord,
expected_entry: rekor_types.Hashedrekord,
) -> Optional[LogEntry]:
"""
Retrieves an extant Rekor entry, identified by its artifact signature,
Expand Down
16 changes: 8 additions & 8 deletions sigstore/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from typing import IO, Iterator, Optional

import cryptography.x509 as x509
import sigstore_rekor_types
import rekor_types
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
Expand Down Expand Up @@ -211,19 +211,19 @@ def sign(
)

# Create the transparency log entry
proposed_entry = sigstore_rekor_types.Hashedrekord(
proposed_entry = rekor_types.Hashedrekord(
kind="hashedrekord",
api_version="0.0.1",
spec=sigstore_rekor_types.HashedrekordV001Schema(
signature=sigstore_rekor_types.Signature1(
spec=rekor_types.hashedrekord.HashedrekordV001Schema(
signature=rekor_types.hashedrekord.Signature(
content=b64_artifact_signature,
public_key=sigstore_rekor_types.PublicKey1(
public_key=rekor_types.hashedrekord.PublicKey(
content=b64_cert.decode()
),
),
data=sigstore_rekor_types.Data(
hash=sigstore_rekor_types.Hash(
algorithm=sigstore_rekor_types.Algorithm.SHA256,
data=rekor_types.hashedrekord.Data(
hash=rekor_types.hashedrekord.Hash(
algorithm=rekor_types.hashedrekord.Algorithm.SHA256,
value=input_digest.hex(),
)
),
Expand Down
16 changes: 8 additions & 8 deletions sigstore/verify/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from textwrap import dedent
from typing import IO

import sigstore_rekor_types
import rekor_types
from cryptography.hazmat.primitives.serialization import Encoding
from cryptography.x509 import (
Certificate,
Expand Down Expand Up @@ -406,19 +406,19 @@ def rekor_entry(self, client: RekorClient) -> LogEntry:
# This "expected" entry is used both to retrieve the Rekor entry
# (if we don't have one) *and* to cross-check whatever response
# we receive. See below.
expected_entry = sigstore_rekor_types.Hashedrekord(
expected_entry = rekor_types.Hashedrekord(
kind="hashedrekord",
api_version="0.0.1",
spec=sigstore_rekor_types.HashedrekordV001Schema(
signature=sigstore_rekor_types.Signature1(
spec=rekor_types.hashedrekord.HashedrekordV001Schema(
signature=rekor_types.hashedrekord.Signature(
content=base64.b64encode(self.signature).decode(),
public_key=sigstore_rekor_types.PublicKey1(
public_key=rekor_types.hashedrekord.PublicKey(
content=base64_encode_pem_cert(self.certificate)
),
),
data=sigstore_rekor_types.Data(
hash=sigstore_rekor_types.Hash(
algorithm=sigstore_rekor_types.Algorithm.SHA256,
data=rekor_types.hashedrekord.Data(
hash=rekor_types.hashedrekord.Hash(
algorithm=rekor_types.hashedrekord.Algorithm.SHA256,
value=self.input_digest.hex(),
),
),
Expand Down

0 comments on commit c24d8f7

Please sign in to comment.