Skip to content

API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing #33353

Open
@irodriguez-nebustream

Description

@irodriguez-nebustream

Bug description

When Superset is configured with SUPERSET_APP_ROOT set to a non-root path (e.g., "/prefix"), the embedded dashboard's API call to /api/v1/me/roles/ fails with a 404 error because the endpoint doesn't account for the application root path.
Reproduction steps:

Configure Superset with SUPERSET_APP_ROOT="/prefix" in the config
Embed a dashboard using the embedDashboard() SDK function
Monitor the network requests

Expected behavior:
The API call should go to /prefix/api/v1/me/roles/ (with the app root prefix) to match the subpath routing configuration.
Actual behavior:
The API call goes to /api/v1/me/roles/ (without the prefix), resulting in a 404 error because the route doesn't exist at the root level.
Root cause:

In superset-frontend/src/embedded/index.tsx, the start() function has a hardcoded endpoint path that doesn't consider the application root:
typescriptconst getMeWithRole = makeApi<void, { result: UserWithPermissionsAndRoles }>({
  method: 'GET',
  endpoint: '/api/v1/me/roles/',  // Hardcoded path, no app root
});

Screenshots/recordings

Console error showing 404 for /api/v1/me/roles/ when Superset is configured with SUPERSET_APP_ROOT="/prefix"

Image

Superset version

master / latest-dev

Python version

3.10

Node version

I don't know

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to the REST API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions