diff options
Diffstat (limited to 'atuin-server/src/handlers')
| -rw-r--r-- | atuin-server/src/handlers/history.rs | 5 | ||||
| -rw-r--r-- | atuin-server/src/handlers/user.rs | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/atuin-server/src/handlers/history.rs b/atuin-server/src/handlers/history.rs index 4fa2a962..b7112526 100644 --- a/atuin-server/src/handlers/history.rs +++ b/atuin-server/src/handlers/history.rs @@ -2,6 +2,7 @@ use axum::extract::Query; use axum::{extract::Path, Extension, Json}; use http::StatusCode; use std::collections::HashMap; +use tracing::{debug, error, instrument}; use crate::database::{Database, Postgres}; use crate::models::{NewHistory, User}; @@ -9,6 +10,7 @@ use atuin_common::api::*; use crate::calendar::{TimePeriod, TimePeriodInfo}; +#[instrument(skip_all, fields(user.id = user.id))] pub async fn count( user: User, db: Extension<Postgres>, @@ -27,6 +29,7 @@ pub async fn count( } } +#[instrument(skip_all, fields(user.id = user.id))] pub async fn list( req: Query<SyncHistoryRequest>, user: User, @@ -62,6 +65,7 @@ pub async fn list( Ok(Json(SyncHistoryResponse { history })) } +#[instrument(skip_all, fields(user.id = user.id))] pub async fn add( Json(req): Json<Vec<AddHistoryRequest>>, user: User, @@ -90,6 +94,7 @@ pub async fn add( Ok(()) } +#[instrument(skip_all, fields(user.id = user.id))] pub async fn calendar( Path(focus): Path<String>, Query(params): Query<HashMap<String, u64>>, diff --git a/atuin-server/src/handlers/user.rs b/atuin-server/src/handlers/user.rs index 42e4aa33..a9a48fdc 100644 --- a/atuin-server/src/handlers/user.rs +++ b/atuin-server/src/handlers/user.rs @@ -6,6 +6,7 @@ use axum::extract::Path; use axum::{Extension, Json}; use http::StatusCode; use sodiumoxide::crypto::pwhash::argon2id13; +use tracing::{debug, error, instrument}; use uuid::Uuid; use crate::database::{Database, Postgres}; @@ -26,6 +27,7 @@ pub fn verify_str(secret: &str, verify: &str) -> bool { } } +#[instrument(skip_all, fields(user.username = username.as_str()))] pub async fn get( Path(username): Path<String>, db: Extension<Postgres>, @@ -48,6 +50,7 @@ pub async fn get( })) } +#[instrument(skip_all)] pub async fn register( Json(register): Json<RegisterRequest>, settings: Extension<Settings>, @@ -95,6 +98,7 @@ pub async fn register( } } +#[instrument(skip_all, fields(user.username = login.username.as_str()))] pub async fn login( login: Json<LoginRequest>, db: Extension<Postgres>, |
