mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
Closes the last open piece of #2313. Resource shares and associations already existed; GetResourceShareInvitations was hardcoded to return empty and there was no Accept/RejectResourceShareInvitation at all, so aws_ram_resource_share_accepter had nothing to work against. Adds real invitation records for bare AWS account-id principals added while organization sharing is off (an organization/OU principal never gets one, matching real AWS's own auto-accept behavior for org-based sharing, and neither does an account principal once organization sharing is enabled). Accept/reject are receiver-only and terminal once resolved, matching the modeled error shapes (OperationNotPermittedException, ResourceShareInvitationAlready{Accepted,Rejected}Exception, ResourceShareInvitationArnNotFoundException, MalformedArnException). GetResourceShareInvitations only returns invitations the caller received, not ones it sent, matching the API reference ("invitations that you have received"). Deliberately not a visibility gate: GetResourceShares/ListResources under OTHER-ACCOUNTS keep showing every non-owned share regardless of invitation status, same as before this change, since floci's launched- container credentials all resolve to one default account and gating on acceptance would hide shares from the very consumers real AWS invited. Invitation creation and accept/reject are each serialized behind a synchronized(this) scoped to just this new code, closing two TOCTOU races (duplicate invitations from concurrent associates on the same principal; a double-accept both succeeding) without touching the pre-existing, already-unsynchronized share-mutation paths.