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:
@@ -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