This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git

commit 269971c39a9b7f092307d9f1684786a445e62763
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Mar 19 17:13:48 2026 +0000

    Handle extra type cases in Trusted Publishing payload validation
---
 atr/models/github.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/atr/models/github.py b/atr/models/github.py
index e5fe39fc..f35b86a1 100644
--- a/atr/models/github.py
+++ b/atr/models/github.py
@@ -58,7 +58,9 @@ class TrustedPublisherPayload(schema.Subset):
 
     @pydantic.field_validator("exp")
     @classmethod
-    def _validate_exp(cls, value: int) -> int:
+    def _validate_exp(cls, value: int | None) -> int | None:
+        if value is None:
+            return value
         now = int(time.time())
         if now > value:
             raise ValueError("Token has expired")
@@ -67,6 +69,8 @@ class TrustedPublisherPayload(schema.Subset):
     @pydantic.field_validator("nbf")
     @classmethod
     def _validate_nbf(cls, value: int | None) -> int | None:
+        if value is None:
+            return value
         now = int(time.time())
         if value and now < value:
             raise ValueError("Token not yet valid")


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to