Add API authorization rules and email comparison utility#162
Merged
Conversation
# 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>
Signed-off-by: James Spadafora <spadjv@gmail.com>
camerontarget14
approved these changes
May 20, 2026
Collaborator
camerontarget14
left a comment
There was a problem hiding this comment.
Nice! I always thought LGTM meant Let's Get This Merged... So LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.cursor/rules/api-auth-and-qc.mdcwith detailed API authorization guidelines.emails_matchfunction inbackend/src/dna/auth/email.pyfor comparing email addresses.emails_matchfor user email comparisons in several endpoints.Testing
How I Tested
Deployed branch to server