© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
gorbypark

Ensure edge function is invoked only with valid service-role key

I've got a function that's going to only be invoked by a database webhook and want to ensure that only the service-role key can invoke it. I've copied the service-role key into an Authorization header in the database webhook and everything is working fine on that front. My question is, is there a way to ensure an edge function can only be invoked by a service-role key? This seems like something that should happen at the Kong (API gateway) level and not in the edge function itself. I'm sure I can parse the token and check the role in javascript/the edge function, just wanted to make sure I'm not missing some setting somewhere to do it at the API gateway.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using service role in Edge Function
SupabaseSSupabase / help-and-questions
7mo ago
Cannot access new service role API key from Edge Function runtime
SupabaseSSupabase / help-and-questions
3mo ago
Edge Function cannot insert into table with RLS even using Service Role Key
SupabaseSSupabase / help-and-questions
5mo ago
Error when insert in table "profiles" with edge-function and SERVICE_ROLE_KEY
SupabaseSSupabase / help-and-questions
8mo ago