mirror of
https://github.com/hanzoai/iam.git
synced 2026-11-19 18:37:16 +00:00
keys/principal takes an optional ?org=. store.HolderIn admits it exactly where a member's key filed there would act: the holder's home or an org-wide membership their standing acts in (Acts). Anything else is key_org_not_open. The answer names the org the key is filed in as keyOrg, so a resource server still addresses the key's own policy there. Without ?org= nothing changes. For hanzo-inc/cloud#429: cloud billed a key's own org whatever X-Org-Id the caller sent. Testing: go test ./... passes (45 packages). New store tests: selecting a membership acts there as member with the key's name and limit; the key's own org or none is unchanged; another tenant, an unknown org and admin are refused; a member's key may select its holder's home; removing the membership ends the selection on the next call; a plain member of a platform org (hanzo) is refused. Risk: medium. It widens where a secret key acts, but only into orgs its holder already acts in with a token, and the check is the same Acts and MembershipIn the key resolver uses. Reads one membership per selected request; no caching here. How to revert: revert this commit; ?org= is then ignored again. Co-authored-by: Claude Opus 5.5 <[email protected]>