aboutsummaryrefslogtreecommitdiff
path: root/jb/models/auth.py
diff options
context:
space:
mode:
authorstuppie2026-09-01 14:17:10 -0600
committerstuppie2026-09-01 14:17:10 -0600
commit81261e52931d055df5830e29b9bf5ef81ba9134e (patch)
tree9ce5817cdb0953080f78950ea42c869683ed5643 /jb/models/auth.py
parentf5a1882de073ea6859c226395daefeb566e9e802 (diff)
downloadamt-jb-81261e52931d055df5830e29b9bf5ef81ba9134e.tar.gz
amt-jb-81261e52931d055df5830e29b9bf5ef81ba9134e.zip
add a magic token flow specifically for amt account link. gr api manager add more logging and error handling
Diffstat (limited to 'jb/models/auth.py')
-rw-r--r--jb/models/auth.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/jb/models/auth.py b/jb/models/auth.py
index 8b48088..d0e8386 100644
--- a/jb/models/auth.py
+++ b/jb/models/auth.py
@@ -68,7 +68,9 @@ class User(BaseModel):
if not isinstance(provided_id, str) or not hmac.compare_digest(
provided_id, expected_id
):
- raise ValueError(f"product_user_id {provided_id} does not match email {email}")
+ raise ValueError(
+ f"product_user_id {provided_id} does not match email {email}"
+ )
# The computed field is authoritative; do not retain the input value.
validated_data = dict(data)
@@ -92,6 +94,13 @@ class MagicLinkExchangeRequest(BaseModel):
token: str = Field(min_length=1)
+class AmtAccountLink(BaseModel):
+ model_config = ConfigDict(extra="forbid")
+
+ email: EmailStr
+ amt_worker_id: str = Field(min_length=3, max_length=50)
+
+
class SessionResponse(BaseModel):
session_token: str
token_type: str = "bearer"