Skip to content

Unify the api key used for api/notify with the new api keys #45386

Description

@dpsutton

We have a user-provided api key for api/notify, allowing people to programatically hit the endpoints

  • POST api/notify/db/:id
  • POST "/db/:id/new-table"

The endpoints let users sync databases when they like, and do not require a user session token to do so. This mechanism was built a long time ago and is seeded in the env with a key of the user's choosing.

This endpoint is secured by an API key that needs to be passed as a X-METABASE-APIKEY header which needs to be defined in the MB_API_KEY environment variable

We added api keys to enable precisely this kind of interaction so we could deprecate and remove this feature.

Ideally we allow new api keys to hit these endpoints in 51, and log a warning if an old api key hits this in 51. And then in 52 remove the old api key in totality.

NOTE: there is one feature that the old style api key allows that the new ones do not: knowing what an api key before instance creation or without any admin action in the UI. To obtain a new style api key, you must log in with an admin account and get the secret key. The old key could be decided on beforehand and set at startup (MB_API_KEY=kittens java -jar metabase.jar).

Metadata

Metadata

Assignees

No one assigned

    Labels

    .TaskNot a part of any Epic, used by the Task Issue Template.Team/AdminWebappDEPRECATED Please use .Team/UXWest insteadAdministration/AuthGoogle Auth, LDAP, pw+email loginMisc/APIType:New Feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions