Skip to content

Commit 466674e

Browse files
Merge branch 'main' into key-details
2 parents 4b1576c + aa695c4 commit 466674e

File tree

15 files changed

+183
-173
lines changed

15 files changed

+183
-173
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ All versions prior to 0.9.0 are untracked.
7878
Use `SigningContext.from_trust_config()` instead.
7979
[#1363](https://github.com/sigstore/sigstore-python/pull/1363)
8080

81+
## [3.6.4]
82+
83+
### Fixed
84+
85+
* Bumped the `rfc3161-client` dependency to `>=1.0.3` to fix a security
86+
vulnerability ([#1451](https://github.com/sigstore/sigstore-python/pull/1451))
87+
8188
## [3.6.3]
8289

8390
### Fixed
@@ -686,7 +693,8 @@ This is a corrective release for [2.1.1].
686693

687694

688695
<!--Release URLs -->
689-
[Unreleased]: https://github.com/sigstore/sigstore-python/compare/v3.6.3...HEAD
696+
[Unreleased]: https://github.com/sigstore/sigstore-python/compare/v3.6.4...HEAD
697+
[3.6.4]: https://github.com/sigstore/sigstore-python/compare/v3.6.3...v3.6.4
690698
[3.6.3]: https://github.com/sigstore/sigstore-python/compare/v3.6.2...v3.6.3
691699
[3.6.2]: https://github.com/sigstore/sigstore-python/compare/v3.6.1...v3.6.2
692700
[3.6.1]: https://github.com/sigstore/sigstore-python/compare/v3.6.0...v3.6.1

install/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sigstore==3.6.3
1+
sigstore==3.6.4

install/requirements.txt

Lines changed: 140 additions & 134 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies = [
3636
"requests",
3737
"rich >= 13,< 15",
3838
"rfc8785 ~= 0.1.2",
39-
"rfc3161-client >= 1.0.2,< 1.1.0",
39+
"rfc3161-client >= 1.0.3,< 1.1.0",
4040
# NOTE(ww): Both under active development, so strictly pinned.
4141
"sigstore-protobuf-specs == 0.4.3",
4242
"sigstore-rekor-types == 0.0.18",
@@ -62,7 +62,7 @@ lint = [
6262
"mypy ~= 1.1",
6363
# NOTE(ww): ruff is under active development, so we pin conservatively here
6464
# and let Dependabot periodically perform this update.
65-
"ruff < 0.11.14",
65+
"ruff < 0.12.1",
6666
"types-requests",
6767
"types-pyOpenSSL",
6868
]
@@ -124,7 +124,7 @@ exclude_dirs = ["./test"]
124124
[tool.ruff.lint]
125125
extend-select = ["I", "UP"]
126126
ignore = [
127-
"UP007", # https://github.com/pydantic/pydantic/issues/4146
127+
"UP007", # https://github.com/pydantic/pydantic/issues/4146
128128
"UP011",
129129
"UP015",
130130
]

sigstore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
* `sigstore.sign`: creation of Sigstore signatures
2626
"""
2727

28-
__version__ = "3.6.3"
28+
__version__ = "3.6.4"

sigstore/_cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import sys
2323
from dataclasses import dataclass
2424
from pathlib import Path
25-
from typing import Any, NoReturn, Optional, TextIO, Union
25+
from typing import Any, NoReturn, TextIO, Union
2626

2727
from cryptography.hazmat.primitives.serialization import Encoding
2828
from cryptography.x509 import load_pem_x509_certificate
@@ -76,9 +76,9 @@
7676

7777
@dataclass(frozen=True)
7878
class SigningOutputs:
79-
signature: Optional[Path] = None
80-
certificate: Optional[Path] = None
81-
bundle: Optional[Path] = None
79+
signature: Path | None = None
80+
certificate: Path | None = None
81+
bundle: Path | None = None
8282

8383

8484
@dataclass(frozen=True)
@@ -1178,7 +1178,7 @@ def _get_trust_config(args: argparse.Namespace) -> ClientTrustConfig:
11781178

11791179
def _get_identity(
11801180
args: argparse.Namespace, trust_config: ClientTrustConfig
1181-
) -> Optional[IdentityToken]:
1181+
) -> IdentityToken | None:
11821182
token = None
11831183
if not args.oidc_disable_ambient_providers:
11841184
token = detect_credential(args.oidc_client_id)

sigstore/_internal/oidc/oauth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import urllib.parse
2828
import uuid
2929
from types import TracebackType
30-
from typing import Any, Optional, cast
30+
from typing import Any, cast
3131

3232
from id import IdentityError
3333

@@ -224,7 +224,7 @@ class _OAuthRedirectServer(http.server.HTTPServer):
224224
def __init__(self, client_id: str, client_secret: str, issuer: Issuer) -> None:
225225
super().__init__(("localhost", 0), _OAuthRedirectHandler)
226226
self.oauth_session = _OAuthSession(client_id, client_secret, issuer)
227-
self.auth_response: Optional[dict[str, list[str]]] = None
227+
self.auth_response: dict[str, list[str]] | None = None
228228
self._is_out_of_band = False
229229

230230
@property

sigstore/_internal/rekor/client.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import logging
2424
from abc import ABC
2525
from dataclasses import dataclass
26-
from typing import Any, Optional
26+
from typing import Any
2727

2828
import rekor_types
2929
import requests
@@ -108,9 +108,7 @@ class RekorEntries(_Endpoint):
108108
Represents the individual log entry endpoints on a Rekor instance.
109109
"""
110110

111-
def get(
112-
self, *, uuid: Optional[str] = None, log_index: Optional[int] = None
113-
) -> LogEntry:
111+
def get(self, *, uuid: str | None = None, log_index: int | None = None) -> LogEntry:
114112
"""
115113
Retrieve a specific log entry, either by UUID or by log index.
116114
@@ -168,7 +166,7 @@ class RekorEntriesRetrieve(_Endpoint):
168166
def post(
169167
self,
170168
expected_entry: rekor_types.Hashedrekord | rekor_types.Dsse,
171-
) -> Optional[LogEntry]:
169+
) -> LogEntry | None:
172170
"""
173171
Retrieves an extant Rekor entry, identified by its artifact signature,
174172
artifact hash, and signing certificate.
@@ -192,7 +190,7 @@ def post(
192190
# We select the oldest entry for our actual return value,
193191
# since a malicious actor could conceivably spam the log with
194192
# newer duplicate entries.
195-
oldest_entry: Optional[LogEntry] = None
193+
oldest_entry: LogEntry | None = None
196194
for result in results:
197195
entry = LogEntry._from_response(result)
198196
if (

sigstore/_internal/trust.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from datetime import datetime, timezone
2626
from enum import Enum
2727
from pathlib import Path
28-
from typing import ClassVar, NewType, Optional
28+
from typing import ClassVar, NewType
2929

3030
import cryptography.hazmat.primitives.asymmetric.padding as padding
3131
from cryptography.exceptions import InvalidSignature
@@ -109,7 +109,7 @@ class Key:
109109
Represents a key in a `Keyring`.
110110
"""
111111

112-
hash_algorithm: Optional[hashes.HashAlgorithm]
112+
hash_algorithm: hashes.HashAlgorithm | None
113113
key: PublicKey
114114
key_id: KeyID
115115

@@ -136,7 +136,7 @@ def __init__(self, public_key: _PublicKey) -> None:
136136
if not public_key.raw_bytes:
137137
raise VerificationError("public key is empty")
138138

139-
hash_algorithm: Optional[hashes.HashAlgorithm]
139+
hash_algorithm: hashes.HashAlgorithm | None
140140
if public_key.key_details in self._RSA_SHA_256_DETAILS:
141141
hash_algorithm = hashes.SHA256()
142142
key = load_der_public_key(public_key.raw_bytes, types=(rsa.RSAPublicKey,))

sigstore/dsse/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Subject(BaseModel):
5454
A single in-toto statement subject.
5555
"""
5656

57-
name: Optional[StrictStr]
57+
name: Optional[StrictStr] # noqa: UP045
5858
digest: DigestSet = Field(...)
5959

6060

@@ -68,7 +68,7 @@ class _Statement(BaseModel):
6868
type_: Literal["https://in-toto.io/Statement/v1"] = Field(..., alias="_type")
6969
subjects: list[Subject] = Field(..., min_length=1, alias="subject")
7070
predicate_type: StrictStr = Field(..., alias="predicateType")
71-
predicate: Optional[dict[str, Any]] = Field(None, alias="predicate")
71+
predicate: Optional[dict[str, Any]] = Field(None, alias="predicate") # noqa: UP045
7272

7373

7474
class Statement:
@@ -134,9 +134,9 @@ class StatementBuilder:
134134

135135
def __init__(
136136
self,
137-
subjects: Optional[list[Subject]] = None,
138-
predicate_type: Optional[str] = None,
139-
predicate: Optional[dict[str, Any]] = None,
137+
subjects: list[Subject] | None = None,
138+
predicate_type: str | None = None,
139+
predicate: dict[str, Any] | None = None,
140140
):
141141
"""
142142
Create a new `StatementBuilder`.

0 commit comments

Comments
 (0)