Fix auth issue with qc checks and runs QC checks async for faster returns#163
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>
This commit modifies the `run_qc_checks_for_draft` function to execute enabled quality control checks concurrently using `asyncio.gather`, improving performance. Additionally, new tests are added to verify that enabled checks run in parallel and that their order is preserved in the results. - Updated `run_qc_checks_for_draft` to run checks in parallel. - Added tests for parallel execution and order preservation of enabled checks. Signed-off-by: James Spadafora <spadjv@gmail.com>
Collaborator
|
LGTM! For record keeping: Looks like the auth bug in particular, was a case-sensitive email comparison in authorization checks? The fix was a small |
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
Testing
How I Tested
Ran QC checks locally