Repository navigation
fix: authoritativeIdentity rejected real, valid numeric user/org ids - #8
Merged
Merged
Conversation
omnibioai-auth's own /auth/validate returns user_id/org_id as JSON numbers (plain SQL integer primary keys, never stored as strings anywhere) -- but authoritativeIdentity required typeof === 'string' for both, so every real account with actual organization membership was rejected with "authenticated IAM identity lacks user or organization context", even though the identity was completely valid. This repo's own tests never caught it because every iamReply fixture mocks user_id/organization_id as hand-written strings, never the numeric shape the real upstream service actually returns -- found while testing a real account's first-ever use of Launcher against a live stack (every previous account tested here had no organization membership at all, which fails this same check for an unrelated, genuine reason, so the type bug never had a chance to surface). Now accepts either a string or a number for both ids, normalizing to a string (0 is a legitimate id, so the emptiness check is on the normalized string, not numeric truthiness). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
omnibioai-auth's own/auth/validatereturnsuser_id/org_idas JSON numbers (plain SQL integer primary keys, never stored as strings anywhere) -- butauthoritativeIdentityrequiredtypeof === 'string'for both, so every real account with actual organization membership was rejected withauthenticated IAM identity lacks user or organization context, even though the identity was completely valid.Why this repo's own tests never caught it: every
iamReplyfixture mocksuser_id/organization_idas hand-written strings, never the numeric shape the real upstream service actually returns. Found while testing a real account's first-ever use of Launcher against a live stack -- every account tested here before this had no organization membership at all, which fails this same check for an unrelated, genuine reason (no org, not a type mismatch), so the type bug never had a chance to surface until now.Now accepts either a string or a number for both ids, normalizing to a string before use (
0is a legitimate id, so the emptiness check is on the normalized string, not numeric truthiness).Test plan
CI=true npx react-scripts test --testPathPattern="server.test.js"-- 35 passed (33 existing + 2 new)git stashthe fix, re-run -- 2 failed) and pass with it🤖 Generated with Claude Code