Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions commons/tenant-manager/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (c *Client) cacheTenantConfig(ctx context.Context, cacheKey string, config
}

// GetTenantConfig fetches tenant configuration from the Tenant Manager API.
// The API endpoint is: GET {baseURL}/v1/tenants/{tenantID}/services/{service}/connections.
// The API endpoint is: GET {baseURL}/v1/tenants/{tenantID}/associations/{service}/connections.
// Successful responses are cached unless WithSkipCache is used.
func (c *Client) GetTenantConfig(ctx context.Context, tenantID, service string, opts ...GetConfigOption) (*core.TenantConfig, error) {
if c.httpClient == nil {
Expand Down Expand Up @@ -467,7 +467,7 @@ func (c *Client) GetTenantConfig(ctx context.Context, tenantID, service string,
}

// Build the URL with properly escaped path parameters to prevent path traversal
requestURL := fmt.Sprintf("%s/v1/tenants/%s/services/%s/connections",
requestURL := fmt.Sprintf("%s/v1/tenants/%s/associations/%s/connections",
c.baseURL, url.PathEscape(tenantID), url.PathEscape(service))

logger.Log(ctx, libLog.LevelInfo, "fetching tenant config",
Expand Down
2 changes: 1 addition & 1 deletion commons/tenant-manager/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestClient_GetTenantConfig(t *testing.T) {
config := newTestTenantConfig()

server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, "/v1/tenants/tenant-123/services/ledger/connections", r.URL.Path)
assert.Equal(t, "/v1/tenants/tenant-123/associations/ledger/connections", r.URL.Path)

w.Header().Set("Content-Type", "application/json")
require.NoError(t, json.NewEncoder(w).Encode(config))
Expand Down
Loading