pub struct AuthMailQueue { /* private fields */ }Expand description
Queues the letters a panel’s auth sends, for a Worker with
auth_mail to send.
let queue = AuthMailQueue::new(key);
let mail = AuthMail::new(from, "https://app.example.com").delivery(queue.clone());
let worker = Worker::new(panel)?.auth_mail(&queue);- A letter commits with its token or not at all, and the worker retries it like any job: an outage of the mail server delays it instead of losing it.
- A letter carries a live link or code, so the queue stores it sealed: AES-256-GCM under a key
derived from the router’s cookie [
Key]. A reader of the database or its backups without that key reads no link. - The web process and the worker build the queue from the same key. A key rotated while mail waits leaves that mail unopenable: it dies after its attempts, and the person asks again.
- A letter past its
expires_atis dropped, not sent: a link that arrives dead reads as broken. Six attempts span about a quarter of an hour of backoff.
Implementations§
Source§impl AuthMailQueue
impl AuthMailQueue
Trait Implementations§
Source§impl AuthMailDelivery for AuthMailQueue
impl AuthMailDelivery for AuthMailQueue
Source§async fn deliver(
&self,
_cx: &Cx,
ex: &mut dyn Executor,
letter: AuthLetter,
) -> Result<()>
async fn deliver( &self, _cx: &Cx, ex: &mut dyn Executor, letter: AuthLetter, ) -> Result<()>
Takes
letter for sending, writing through ex.Auto Trait Implementations§
impl Freeze for AuthMailQueue
impl RefUnwindSafe for AuthMailQueue
impl Send for AuthMailQueue
impl Sync for AuthMailQueue
impl Unpin for AuthMailQueue
impl UnsafeUnpin for AuthMailQueue
impl UnwindSafe for AuthMailQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more