style(cloud): reformat modules and restore except-tuple parentheses
Tests / Test failed: 4, passed: 744

Apply consistent line-length formatting across governance, plugins, the
SDK routers (governance_api, user_api), user_auth, and migrations
0003/0005/0006.

Also restore the parentheses on two except clauses that had been dropped
into invalid Python 3 `except A, B:` syntax: plugins._coerce_to_manifest
(KeyError, ValueError) and PasswordHasher.verify (InvalidHashError,
VerificationError). Both modules now import cleanly again.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 13:30:13 +08:00
co-authored by Claude Opus 4.6
parent c0a653fa3f
commit 9afbdc91fa
8 changed files with 117 additions and 38 deletions
+8 -2
View File
@@ -201,7 +201,9 @@ def utc_now() -> datetime:
return datetime.now(UTC)
def csrf_matches(*, csrf_cookie: str | None, csrf_header: str | None, session: UserSession) -> bool:
def csrf_matches(
*, csrf_cookie: str | None, csrf_header: str | None, session: UserSession
) -> bool:
if not csrf_cookie or not csrf_header:
return False
if not compare_digest(csrf_cookie, csrf_header):
@@ -271,7 +273,11 @@ class UserAuthService:
normalized,
client_bucket,
)
if throttle is not None and throttle.blocked_until and throttle.blocked_until > now:
if (
throttle is not None
and throttle.blocked_until
and throttle.blocked_until > now
):
self.password_hasher.verify_dummy(password)
self._audit(
action="login",