You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by wa...@apache.org on 2026/01/21 21:48:40 UTC
(tooling-trusted-releases) 01/01: Notify users on authentication credentials change
This is an automated email from the ASF dual-hosted git repository.
wave pushed a commit to branch notify-users-on-pat
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
commit 3d9fb43e35c5af342745d22ce41b8bb43ab66300
Author: Dave Fisher <da...@comcast.net>
AuthorDate: Wed Jan 21 13:48:28 2026 -0800
Notify users on authentication credentials change
---
atr/storage/writers/tokens.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/atr/storage/writers/tokens.py b/atr/storage/writers/tokens.py
index fe57158..2760582 100644
--- a/atr/storage/writers/tokens.py
+++ b/atr/storage/writers/tokens.py
@@ -25,6 +25,7 @@ import sqlmodel
import atr.db as db
import atr.jwtoken as jwtoken
+import atr.mail as mail
import atr.models.sql as sql
import atr.storage as storage
@@ -65,6 +66,15 @@ class FoundationCommitter(GeneralPublic):
)
self.__data.add(pat)
await self.__data.commit()
+ await mail.send(
+ mail.Message(
+ email_sender="noreply@apache.org",
+ email_recipient=f"{uid}@apache.org",
+ subject="New API Token Created",
+ body=f"A new API token '{label or 'unlabeled'}' was created for your account. "
+ "If you did not create this token, please revoke it immediately.",
+ )
+ )
return pat
async def delete_token(self, token_id: int) -> None:
@@ -81,6 +91,15 @@ class FoundationCommitter(GeneralPublic):
asf_uid=self.__asf_uid,
token_id=token_id,
)
+ await mail.send(
+ mail.Message(
+ email_sender="noreply@apache.org",
+ email_recipient=f"{self.__asf_uid}@apache.org",
+ subject="Deleted API Token",
+ body="An API token was deleted from your account. "
+ "If you did not delete any tokens, please checkl your account immediately.",
+ )
+ )
async def issue_jwt(self, pat_text: str) -> str:
pat_hash = hashlib.sha3_256(pat_text.encode()).hexdigest()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org