mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 14:30:28 -05:00
SNS's Query routing set listed ten names that neither SNS handler dispatched, so a request for any of them was answered UnsupportedOperation. All ten are real SNS operations, and both the Query and JSON protocols now serve them. AddPermission and RemovePermission edit the topic's Policy attribute the way AWS does, going by LocalStack's recordings of the same calls against a live account: the label becomes the statement's Sid, each account its root principal, and a single account or action is written as a string. A duplicate label, an action outside SNS and a missing topic get AWS's errors. A label the policy does not hold leaves it unchanged, since no source shows what AWS answers there. Floci stores topic policies but does not evaluate them under enforcement, so the grant only shows in GetTopicAttributes. The default topic policy now matches what AWS returns for a new topic: Version 2008-10-17 with an AWS:SourceOwner condition, where Floci has had 2012-10-17 and AWS:SourceAccount since the first commit. AddPermission builds on it. GetSMSSandboxAccountStatus reports the account outside the sandbox, because Floci delivers SMS to any number. The sandbox numbers still work per account and region, without the limits AWS lifts outside the sandbox. CreateSMSSandboxPhoneNumber texts a six-digit code through the same path as Publish, so a test reads it from /_aws/sns, and VerifySMSSandboxPhoneNumber checks it. No number is ever opted out. AWS opts a number out when its owner replies STOP, and nothing reaches Floci that way, so CheckIfPhoneNumberIsOptedOut answers false, ListPhoneNumbersOptedOut is empty, and OptInPhoneNumber checks only the E.164 format, with AWS's error for a malformed number. AddPermission takes only twelve-digit account IDs, so a malformed one cannot end up as a principal in the stored policy. Each of these edits reads a record, changes it and writes it back. AddPermission, RemovePermission and SetTopicAttributes, which writes the same Policy attribute, are synchronized, as are the sandbox's create, verify and delete, so overlapping requests cannot lose a grant or bring back a deleted number. A number whose verification text cannot be recorded is put back as it was. The tests park the first of two edits inside that window and check the second waits. testing.ThreadStates holds the wait they use, which several other test classes still carry their own copies of. With SNS dispatching AddPermission and RemovePermission, the last two rows of the Query routing gap file, SQS's two names reaching SNS without a Version, are gone, leaving 171. The SNS row in docs/services/index.md now counts 39 operations, up from a stale 17. Refs #5549