Skip to content

Fix auth issue with qc checks and runs QC checks async for faster returns#163

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

Fix auth issue with qc checks and runs QC checks async for faster returns#163
camerontarget14 merged 4 commits into
mainfrom
Fix-auth-issue-with-QC-checks

Conversation

@jspada200

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes an auth issue that shows up in some cases
  • Runs check async so that we do not time out

Testing

  • I have tested these changes locally
  • I have run all relevant automated tests
  • I have verified this does not break existing workflows

How I Tested

Ran QC checks locally

jspada200 added 3 commits May 19, 2026 15:49
# 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>
@jspada200 jspada200 requested a review from camerontarget14 May 26, 2026 19:08
@jspada200 jspada200 self-assigned this May 26, 2026
@jspada200 jspada200 added the bug Something isn't working label May 26, 2026
@camerontarget14

Copy link
Copy Markdown
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 emails_match utility that normalizes case before comparing, applied across the relevant endpoints in main.py. Nice one!

@camerontarget14 camerontarget14 merged commit 2d98703 into main May 26, 2026
4 checks passed

@camerontarget14 camerontarget14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cool!

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