Repository navigation
docs: improvements on securing Edge Functions guide - #41727
kallebysantos merged 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
@kallebysantos is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughReplaces the "Verifying JWT" section in the Edge Functions auth guide with an "Integrating with Supabase Auth" section that references external CodeSample templates; updates example edge-function JWT modules to import jose via Changes
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
supa-mdx-lint resultsapps/docs/content/guides/functions/auth.mdxError[Rule005AdmonitionNewlines] Admonition must have empty lines between tags and content Recommendations
Summary
|
There was a problem hiding this comment.
Actionable comments posted: 2
Fix all issues with AI Agents 🤖
In @apps/docs/content/guides/functions/auth.mdx:
- Line 93: Update the incorrect meta attribute value: replace
meta="name=hello/index.ts" with meta="name=custom-jwt-validation/index.ts" so
the meta matches the referenced file path (look for the meta attribute in the
frontmatter block containing the example name).
- Around line 85-95: The second CodeSample component has a mismatched meta
attribute: change meta="name=hello/index.ts" to
meta="name=custom-jwt-validation/index.ts" so the meta matches the provided path
"/edge-functions/supabase/functions/custom-jwt-validation/index.ts" (update the
meta on the CodeSample component that references
custom-jwt-validation/index.ts).
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
1-1: Fix Prettier formatting to unblock CI.The Prettier formatting check failed. Run
prettier --writeon this file to fix the formatting issues.#!/bin/bash # Run Prettier to fix formatting prettier --write apps/docs/content/guides/functions/auth.mdx
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/docs/content/guides/functions/auth.mdx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
📚 Learning: 2026-01-05T12:21:37.661Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
🪛 GitHub Actions: Check Code with Prettier
apps/docs/content/guides/functions/auth.mdx
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in the file.
🪛 LanguageTool
apps/docs/content/guides/functions/auth.mdx
[style] ~77-~77: Consider using a more concise synonym.
Context: ...se/functions/custom-jwt-validation) and a variety of [auth function templates](https://githu...
(A_VARIETY_OF)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: typecheck
🔇 Additional comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
33-71: LGTM!The restructured "Integrating with Supabase Auth" section clearly demonstrates how to use the Supabase client to verify JWTs via
getClaims(). The example is concise and follows best practices.
There was a problem hiding this comment.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @apps/docs/content/guides/functions/auth.mdx:
- Line 83: Update the referenced jose version in the docs text and link from
v/4.10.0 to a patched release (preferably v/6.1.3; if staying within v4, use at
least v/4.15.9) so the example points to a version that fixes CVE-2024-28176 and
CVE-2024-28180; modify the package/version in the example import/link and any
accompanying install command or URL that currently mentions v/4.10.0 to the
chosen safe version.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
1-97: Fix Prettier formatting to pass CI checks.The pipeline indicates this file has formatting issues that need to be resolved.
Run the following command to fix the formatting:
prettier --write apps/docs/content/guides/functions/auth.mdx
🧹 Nitpick comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
77-77: Consider more concise wording.The phrase "a variety of" could be shortened to "various" for a more concise style.
🔎 Proposed fix
-You can see [a custom JWT verification example on GitHub](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/custom-jwt-validation) and a variety of [auth function templates](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/_shared/jwt) also on GitHub. +You can see [a custom JWT verification example on GitHub](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/custom-jwt-validation) and various [auth function templates](https://github.com/supabase/supabase/tree/master/examples/edge-functions/supabase/functions/_shared/jwt) also on GitHub.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/docs/content/guides/functions/auth.mdx
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: In Supabase Edge Functions documentation, the `meta="name=..."` attribute in CodeSample components may intentionally use generic example names (like "hello/index.ts") rather than matching the actual file path being referenced, to help users understand how to adapt templates to their own use cases.
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
📚 Learning: 2026-01-05T23:42:52.357Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: When reviewing MDX documentation that uses CodeSample components in Supabase docs, it's acceptable for CodeSample meta attributes to display generic example file names (e.g., hello/index.ts) to illustrate templating. Do not flag these as file-path mismatches unless the docs claim an exact reference to a real file. If you encounter such code samples, ensure the surrounding text clarifies that the names are placeholders to be adapted by users, and suggest adding a note explaining how to map the template to a real project path.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2025-12-11T02:39:45.951Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/docs-graphql.mdc:0-0
Timestamp: 2025-12-11T02:39:45.951Z
Learning: Applies to apps/docs/app/api/graphql/tests/**/*.test.ts : Test files for GraphQL queries should be located at `apps/docs/app/api/graphql/tests/{queryName}.test.ts` and include tests for: (1) requesting all fields including nested fields with assertion for no errors and proper field returns, and (2) error triggering with assertion for proper GraphQL error response
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2026-01-05T12:21:37.661Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
🪛 GitHub Actions: Check Code with Prettier
apps/docs/content/guides/functions/auth.mdx
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in this file.
🪛 LanguageTool
apps/docs/content/guides/functions/auth.mdx
[style] ~77-~77: Consider using a more concise synonym.
Context: ...se/functions/custom-jwt-validation) and a variety of [auth function templates](https://githu...
(A_VARIETY_OF)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: typecheck
🔇 Additional comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
33-35: LGTM!The section reorganization improves clarity by explicitly mentioning Supabase Auth integration in the header.
| ) | ||
| } | ||
| } | ||
| The following example uses [`jose`](https://www.npmjs.com/package/jose/v/4.10.0) library to verify received JWTs. |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
jose npm latest version security advisories 2025
💡 Result:
Summary (as of 2026-01-05)
- Latest npm release: jose — version 6.1.3 (latest published branch). [1]
Known/security advisories and notable CVEs affecting jose (and related go-jose variants)
- CVE-2024-28176 — resource exhaustion via crafted JWE (decompression / compressed plaintext); patched (upgrade to fixed 4.15.9+ / newer patched releases; v5.x removed compressed-payload support). [2][3]
- CVE-2024-28180 — improper handling of highly compressed data (decompression amplification); patched in 4.0.1, 3.0.3 and 2.6.3. [4]
- GHSA-c6gw-w398-hv78 / CVE-2025-27144 (reported Feb 2025) — DoS in go-jose when parsing compact JWS/JWE (excessive memory from splitting tokens); patched in go-jose v4.0.5 / v3.0.4. Note: this advisory targets go-jose (Go implementation), not the Node.js npm package, but is relevant if you use the Go library. [5]
- CVE-2025-45767 — reported in vendor bulletin affecting jose v6.0.10 (weak encryption claim; vendor/third-party guidance and remediation vary); check vendor advisory and upgrade guidance. [6]
Recommendations
- Upgrade to the current fixed release (6.1.3) and test. [1]
- Audit usages of JWE decompression and validate/decompress payloads server-side before passing to jose.
- Monitor GitHub Advisories / npm security advisories for new alerts and backport/patch as needed.
Sources
- Snyk package summary / latest version info for jose (npm) — shows latest 6.1.3. [1]
- Vuln advisories / Snyk for CVE-2024-28176 (resource exhaustion via JWE decompression). [2][3]
- CVE-2024-28180 details (improper handling of highly compressed data) — CVE database entry. [4]
- GitHub Advisory GHSA-c6gw-w398-hv78 (DoS in go-jose parsing; patched versions). [5]
- IBM security bulletin for CVE-2025-45767 (weak encryption claim affecting jose v6.0.10). [6]
If you want, I can:
- fetch the official npm package page and the jose GitHub releases page and paste exact release dates and changelog lines; or
- run a repo scan of your project to see if your installed version is vulnerable.
Update jose library version to address security vulnerabilities.
The documentation references jose v4.10.0, which contains known security vulnerabilities (CVE-2024-28176, CVE-2024-28180). Update the reference to v6.1.3 (latest stable) or at minimum v4.15.9 to patch CVE-2024-28176 (resource exhaustion via JWE decompression).
🤖 Prompt for AI Agents
In @apps/docs/content/guides/functions/auth.mdx around line 83, Update the
referenced jose version in the docs text and link from v/4.10.0 to a patched
release (preferably v/6.1.3; if staying within v4, use at least v/4.15.9) so the
example points to a version that fixes CVE-2024-28176 and CVE-2024-28180; modify
the package/version in the example import/link and any accompanying install
command or URL that currently mentions v/4.10.0 to the chosen safe version.
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
There was a problem hiding this comment.
Seems this version is 3y ago.
I'd just copy it from the docker main/index.ts, maybe we should update the new template to use a latest version.
There was a problem hiding this comment.
yeah, lets update to the latest on both places.
There was a problem hiding this comment.
There was a problem hiding this comment.
I disabled auto merge, I'd say go ahead and do this too? Then good to go
There was a problem hiding this comment.
Lets keep the main/index.ts to its own dedicated PR, so that I'll update the self-host docker template to use latest jose as well the new auth patterns.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @apps/docs/content/guides/functions/auth.mdx:
- Line 83: The docs reference jose v4.10.0 while the code examples use jose v6;
update the reference in auth.mdx to point to the jose v6 package/docs and change
the inline version text from v4.10.0 to v6 so it matches the import and usage in
default.ts (the JWT verification examples). Ensure any anchor/link to the npm
page uses the /v/6 path and that all mentions in the auth.mdx example text
reflect v6.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/docs/content/guides/functions/auth.mdxexamples/edge-functions/supabase/functions/_shared/jwt/clerk.tsexamples/edge-functions/supabase/functions/_shared/jwt/default.tsexamples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: In Supabase Edge Functions documentation, the `meta="name=..."` attribute in CodeSample components may intentionally use generic example names (like "hello/index.ts") rather than matching the actual file path being referenced, to help users understand how to adapt templates to their own use cases.
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: apps/docs/content/guides/functions/auth.mdx:105-110
Timestamp: 2026-01-05T12:21:45.493Z
Learning: In Supabase Edge Functions, the `SUPABASE_URL` environment variable is automatically injected by the platform at runtime and is guaranteed to be available.
Learnt from: laktek
Repo: supabase/supabase PR: 41745
File: apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx:171-190
Timestamp: 2026-01-06T18:30:25.339Z
Learning: In the Supabase edge functions system, paths with embedded "../" segments are denormalized on the backend, so frontend ZIP generation in EdgeFunctionDetailsLayout.tsx doesn't need additional path normalization beyond stripping leading "../" segments.
📚 Learning: 2026-01-02T05:58:55.226Z
Learnt from: meGauravJain
Repo: supabase/supabase PR: 41658
File: apps/studio/components/interfaces/Connect/content/prisma/content.tsx:70-85
Timestamp: 2026-01-02T05:58:55.226Z
Learning: In Prisma configuration or related connection setup code, prefer the environment variable name DIRECT_URL for direct/non-pooled database connections instead of DATABASE_URL_UNPOOLED, per Prisma documentation. Update code that reads database connection strings to use DIRECT_URL where applicable, and document why this is preferred (explicit, documented behavior). Ensure your environment provides DIRECT_URL when using direct connections and fallback handling if needed.
Applied to files:
examples/edge-functions/supabase/functions/_shared/jwt/clerk.tsexamples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.tsexamples/edge-functions/supabase/functions/_shared/jwt/default.ts
📚 Learning: 2026-01-05T12:21:37.661Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, JWT_SECRET is automatically injected by the platform and is guaranteed to be present in production. Treat process.env.JWT_SECRET as defined in production and avoid adding code paths that assume it may be undefined. For development, consider a safe fallback or explicit validation only in non-production environments.
Applied to files:
examples/edge-functions/supabase/functions/_shared/jwt/clerk.tsexamples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.tsexamples/edge-functions/supabase/functions/_shared/jwt/default.ts
📚 Learning: 2026-01-05T23:42:52.357Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: When reviewing MDX documentation that uses CodeSample components in Supabase docs, it's acceptable for CodeSample meta attributes to display generic example file names (e.g., hello/index.ts) to illustrate templating. Do not flag these as file-path mismatches unless the docs claim an exact reference to a real file. If you encounter such code samples, ensure the surrounding text clarifies that the names are placeholders to be adapted by users, and suggest adding a note explaining how to map the template to a real project path.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2025-12-11T02:39:45.951Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/docs-graphql.mdc:0-0
Timestamp: 2025-12-11T02:39:45.951Z
Learning: Applies to apps/docs/app/api/graphql/tests/**/*.test.ts : Test files for GraphQL queries should be located at `apps/docs/app/api/graphql/tests/{queryName}.test.ts` and include tests for: (1) requesting all fields including nested fields with assertion for no errors and proper field returns, and (2) error triggering with assertion for proper GraphQL error response
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2026-01-05T12:21:37.661Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
🪛 GitHub Actions: Check Code with Prettier
apps/docs/content/guides/functions/auth.mdx
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues.
🪛 LanguageTool
apps/docs/content/guides/functions/auth.mdx
[style] ~77-~77: Consider using a more concise synonym.
Context: ...se/functions/custom-jwt-validation) and a variety of [auth function templates](https://githu...
(A_VARIETY_OF)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: typecheck
🔇 Additional comments (5)
examples/edge-functions/supabase/functions/_shared/jwt/clerk.ts (1)
3-3: LGTM with verification pending.The jose library update from v4.14.4 to v6 aligns with the PR objective to use the latest jose version. The usage patterns for
createRemoteJWKSetandjwtVerifyshould be verified for compatibility as requested in the legacy-jwt.ts review.examples/edge-functions/supabase/functions/_shared/jwt/default.ts (1)
3-3: LGTM with verification pending.The jose library update is consistent across all JWT utility files. Verification of v6 API compatibility is being handled for the legacy-jwt.ts file and applies here as well.
apps/docs/content/guides/functions/auth.mdx (2)
33-71: Clear documentation improvement.The new "Integrating with Supabase Auth" section provides a practical example using
supabase.auth.getClaims()for token verification. The example is clear and demonstrates proper error handling.
87-97: LGTM - CodeSample components correctly reference template files.The CodeSample components properly reference the updated JWT verification templates. The generic
meta="name=hello/index.ts"is intentional to help users adapt the template to their own function names.Based on learnings, the meta attribute pattern is correct for showing users how to implement templates in their own edge functions.
examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts (1)
3-3: No action required. The jose v6 update is compatible with the existing usage pattern.The code passes a
Uint8Array(created viaTextEncoder().encode(JWT_SECRET)) tojwtVerify(), which is explicitly the preferred key format for jose v6. The breaking changes from v4 to v6 do not impact this implementation, as it already aligns with v6's expectations for key input types.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
1-97: Fix Prettier formatting violations to unblock CI.The GitHub Actions pipeline reports a Prettier formatting check failure. Run
prettier --write apps/docs/content/guides/functions/auth.mdxlocally to fix the formatting issues before merging.
🧹 Nitpick comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
83-83: Consider specifying the jose version for clarity.The documentation references the jose library without specifying a version, while the code examples use
jsr:@panva/jose@6. Consider adding version information in the text or link to help readers understand which version is being used.🔎 Suggested enhancement
-The following example uses [`jose`](https://jsr.io/@panva/jose) library to verify received JWTs. +The following example uses the [`jose`](https://jsr.io/@panva/jose) library (v6) to verify received JWTs.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/docs/content/guides/functions/auth.mdx
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: In Supabase Edge Functions documentation, the `meta="name=..."` attribute in CodeSample components may intentionally use generic example names (like "hello/index.ts") rather than matching the actual file path being referenced, to help users understand how to adapt templates to their own use cases.
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: apps/docs/content/guides/functions/auth.mdx:105-110
Timestamp: 2026-01-05T12:21:45.493Z
Learning: In Supabase Edge Functions, the `SUPABASE_URL` environment variable is automatically injected by the platform at runtime and is guaranteed to be available.
Learnt from: laktek
Repo: supabase/supabase PR: 41745
File: apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx:171-190
Timestamp: 2026-01-06T18:30:25.339Z
Learning: In the Supabase edge functions system, paths with embedded "../" segments are denormalized on the backend, so frontend ZIP generation in EdgeFunctionDetailsLayout.tsx doesn't need additional path normalization beyond stripping leading "../" segments.
📚 Learning: 2026-01-05T23:42:52.357Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: When reviewing MDX documentation that uses CodeSample components in Supabase docs, it's acceptable for CodeSample meta attributes to display generic example file names (e.g., hello/index.ts) to illustrate templating. Do not flag these as file-path mismatches unless the docs claim an exact reference to a real file. If you encounter such code samples, ensure the surrounding text clarifies that the names are placeholders to be adapted by users, and suggest adding a note explaining how to map the template to a real project path.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2025-12-11T02:39:45.951Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/docs-graphql.mdc:0-0
Timestamp: 2025-12-11T02:39:45.951Z
Learning: Applies to apps/docs/app/api/graphql/tests/**/*.test.ts : Test files for GraphQL queries should be located at `apps/docs/app/api/graphql/tests/{queryName}.test.ts` and include tests for: (1) requesting all fields including nested fields with assertion for no errors and proper field returns, and (2) error triggering with assertion for proper GraphQL error response
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2026-01-05T12:21:37.661Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
🪛 GitHub Actions: Check Code with Prettier
apps/docs/content/guides/functions/auth.mdx
[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in this file.
🪛 LanguageTool
apps/docs/content/guides/functions/auth.mdx
[style] ~77-~77: Consider using a more concise synonym.
Context: ...se/functions/custom-jwt-validation) and a variety of [auth function templates](https://githu...
(A_VARIETY_OF)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: typecheck
|
@kallebysantos Let me see, but it also gets hard for me to work with forks, an annoying feature of GitHub. :( |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/docs/content/guides/functions/auth.mdx (1)
83-83: Consider mentioning jose v6 for consistency.The link references the jose library but doesn't specify the version, while the code examples specifically use
jsr:@panva/jose@6. Consider mentioning "v6" in the text to align with the actual imports and help users understand which version to use.📝 Optional documentation enhancement
-The following example uses [`jose`](https://jsr.io/@panva/jose) library to verify received JWTs. +The following example uses [`jose`](https://jsr.io/@panva/jose) library (v6) to verify received JWTs.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/docs/content/guides/functions/auth.mdx
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: In Supabase Edge Functions documentation, the `meta="name=..."` attribute in CodeSample components may intentionally use generic example names (like "hello/index.ts") rather than matching the actual file path being referenced, to help users understand how to adapt templates to their own use cases.
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: apps/docs/content/guides/functions/auth.mdx:105-110
Timestamp: 2026-01-05T12:21:45.493Z
Learning: In Supabase Edge Functions, the `SUPABASE_URL` environment variable is automatically injected by the platform at runtime and is guaranteed to be available.
Learnt from: laktek
Repo: supabase/supabase PR: 41745
File: apps/studio/components/layouts/EdgeFunctionsLayout/EdgeFunctionDetailsLayout.tsx:171-190
Timestamp: 2026-01-06T18:30:25.339Z
Learning: In the Supabase edge functions system, paths with embedded "../" segments are denormalized on the backend, so frontend ZIP generation in EdgeFunctionDetailsLayout.tsx doesn't need additional path normalization beyond stripping leading "../" segments.
📚 Learning: 2026-01-05T23:42:52.357Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41727
File: apps/docs/content/guides/functions/auth.mdx:93-93
Timestamp: 2026-01-05T23:42:52.357Z
Learning: When reviewing MDX documentation that uses CodeSample components in Supabase docs, it's acceptable for CodeSample meta attributes to display generic example file names (e.g., hello/index.ts) to illustrate templating. Do not flag these as file-path mismatches unless the docs claim an exact reference to a real file. If you encounter such code samples, ensure the surrounding text clarifies that the names are placeholders to be adapted by users, and suggest adding a note explaining how to map the template to a real project path.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2025-12-11T02:39:45.951Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/docs-graphql.mdc:0-0
Timestamp: 2025-12-11T02:39:45.951Z
Learning: Applies to apps/docs/app/api/graphql/tests/**/*.test.ts : Test files for GraphQL queries should be located at `apps/docs/app/api/graphql/tests/{queryName}.test.ts` and include tests for: (1) requesting all fields including nested fields with assertion for no errors and proper field returns, and (2) error triggering with assertion for proper GraphQL error response
Applied to files:
apps/docs/content/guides/functions/auth.mdx
📚 Learning: 2026-01-05T12:21:37.661Z
Learnt from: kallebysantos
Repo: supabase/supabase PR: 41444
File: examples/edge-functions/supabase/functions/_shared/jwt/legacy-jwt.ts:6-7
Timestamp: 2026-01-05T12:21:37.661Z
Learning: In Supabase Edge Functions, the JWT_SECRET environment variable is automatically injected by the Supabase platform and is guaranteed to be present in production environments.
Applied to files:
apps/docs/content/guides/functions/auth.mdx
🪛 LanguageTool
apps/docs/content/guides/functions/auth.mdx
[style] ~77-~77: Consider using a more concise synonym.
Context: ...se/functions/custom-jwt-validation) and a variety of [auth function templates](https://githu...
(A_VARIETY_OF)
🔇 Additional comments (5)
apps/docs/content/guides/functions/auth.mdx (5)
33-36: LGTM! Clear section heading and introduction.The new section heading and introductory text clearly communicate the recommended authentication approach.
48-71: LGTM! Solid authentication example.The code example correctly demonstrates JWT validation using Supabase Auth with proper error handling and appropriate HTTP response codes.
73-79: LGTM! Clear instructions and helpful resources.The section provides clear guidance with direct links to template examples on GitHub.
86-91: Good fix for the Prettier formatting issue!The
prettier-ignorecomment correctly addresses the reported Prettier issue that was causing broken links with\_shared. This prevents Prettier from modifying the CodeSample component attributes.
93-97: LGTM! Template reference follows the documented pattern.The CodeSample correctly references the custom JWT validation example. The generic
meta="name=hello/index.ts"intentionally demonstrates how users would adapt this template to their own function names.Based on learnings, this is the established pattern for template documentation.
Braintrust eval report
|

What kind of change does this PR introduce?
docs update
Additional context
$CodeSamplecomponent to dynamic load jwt exampleSummary by CodeRabbit
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.