Skip to content

Add API authorization rules and email comparison utility#162

Merged
camerontarget14 merged 2 commits into
mainfrom
Fix-auth-issue-with-QC-checks
May 20, 2026
Merged

Add API authorization rules and email comparison utility#162
camerontarget14 merged 2 commits into
mainfrom
Fix-auth-issue-with-QC-checks

Conversation

@jspada200
Copy link
Copy Markdown
Collaborator

@jspada200 jspada200 commented May 19, 2026

Summary

This branch fixes the QC checks failing server side due to an auth issue. In addition, refine the prompt for the QC check to make it more reliable and provide more context about the fields of the draft note.

This commit introduces a new file for API authorization rules, detailing the authentication provider pairing and user-scoped versus playlist-scoped API authorization. It also adds a utility function for case-insensitive email comparison to enhance authorization checks.

Changes

  • New file: .cursor/rules/api-auth-and-qc.mdc with detailed API authorization guidelines.
  • New utility: emails_match function in backend/src/dna/auth/email.py for comparing email addresses.
  • Updated backend authorization checks to use emails_match for user email comparisons in several endpoints.
  • Added tests for the new email comparison function and updated tests for QC checks to reflect the new authorization logic.

Testing

  • Changes tested locally
  • All relevant automated tests run successfully
  • Verified no existing workflows are broken

How I Tested

Deployed branch to server

# Summary
This commit introduces a new file for API authorization rules, detailing the authentication provider pairing and user-scoped versus playlist-scoped API authorization. It also adds a utility function for case-insensitive email comparison to enhance authorization checks.

## Changes
- New file: `.cursor/rules/api-auth-and-qc.mdc` with detailed API authorization guidelines.
- New utility: `emails_match` function in `backend/src/dna/auth/email.py` for comparing email addresses.
- Updated backend authorization checks to use `emails_match` for user email comparisons in several endpoints.
- Added tests for the new email comparison function and updated tests for QC checks to reflect the new authorization logic.

## Testing
- [X] Changes tested locally
- [X] All relevant automated tests run successfully
- [X] Verified no existing workflows are broken

Signed-off-by: James Spadafora <spadjv@gmail.com>
@jspada200 jspada200 requested a review from camerontarget14 May 19, 2026 22:59
@jspada200 jspada200 added the bug Something isn't working label May 19, 2026
Signed-off-by: James Spadafora <spadjv@gmail.com>
Copy link
Copy Markdown
Collaborator

@camerontarget14 camerontarget14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I always thought LGTM meant Let's Get This Merged... So LGTM!

@camerontarget14 camerontarget14 merged commit 866b394 into main May 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants