fix: set user_id in context for service account auth path to prevent panic on project creation#181
Open
nimish22 wants to merge 7 commits into
Open
fix: set user_id in context for service account auth path to prevent panic on project creation#181nimish22 wants to merge 7 commits into
nimish22 wants to merge 7 commits into
Conversation
…panic on project creation
28016a6 to
648dd28
Compare
cwrm56
previously approved these changes
May 13, 2026
be5981f to
40cb973
Compare
cwrm56
previously approved these changes
May 19, 2026
Collaborator
There was a problem hiding this comment.
Claude suggests adding "a specific test for the service account project creation path — there's no test that sets up a service account context (with is_service_account=true and user_id set) and calls the project creation handler to verify it doesn't panic."
But I have approved.
Collaborator
Author
Added tests as suggested. |
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.
This is fix for issue #180
Summary by cubic
Prevents a panic during project creation with service account auth by setting missing context values and making getters safe. Fixes #180.
user_id,user_role, anduser_emailin the service account path inRequireAuth; also setuser_emailfor standard and OAuth auth to keep context keys consistent.BaseHandlergetters to use safe string assertions and readuser_role; add regression tests to ensure they don't panic when context values are missing.Written for commit e7ca68e. Summary will update on new commits.