This repository was archived by the owner on Jul 1, 2026. It is now read-only.
feat(sns): mobile-push endpoint attribute APIs, dedup, and endpoint publish - #1
Merged
Conversation
1 task
This comment has been minimized.
This comment has been minimized.
sjincho
force-pushed
the
feat/sns-platform-endpoints
branch
2 times, most recently
from
June 19, 2026 07:15
e3116d7 to
8284c6e
Compare
…ublish Mobile-push support was missing several SNS actions/behaviors that real AWS (and LocalStack) provide, so consumers using device-token push flows broke: - GetEndpointAttributes / SetEndpointAttributes / DeleteEndpoint were not implemented (returned InvalidAction). - CreatePlatformEndpoint always created a new endpoint and ignored the top-level CustomUserData parameter. - DeletePlatformApplication was not implemented. - Publish to a platform-endpoint TargetArn failed with "Topic does not exist". Implements the missing actions and AWS-accurate CreatePlatformEndpoint dedup: idempotent return on matching Token+attributes, otherwise an InvalidParameter "Endpoint <arn> already exists with the same Token, but different attributes." Endpoints stay in the existing _platform_endpoints store (already persisted via get_state/restore_state), so no state-contract change. Behaviors per the AWS docs: https://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformEndpoint.html https://docs.aws.amazon.com/sns/latest/api/API_GetEndpointAttributes.html https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html https://docs.aws.amazon.com/sns/latest/api/API_DeleteEndpoint.html https://docs.aws.amazon.com/sns/latest/api/API_DeletePlatformApplication.html https://docs.aws.amazon.com/sns/latest/api/API_Publish.html https://aws.amazon.com/blogs/mobile/mobile-token-management-with-amazon-sns Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Integration tests for the new behaviors: CreatePlatformEndpoint token dedup (idempotent vs different-attributes error) and CustomUserData storage; Get/Set/DeleteEndpoint incl. NotFound and idempotent delete; DeletePlatformApplication cascading to its endpoints; and Publish to a platform-endpoint TargetArn. Generic/AWS-accurate, no consumer coupling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sjincho
force-pushed
the
feat/sns-platform-endpoints
branch
from
June 19, 2026 11:28
8284c6e to
db50777
Compare
sjincho
marked this pull request as ready for review
June 19, 2026 11:42
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
MiniStack's SNS mobile-push support was incomplete versus real AWS (and LocalStack), which broke consumers using device-token push flows — registering a device endpoint, reading/refreshing its attributes, and publishing to it. Missing or incorrect before this PR:
GetEndpointAttributes/SetEndpointAttributes/DeleteEndpointreturnedInvalidAction(not implemented).CreatePlatformEndpointalways created a new endpoint and ignored the top-levelCustomUserDataparameter.DeletePlatformApplicationreturnedInvalidAction.Publishto a platform-endpointTargetArnreturnedTopic does not exist.(Drove this: a device-token push pipeline — a
register-push-deviceservice and an app-push Lambda — where 15 tests failed against stock MiniStack.)Change
ministack/services/sns.pyonly:GetEndpointAttributes,SetEndpointAttributes,DeleteEndpoint,DeletePlatformApplication.CreatePlatformEndpoint: storeCustomUserData; AWS dedup-by-Token— idempotent return whenToken+attributes match, otherwiseInvalidParameter"Endpoint <arn> already exists with the same Token, but different attributes."Publish: accept a platform-endpointTargetArn(returns aMessageId; no delivery, matching emulator behavior)._platform_endpoints(persisted viaget_state/restore_state), so no state-contract change;reset()unchanged.Test plan
pytest tests/test_sns.py -k "platform or endpoint"— 12 new tests pass (create/dedup/CustomUserData; Get/Set/Delete incl.NotFound+ idempotent delete;DeletePlatformApplicationcascade; publish-to-endpoint).tests/test_sns.pyregression-free — the only 2 failures (*_http_subscription_*) reproduce identically onmain(env without aiohttp), unrelated to this change.ruff check ministack/services/sns.py tests/test_sns.py— clean.NotFound→ duplicate-token error → publish) against an image built from this branch.