fix: collapse ProxyStream auth failures into one indistinguishable response

This commit is contained in:
2026-07-29 12:52:53 +01:00
parent a000703199
commit ba2e263d00
+5 -1
View File
@@ -24,7 +24,11 @@ func (s *vantageServer) ProxyStream(stream pb.Vantage_ProxyStreamServer) error {
srv, err := services.ValidateAgentToken(msg.Open.ServerId, msg.Open.AgentToken)
if err != nil {
return status.Error(codes.Unauthenticated, "invalid agent token")
// Deliberately identical to the claim-failure response below: a bad
// token, an unknown proxy_id, and a proxy_id belonging to another
// instance/server must be indistinguishable to the caller.
log.Printf("proxy %s (server %s): invalid agent token", msg.Open.ProxyId, msg.Open.ServerId)
return status.Error(codes.PermissionDenied, "proxy session unavailable")
}
if err := serveProxy(proxy.Default, msg.Open, srv.InstanceID, stream); err != nil {