Conversation
DefaultSampleDataService now matches its target through core.api.AllowedTables, so a bare allowed_tables entry no longer admits a schema-qualified preview the query gate rejects; a bare entry covers a qualified target only when the name is unique in the view (#936 rule). DefaultQueryDryRunService drops its duplicate normalizer too. Refs #1089
babltiga
merged commit Sep 24, 2026
ca6f0de
into
fix/AF-936-scope-schema-introspection
1 check passed
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.
Closes #1089
What
DefaultSampleDataService.targetAllowedlet a bareallowed_tablesentry ([orders]) admit a schema-qualified preview (?schema=archive&table=orders) that the query gate refuses (SELECT * FROM archive.orders→AllowedTables.coveringEntryfinds no entry).core.api.AllowedTables(normalize/normalizeEntry/coveringEntry), the gate's matcher. The privatenormalizeList/normalizecopies are gone.SchemaViewPermissionFilterrule). The count runs over the unfiltered catalog (introspectSchemaForSystem, fetched lazily only on this fallback), because the caller's filtered view may already hide the twin:["orders", "cat.archive.orders"]showsarchive.ordersthrough the suffix rule and hidespublic.orders. A target with no schema name is covered by a bare entry only.DefaultQueryDryRunService: its duplicatenormalizeListand inline matcher are replaced byAllowedTables, with no behaviour change.Tests
DefaultSampleDataServiceTest: 9 new cases:DefaultQueryDryRunServiceTest: 2 new admission-path cases (a schema or qualified entry covers the table; a restricted allow-list with no referenced tables passes).ApplicationModulesTest,ApiPackageDependencyTest, spotless and checkstyle all pass. A fullmvn verifywas not run locally.Docs
docs/05-backend.md: step 1 of "Sample data path (AF-443)" (bare-entry rule, the one documented looser case, the catalog-suffix gap) and step 1 of the dry-run section (matcher reference).website/docs/configuration/datasources/index.html(from core: scope schema introspection to the caller's allow-list #936) already says a bare name shared across schemas shows neither table, which is now also what the preview does.Review notes
ordersonly inarchiveandarchiveoff the search path, the preview readsarchive.orderswhile an unqualifiedSELECT * FROM ordersfails to resolve. This rule was chosen on purpose, to match the core: scope schema introspection to the caller's allow-list #936 view: the tree already shows that table. The javadoc and docs now state the divergence plainly instead of saying "never". Making it strict would give 404 on tables the tree lists.mydb.dbo.orders→ showsdbo.orders) is not honoured by the preview, so such a table is listed but its preview returns 404. The old code behaved the same way.qualifiedNamefalls back to""when a table name is made only of quote characters. The restricted path already refuses it (bare == null); the old behaviour was the same.No UI change, so no screenshots.