Skip to content

Add auth and ownership checks to cv-process function#5

Open
dogussyaman wants to merge 1 commit intomainfrom
codex/implement-user-authentication-for-cv-process
Open

Add auth and ownership checks to cv-process function#5
dogussyaman wants to merge 1 commit intomainfrom
codex/implement-user-authentication-for-cv-process

Conversation

@dogussyaman
Copy link
Owner

Motivation

  • Ensure the CV processing endpoint authenticates callers using the Supabase JWT passed in the Authorization header.
  • Prevent users from processing CVs that do not belong to them by validating ownership against cvs.developer_id.
  • Return appropriate HTTP status codes (401/403) for missing/invalid credentials or forbidden access.

Description

  • Read SUPABASE_ANON_KEY from environment and require an Authorization header, returning 401 when missing.
  • Create an auth client using createClient(SUPABASE_URL, SUPABASE_ANON_KEY) with the incoming Authorization header and call auth.getUser() to verify the token.
  • Extract the authenticated user id and compare it to the CV record's developer_id, returning 403 when they do not match.
  • Preserve existing flow for downloading and parsing the CV when authentication and ownership checks pass.

Testing

  • No automated tests were run for this change.

Codex Task

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
code-crafters Ready Ready Preview, Comment Feb 4, 2026 10:05am

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant