Skip to content

feat(functions) update functions template to match new 'server' style#5063

Open
kallebysantos wants to merge 4 commits intosupabase:developfrom
kallebysantos:feat-update-functions-template-server-sdk
Open

feat(functions) update functions template to match new 'server' style#5063
kallebysantos wants to merge 4 commits intosupabase:developfrom
kallebysantos:feat-update-functions-template-server-sdk

Conversation

@kallebysantos
Copy link
Copy Markdown
Member

@kallebysantos kallebysantos commented Apr 10, 2026

What kind of change does this PR introduce?

Feature

What is the new behavior?

Apply withSupabase helper from @supabase/server

Additional context

A new optional flag --auth was introduced for the functions new command, chose between the auth access template:

  • always No credentials required - Open endpoints, wrappers that handle their own auth
  • apikey Valid publishable key or secret key - Use respectively for Client-facing, key-validated endpoints or Server-to-server, internal calls
  • user User JWT required - Authenticated user endpoints

Current default --auth always

--
Towards FUNC-563

- Creating different templates for 'functions new' command
- Handling '--auth' flag to specify which template use
@kallebysantos kallebysantos requested a review from a team as a code owner April 10, 2026 19:04
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24260789105

Coverage decreased (-0.02%) to 63.782%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: 7 uncovered changes across 2 files (19 of 26 lines covered, 73.08%).
  • 7 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
cmd/functions.go 6 1 16.67%
internal/functions/new/new.go 20 18 90.0%

Coverage Regressions

7 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
internal/utils/git.go 5 57.14%
internal/storage/rm/rm.go 2 80.61%

Coverage Stats

Coverage Status
Relevant Lines: 15368
Covered Lines: 9802
Line Coverage: 63.78%
Coverage Strength: 7.05 hits per line

💛 - Coveralls

@kallebysantos
Copy link
Copy Markdown
Member Author

WIP: Do not merge until @supabase/server be announced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants