From 52274ba67d3b1cfef2dd6a5c08e67e68f1a6fc13 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 8 Oct 2025 21:05:37 -0400 Subject: Stop passing an unused timestamp around when rotating VAPID keys. --- src/cli.rs | 3 +-- src/vapid/app.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cli.rs b/src/cli.rs index 263a4fd..8d73109 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -10,7 +10,6 @@ use axum::{ middleware, response::{IntoResponse, Response}, }; -use chrono::Utc; use clap::{CommandFactory, Parser, Subcommand}; use sqlx::sqlite::SqlitePool; use tokio::net; @@ -102,7 +101,7 @@ impl Args { match self.command { None => self.serve(app).await?, - Some(Command::RotateVapidKey) => app.vapid().rotate_key(&Utc::now()).await?, + Some(Command::RotateVapidKey) => app.vapid().rotate_key().await?, } Result::<_, Error>::Ok(()) diff --git a/src/vapid/app.rs b/src/vapid/app.rs index ddb1f4d..5814ba0 100644 --- a/src/vapid/app.rs +++ b/src/vapid/app.rs @@ -1,4 +1,4 @@ -use chrono::{TimeDelta, Utc}; +use chrono::TimeDelta; use sqlx::SqlitePool; use super::{History, repo, repo::Provider as _}; @@ -18,7 +18,7 @@ impl<'a> Vapid<'a> { Self { db, events } } - pub async fn rotate_key(&self, rotate_at: &DateTime) -> Result<(), sqlx::Error> { + pub async fn rotate_key(&self) -> Result<(), sqlx::Error> { let mut tx = self.db.begin().await?; // This is called from a separate CLI utility (see `cli.rs`), and we _can't_ deliver events // to active clients from another process, so don't do anything that would require us to -- cgit v1.2.3