Skip to main content

rotate_secret

Function rotate_secret 

Source
pub async fn rotate_secret(
    pool: &PgPool,
    actor: &Actor,
    id: Uuid,
) -> AppResult<(Webhook, String)>
Expand description

Replaces the secret. Returns the webhook and the new secret (shown once). Deliveries that are still pending are signed with the new secret.

§Invariants

  • Permission: administrator (403); unknown webhook is “not found”.
  • Locks: the webhook row (FOR UPDATE).
  • Data: the new secret is returned once; the audit record holds only its hint.
  • Audit: webhook.rotate_secret.
  • Notifications / webhooks: none.
  • Atomic: one transaction.