Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
Signed-off-by: laurentsimon <laurentsimon@google.com>
  • Loading branch information
laurentsimon committed Jan 8, 2024
1 parent 058717d commit 651392f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions model_signing/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
ExpiredCertificate,
)

import os
import io
from pathlib import Path
from typing import Optional
Expand Down Expand Up @@ -72,7 +71,7 @@ def __init__(self,
self.disable_ambient = disable_ambient
self.start_default_browser = start_default_browser
self.oidc_issuer = oidc_issuer
# NOTE: The client ID to use during OAuth2 flow.
# NOTE: The client ID to use during OAuth2 flow.
self.client_id = "sigstore"

def get_identity_token(self) -> Optional[IdentityToken]:
Expand All @@ -91,7 +90,8 @@ def get_identity_token(self) -> Optional[IdentityToken]:
else:
issuer = Issuer.production()

token = issuer.identity_token(client_id=client_id, force_oob=not self.start_default_browser)
token = issuer.identity_token(client_id=client_id,
force_oob=not self.start_default_browser)
return token

# NOTE: Only path in the top-level folder are considered for ignorepaths.
Expand All @@ -114,10 +114,10 @@ def sign(self, inputfn: Path, signaturefn: Path,
return SignatureResult()
except ExpiredIdentity:
return SignatureResult(success=False,
reason=f"exception caught: Signature failed: identity token has expired")
reason="exception caught: Signature failed: identity token has expired") # noqa: E501
except ExpiredCertificate:
return SignatureResult(success=False,
reason=f"exception caught: Signature failed: Fulcio signing certificate has expired")
reason="exception caught: Signature failed: Fulcio signing certificate has expired") # noqa: E501
except Exception as e:
return SignatureResult(success=False,
reason=f"exception caught: {str(e)}")
Expand Down

0 comments on commit 651392f

Please sign in to comment.