Skip to content

fix: authoritativeIdentity rejected real, valid numeric user/org ids - #8

Merged
man4ish merged 1 commit into
mainfrom
fix/launcher-numeric-identity-ids
Oct 4, 2026
Merged

man4ish merged 1 commit into
mainfrom
fix/launcher-numeric-identity-ids

Conversation

@man4ish

@man4ish man4ish commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

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.

Why this repo's own tests never caught it: 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 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 (0 is 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)
  • Confirmed both new tests fail against the pre-fix code (git stash the fix, re-run -- 2 failed) and pass with it
  • Reproduced the real 403 directly against the live stack with a real account before fixing

🤖 Generated with Claude Code

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>
@man4ish
man4ish merged commit fe6aeff into main Oct 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant