Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions sigstore/_internal/oidc/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __exit__(


class _OAuthRedirectHandler(http.server.BaseHTTPRequestHandler):
def log_message(self, _format: str, *_args: Any) -> None:
def log_message(self, format: str, *_args: Any) -> None:
Copy link
Member Author

@woodruffw woodruffw Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: fixed this as a very minor but technically invalid Liskov Substitution.

pass

def do_GET(self) -> None:
Expand Down Expand Up @@ -177,7 +177,6 @@ def __init__(self, client_id: str, client_secret: str, issuer: Issuer):
self._client_secret = client_secret
self._issuer = issuer
self._state = str(uuid.uuid4())
self._nonce = str(uuid.uuid4())

self.code_verifier = B64Str(
base64.urlsafe_b64encode(os.urandom(32)).rstrip(b"=").decode()
Expand All @@ -197,7 +196,7 @@ def auth_endpoint(self, redirect_uri: str) -> str:
# Defensive programming: we don't have a nice way to limit the
# lifetime of the OAuth session here, so we use the internal
# "poison" flag to check if we're attempting to reuse it in a way
# that would compromise the flow's security (i.e. nonce reuse).
# that would compromise the flow's security (i.e. state reuse).
if self.__poison:
raise IdentityError("internal error: OAuth endpoint misuse")
else:
Expand All @@ -216,7 +215,6 @@ def _auth_params(self, redirect_uri: str) -> dict[str, Any]:
"code_challenge": self.code_challenge,
"code_challenge_method": "S256",
"state": self._state,
"nonce": self._nonce,
}


Expand Down
2 changes: 1 addition & 1 deletion sigstore/_internal/sct.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def verify_sct(
f"SCT verify: Invalid issuer pubkey basicConstraint (not a CA): {issuer_pubkey}"
)

if not isinstance(issuer_pubkey, (rsa.RSAPublicKey, ec.EllipticCurvePublicKey)):
if not isinstance(issuer_pubkey, rsa.RSAPublicKey | ec.EllipticCurvePublicKey):
raise VerificationError(
f"SCT verify: invalid issuer pubkey format (not ECDSA or RSA): {issuer_pubkey}"
)
Expand Down
2 changes: 1 addition & 1 deletion sigstore/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _from_v1_response(cls, dict_: dict[str, Any]) -> TransparencyLogEntry:
body_entry: ProposedEntry = TypeAdapter(ProposedEntry).validate_json(
base64.b64decode(entry["body"])
)
if not isinstance(body_entry, (Hashedrekord, Dsse)):
if not isinstance(body_entry, Hashedrekord | Dsse):
raise InvalidBundle("log entry is not of expected type")

raw_inclusion_proof = entry["verification"]["inclusionProof"]
Expand Down
Loading