Skip to content

Commit f1dd6a2

Browse files
committed
Fix auth loss when querying backend capabilities
QueryCapabilities was manually creating BackendTarget but omitted AuthStrategy and AuthMetadata fields, causing all backends to fall back to unauthenticated strategy during capability queries. Replace manual struct creation with BackendToTarget() helper to ensure all fields (including auth) are properly copied from Backend to BackendTarget. This bug prevented per-backend authentication from working during the initial capability discovery phase, even though auth was correctly configured by the discoverer.
1 parent dfa7ebe commit f1dd6a2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/vmcp/aggregator/default_aggregator.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,8 @@ func (a *defaultAggregator) QueryCapabilities(ctx context.Context, backend vmcp.
4949
logger.Debugf("Querying capabilities from backend %s", backend.ID)
5050

5151
// Create a BackendTarget from the Backend
52-
target := &vmcp.BackendTarget{
53-
WorkloadID: backend.ID,
54-
WorkloadName: backend.Name,
55-
BaseURL: backend.BaseURL,
56-
TransportType: backend.TransportType,
57-
HealthStatus: backend.HealthStatus,
58-
Metadata: backend.Metadata,
59-
}
52+
// Use BackendToTarget helper to ensure all fields (including auth) are copied
53+
target := vmcp.BackendToTarget(&backend)
6054

6155
// Query capabilities using the backend client
6256
capabilities, err := a.backendClient.ListCapabilities(ctx, target)

0 commit comments

Comments
 (0)