Skip to content

add service role and anon keys to config.toml, use these keys throughout whole environment #654

@ryanalta

Description

@ryanalta

Feature request

Is your feature request related to a problem? Please describe.

It is related to another feature request, but not a problem. Was asked in #451 to create a new issue, so I am doing so.

Describe the solution you'd like

It would be great to be able to specify your own service role, anon keys, and JWT keys in the config.toml file. I see that the keys that are displayed via supabase status are hardcoded and periodically change. I don't see where these keys are coming from, so they're possibly built in to the docker images that the cli tool sets up?

AnonKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs"
ServiceRoleKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSJ9.vI9obAHOGyVVKa3pD--kJlyxp-Z2zV9UUMAhKpNLAcU"

It would be great to have something like the following toml structure, perhaps with some randomly generated defaults provided on supabase init.

[auth]
anon_key = 'sldfkjsldkjfsldkjfdlskjlkjldkfj'
service_role_key = 'lsdkfjlsksjfdlksjfldskjslfkdj'

Describe alternatives you've considered

Without knowing where these keys come from, some alternatives might be:

  • passing environment variables to supabase init or supabase start that sets up the environment with anon and service role keys
  • exposing a docker-config.yml that describes the structure created by supabase init (but I see eject was removed, so guessing this is off the table)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions