debug: add tracing to push auth for token expiration diagnosis

Author: Aaron Steven White
Commit 75f860c20db31d20739fd43df05d0eb9e0d840d7
Parent: 5225ce0b2d
Structural diff unavailable

These commits were pushed via plain git push, so no pre-parsed schemas are available. Install git-remote-cospan and re-push via panproto:// to see scope-level changes, breaking change detection, and semantic diffs.

brew install panproto/tap/git-remote-cospan
1 file changed +12 -2
@@ -85,7 +85,10 @@ pub fn verify_push(
8585 
8686     // Production mode: require credentials.
8787     let (username, token) = match extract_basic_auth(headers) {
88-        Some(pair) => pair,
88+        Some(pair) => {
89+            tracing::debug!(username = %pair.0, token_len = pair.1.len(), "extracted basic auth");
90+            pair
91+        }
8992         None => return PushAuth::NoCredentials,
9093     };
9194 
@@ -114,8 +117,15 @@ pub fn verify_push(
114117 
115118     // Check expiration.
116119     let now = chrono::Utc::now().timestamp();
120+    tracing::debug!(
121+        sub = %claims.sub,
122+        exp = claims.exp,
123+        now = now,
124+        diff = claims.exp - now,
125+        "push token expiration check"
126+    );
117127     if claims.exp < now {
118-        return PushAuth::Denied("push token expired".to_string());
128+        return PushAuth::Denied(format!("push token expired (exp={}, now={now}, diff={}s)", claims.exp, claims.exp - now));
119129     }
120130 
121131     // Check scope.
cospan · schematic version control on atproto built on AT Protocol