Reject missing authenticated users during auth - #29
Merged
Merged
Conversation
suguanYang
force-pushed
the
fix/wangbinqi/missing-user-auth-guard
branch
from
May 12, 2026 05:39
8218520 to
299855c
Compare
suguanYang
force-pushed
the
fix/wangbinqi/missing-user-auth-guard
branch
from
May 12, 2026 05:49
299855c to
bdb5806
Compare
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
UNAUTHENTICATEDat the JWT auth boundary when a Dashboard/Internal token resolves to a user id missing from theusertable.Closes #27.
Tests
uv run --all-packages pytest apps/api/tests/contract/test_job_creation_contract.py::test_should_reject_authenticated_user_id_missing_from_user_table apps/api/tests/contract/test_billing_contract.py::test_should_initialize_missing_user_balance_during_tier_lookup apps/api/tests/contract/test_billing_contract.py::test_should_initialize_missing_user_balance_once_for_concurrent_requestsuv run --all-packages pytest apps/api/tests/contract/test_job_creation_contract.py apps/api/tests/contract/test_billing_contract.pyuv run --all-packages pytest apps/worker/tests/contract/test_parse_task_contract.py::test_should_parse_a_pending_file_job_and_persist_the_published_result_stateuv run --all-packages --group lint ruff check apps/api/app/core/dependencies.py packages/shared-python/shared/services/billing/credits_service.py packages/shared-python/shared/services/billing/credits_sync_service.py apps/api/tests/contract/test_job_creation_contract.pygit diff --checkuv run --all-packages --group typecheck pyright --project pyproject.toml apps/api/app apps/api/main.py apps/worker/app apps/worker/worker.py packages/shared-python/shared