Make table-config an admin-only REST endpoint - #302
Merged
Merged
Conversation
Move GET /api/table-config out of the public client router into the admin router as GET /api/admin/table-config, so a table's storage format and configuration (which can include external SQL-database connection details) is only readable with admin basic-auth. - Add beacon-api/src/axum/admin/tables.rs with the list_table_config handler (admin tag, basic-auth, 404 on missing table) and register it. - Remove the handler and route from the client surface; tidy tag descriptions. - Keep credential redaction in TableConfigView as defense-in-depth; reword its now-inaccurate "public endpoint" comments. - Update the integration test to call the admin path with auth and assert an unauthenticated call is rejected with 401. - Update the VitePress REST API docs: move table-config under admin, document the full admin surface with example requests, and flag deprecated aliases.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR secures table configuration inspection by removing GET /api/table-config from the unauthenticated client surface and reintroducing it as an authenticated admin endpoint at GET /api/admin/table-config behind the existing HTTP Basic auth middleware, reducing the risk of leaking sensitive external-table configuration details.
Changes:
- Moved the table-config handler from the client router to a new admin router handler (
/api/admin/table-config) protected bybasic_auth. - Updated integration tests to assert unauthenticated access is rejected (
401) and that SQL credentials remain redacted. - Updated VitePress docs to reference the new admin-only endpoint and added/expanded runnable admin endpoint examples.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| integration-tests/test_sql_databases.py | Updates redaction test to call the new admin endpoint and assert 401 without auth. |
| docs/docs/1.7.3/data-lake/sql-databases.md | Updates endpoint references to /api/admin/table-config and clarifies admin auth requirement. |
| docs/docs/1.7.3/api/exploring-data-lake.md | Updates table-config docs to admin-only, adds deprecated alias note, and expands runnable admin examples. |
| beacon-core/src/api.rs | Rewords comments/tests to reflect the endpoint is now admin-only while keeping redaction behavior unchanged. |
| beacon-api/src/axum/client/tables.rs | Removes the public list_table_config handler and associated query params type. |
| beacon-api/src/axum/client/mod.rs | Removes the table-config route and trims the tables tag description accordingly. |
| beacon-api/src/axum/admin/tables.rs | Adds the new admin list_table_config handler for /api/admin/table-config. |
| beacon-api/src/axum/admin/mod.rs | Registers the new admin tables module/route and updates the admin OpenAPI tag description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
GET /api/table-configreturns a table's storage format, location, and options — which for external SQL-database tables can include connection details. It previously lived in the public client router with no authentication. This PR moves it into the admin router (gated by the existingbasic_authmiddleware) atGET /api/admin/table-config, so table configuration is admin-only.Changes
API
beacon-api/src/axum/admin/tables.rs—list_table_confighandler taggedadmin,security(("basic-auth" = [])), returns404on a missing table. Registered in the admin router.ListTableConfigQuery+ route from the client surface (client/tables.rs,client/mod.rs); trimmed thetables/adminOpenAPI tag descriptions.TableConfigView::try_from(beacon-core/src/api.rs) is unchanged as defense-in-depth; reworded its now-inaccurate "public endpoint" comments.Tests
integration-tests/test_sql_databases.py: the redaction test now calls/api/admin/table-configwith admin auth, and additionally asserts an unauthenticated call returns401.Docs (VitePress,
docs/docs/1.7.3/)data-lake/sql-databases.md+api/exploring-data-lake.md: updated all references to the admin path/auth.check/crawlersendpoints so every endpoint has a runnable example, and flagged the deprecated/api/datasetsand/api/query/available-columnsaliases.Out of scope
clients/beacon-cli/.../client.py) still targets the old/api/table-configpath and will404until updated separately.Verification
cargo build -p beacon-api✅cargo test -p beacon-api✅ (10 passed)cargo test -p beacon-core table_config_redaction✅