webhook tokens of tombstoned users rejected

This commit is contained in:
2026-10-26 03:17:00 +01:00
parent c9e74d9cc3
commit caab63596a
3 changed files with 66 additions and 3 deletions

View File

@@ -99,7 +99,11 @@ impl WebhookTokenRepository for InMemoryStore {
async fn find_by_token_hash(&self, hash: &str) -> Result<Option<WebhookToken>, DomainError> {
let store = self.webhook_tokens.read().unwrap();
Ok(store.iter().find(|t| t.token_hash() == hash).cloned())
let gone = self.tombstoned.read().unwrap();
Ok(store
.iter()
.find(|t| t.token_hash() == hash && !gone.contains(&t.user_id().value()))
.cloned())
}
async fn list_by_user(&self, user_id: &UserId) -> Result<Vec<WebhookToken>, DomainError> {