mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-19 12:34:29 +02:00
fix: add debug logging for JWT validation failures (#7788) When JWT file ID validation fails during replication, add a log message showing both the expected and actual file IDs to help diagnose issues. Ref #7788
This commit is contained in:
1 parent
02f7d3f3e2
commit
9c4a2e1b1a
1 file changed
+6
-1
@@ -363,7 +363,12 @@ func (vs *VolumeServer) maybeCheckJwtAuthorization(r *http.Request, vid, fid str
|
||||
if sepIndex := strings.LastIndex(fid, "_"); sepIndex > 0 {
|
||||
fid = fid[:sepIndex]
|
||||
}
|
||||
return sc.Fid == vid+","+fid
|
||||
expectedFid := vid + "," + fid
|
||||
if sc.Fid != expectedFid {
|
||||
glog.V(1).Infof("jwt fid mismatch from %s: token has %q, request has %q", r.RemoteAddr, sc.Fid, expectedFid)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
glog.V(1).Infof("unexpected jwt from %s: %v", r.RemoteAddr, tokenStr)
|
||||
return false
|
||||
|
||||
Reference in new issue
Block a user