Repository navigation
[CU-86bcf3q9q] Look up a table's data model in the request's tenant - #180
Merged
Merged
Conversation
A tenant's table info looked up the stored data model in collection-service
as the management tenant. Requests from a non-management tenant now call
/tenants/{tenantId}/collection/... with a token for that tenant. Requests
from the management tenant keep the old path and token.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A failed token request for a tenant threw out of the data model lookup and returned an error to the caller. It now falls back to Trino, like a failed call to collection-service does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
angelo-DNAStack
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
data-connect-trino now looks up a table's stored data model in the tenant of the request.
GET /tenants/{tenantId}/collection/{schema}/item/{table}on collection-service. It uses a token for that tenant (TokenTenantPolicy.tenantFromRequestPath())./tenants/{tenantId}/...yet (see collection-service PR #583).DataModelSupplier.supplynow takes theTenantIdas its first parameter.TrinoDataConnectAdapterpasses the tenant of the request. The indexing-service and tables-registry suppliers ignore it, as before.Why
Before this change, every lookup ran as the management tenant. A tenant could receive a data model that is stored in the management tenant.
What this does not change
In production, collection-service refuses this lookup today. It answers
403 insufficient_scope, because the endpoint requires thecollection:readpermission and data-connect-trino only holdscollection_item:read. So every caller already gets the Trino fallback. This PR does not add the permission. The lookup was found in the production logs only 6 times since 1 January 2026. Callers will see no difference after this PR. The routing is now correct if the permission is added later.How it was tested
CollectionServiceDataModelSupplierTest: a tenant uses the tenant path, management uses the old path, other catalogs are skipped, and a failed token request falls back.catchmakes the token test fail.TenancyArchitectureTest.🤖 Generated with Claude Code