clippy: zero pedantic warnings across the tree
This commit is contained in:
parent
690cb5ab5b
commit
f9f1346eae
20 changed files with 71 additions and 61 deletions
|
|
@ -165,6 +165,7 @@ async fn ensure_user_exists(name: &str, admin: bool) -> Result<()> {
|
|||
/// monotonic clock so re-issuing doesn't collide with an existing
|
||||
/// token of the same name in the DB.
|
||||
async fn mint_and_persist_token(name: &str, path: &Path) -> Result<()> {
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
let token_name = format!(
|
||||
"{TOKEN_NAME_PREFIX}-{}",
|
||||
std::time::SystemTime::now()
|
||||
|
|
@ -190,7 +191,6 @@ async fn mint_and_persist_token(name: &str, path: &Path) -> Result<()> {
|
|||
}
|
||||
std::fs::write(path, format!("{token}\n"))
|
||||
.with_context(|| format!("write token to {}", path.display()))?;
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
let _ = std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o600));
|
||||
tracing::info!(%name, path = %path.display(), %token_name, "forge: persisted access token");
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue