Skip to content

refactor(datasets): add comprehensive unit tests for dataset API hooks and fix api guards#36175

Merged
sadpandajoe merged 5 commits into
masterfrom
feat/dataset-unit-tests
Nov 21, 2025
Merged

refactor(datasets): add comprehensive unit tests for dataset API hooks and fix api guards#36175
sadpandajoe merged 5 commits into
masterfrom
feat/dataset-unit-tests

Conversation

@sadpandajoe
Copy link
Copy Markdown
Member

SUMMARY

This PR adds comprehensive unit test coverage for the dataset API hooks used in the filter configuration flow, plus fixes two critical bugs discovered during testing.

New Test Coverage (35 tests)

src/hooks/apiResources/datasets.test.ts (21 tests)

  • getDatasetId utility function - ID extraction from string/numeric formats
  • createVerboseMap utility function - verbose name mapping from columns/metrics
  • useDatasetDrillInfo hook - REST API path, caching behavior, error handling
  • Extension path coverage - drill-by extension integration, error handling, malformed payloads
  • Edge cases - NaN IDs, empty strings, malformed datasource IDs

src/features/datasets/hooks/useDatasetLists.test.ts (14 tests)

  • Pagination - single page, multi-page fetching
  • Error handling - API errors, network timeouts, persistent failures
  • Guard conditions - schema null/undefined, database undefined
  • Schema encoding - special characters in schema names

Bug Fixes

  1. Pagination infinite loop (useDatasetLists.ts:68)
    - Problem: Error handler in pagination loop didn't break, causing infinite retries on persistent API errors
    - Fix: Added break statement in catch block
    - Risk: CRITICAL - could cause browser hangs/crashes
  2. Missing database guard (useDatasetLists.ts:82)
    - Problem: API calls fired with database: undefined when db not selected
    - Fix: Added db?.id !== undefined check to guard condition
    - Risk: MEDIUM - API spam with malformed filters

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

sadpandajoe and others added 3 commits November 18, 2025 15:17
- Add ESLint disable comments for describe blocks (following ChartList pattern)
- Fix TypeScript mock typing using jest.mocked() helper
- Update supersetGetCache.delete mock to be properly typed
- Fix mockDb.owners type to be tuple [number]
- Add 'as any' casts for test fixtures to avoid strict type checking
- All 30 unit tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Improvements to existing unit tests for dataset hooks and API resources.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add break statement in pagination loop error handler to prevent
  infinite retries on persistent API errors
- Add db?.id guard to prevent API calls with undefined database ID
- Add 5 new tests covering extension fallback, db undefined, and
  pagination error scenarios
- Update existing error tests to expect single API call (not retry)

Test Results: 35/35 passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds comprehensive unit test coverage for dataset API hooks and fixes two critical bugs that could cause browser hangs and unnecessary API calls.

Key Changes:

  • Added 35 comprehensive unit tests across two test files (datasets.test.ts and useDatasetLists.test.ts)
  • Fixed pagination infinite loop bug by adding break statement in error handler
  • Fixed missing database guard to prevent API calls with undefined database ID

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
superset-frontend/src/hooks/apiResources/datasets.test.ts New test file with 21 tests covering getDatasetId, createVerboseMap, useDatasetDrillInfo hook, extension integration, and edge cases
superset-frontend/src/features/datasets/hooks/useDatasetLists.test.ts New test file with 14 tests covering pagination, error handling, guard conditions, and schema encoding
superset-frontend/src/features/datasets/hooks/useDatasetLists.ts Critical bug fixes: added break statement in pagination error handler (line 68) and database ID guard check (line 82)

Comment thread superset-frontend/src/hooks/apiResources/datasets.test.ts Outdated
Copy link
Copy Markdown
Contributor

@bito-code-review bito-code-review Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #7e8d58

Actionable Suggestions - 1
  • superset-frontend/src/features/datasets/hooks/useDatasetLists.test.ts - 1
    • Incorrect URL encoding expectation in test · Line 378-380
Review Details
  • Files reviewed - 3 · Commit Range: 7c68474..1699185
    • superset-frontend/src/features/datasets/hooks/useDatasetLists.test.ts
    • superset-frontend/src/features/datasets/hooks/useDatasetLists.ts
    • superset-frontend/src/hooks/apiResources/datasets.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines +378 to +380
// Verify the encoded schema is present in the URL (double-encoded by rison)
// Schema 'sales analytics' -> encodeURIComponent -> 'sales%20analytics' -> rison.encode_uri -> 'sales%2520analytics'
expect(callArg).toContain('sales%2520analytics');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect URL encoding expectation in test

The test expects double-encoded schema in the URL, but rison does not encode percent signs, leading to incorrect validation. Update to expect 'sales%20analytics' instead of 'sales%2520analytics' to match actual rison behavior. This affects the useDatasetsList hook's API endpoint construction, where schema encoding is critical for proper URL formation and API calls.

Code suggestion
Check the AI-generated fix before applying
Suggested change
// Verify the encoded schema is present in the URL (double-encoded by rison)
// Schema 'sales analytics' -> encodeURIComponent -> 'sales%20analytics' -> rison.encode_uri -> 'sales%2520analytics'
expect(callArg).toContain('sales%2520analytics');
// Verify the encoded schema is present in the URL (encoded by rison)
// Schema 'sales analytics' -> encodeURIComponent -> 'sales%20analytics' -> rison.encode_uri -> 'sales%20analytics'
expect(callArg).toContain('sales%20analytics');

Code Review Run #7e8d58


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

sadpandajoe and others added 2 commits November 18, 2025 16:55
Replace toBeNaN() with Number.isNaN() check since toBeNaN is not
a standard Jest matcher.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove all describe() nesting following Kent C. Dodds' "Avoid Nesting
When You're Testing" principles:

- Remove 3 describe blocks (useDatasetDrillInfo, getDatasetId malformed,
  extension path)
- Move beforeEach/afterEach to module level
- Create setupExtensionMock() helper for extension tests
- All 21 tests now flat with descriptive names

Test structure is cleaner and more maintainable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@sadpandajoe sadpandajoe merged commit 9d40c24 into master Nov 21, 2025
81 of 85 checks passed
@sadpandajoe sadpandajoe deleted the feat/dataset-unit-tests branch November 21, 2025 21:26
LuisSanchez pushed a commit to LuisSanchez/superset that referenced this pull request Nov 25, 2025
…s and fix api guards (apache#36175)

Co-authored-by: Claude <noreply@anthropic.com>
kshi020302 pushed a commit to jl141/superset that referenced this pull request Nov 30, 2025
…s and fix api guards (apache#36175)

Co-authored-by: Claude <noreply@anthropic.com>
Facyla pushed a commit to Facyla/superset-contrib that referenced this pull request Dec 16, 2025
…s and fix api guards (apache#36175)

Co-authored-by: Claude <noreply@anthropic.com>
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Feb 14, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Feb 17, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 2, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 3, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 4, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 5, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 5, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 9, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 9, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 9, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 9, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 9, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 10, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 12, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 13, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 13, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 13, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 13, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 13, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 13, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 13, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 16, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 17, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 17, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 17, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 18, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Mar 24, 2026
Add API key authentication support to Superset by delegating to
Flask-AppBuilder's SecurityManager. This ensures @Protect() works
automatically with API keys and benefits the broader FAB ecosystem.

Changes:
- Update MCP auth to use FAB's SecurityManager.validate_api_key()
- Add FAB_API_KEY_ENABLED and FAB_API_KEY_PREFIXES config options
- Add frontend UI for API key management (list, create, revoke)
- Add migration for ab_api_key table (FAB-managed)
- Pin FAB to feature branch with API key support

Key design decisions:
- API keys validated via prefix-based lookup + hash verification
- Key prefix configurable (default: ["sst_"]) for identification
- Keys inherit user's RBAC permissions via FAB's has_access()
- UUID-based external references for key management

Depends on: dpgaspar/Flask-AppBuilder#2431
Related: apache#36175
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
…s and fix api guards (apache#36175)

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants