Repository navigation
Description
What is missing
CloudFront's origin access control family is unroutable. parseCloudFrontOperation
(emulator/cloudfront_plugin.go) knows /distribution, /distribution/{id}[/config|/invalidation]
and /tagging, and nothing else; a request to /2020-05-31/origin-access-control falls through to
HandleRequest's default arm and is refused as an unknown route. CreateDistributionWithTags is
missing for the same reason — it is POST /2020-05-31/distribution?WithTags, and the WithTags
query key is not read.
Split out of the #1274 audit, which names this set as the one that blocks most: without it a
deploy that keeps its SPA bucket private and serves it through a SigV4-signed CloudFront origin
cannot run against substrate at all.
Why it is in scope
Request/response shapes, an ETag precondition and documented error codes on five published
operations. Nothing here models what CloudFront does to a request in flight — that part (custom
error responses rewriting an API origin's status, for instance) is request-path behaviour and stays
out, as #1274 says.
Acceptance criteria
-
CreateOriginAccessControl—POST /2020-05-31/origin-access-controlwith an
OriginAccessControlConfigbody; 201 with<OriginAccessControl><Id/><OriginAccessControlConfig/></OriginAccessControl>
and anETagheader. -
Name,OriginAccessControlOriginType,SigningBehaviorandSigningProtocolare
Required: Yes; a missing member, or a value outside the published enum
(s3|mediastore|mediapackagev2|lambda,never|always|no-override,sigv4), answers
InvalidArgument/400. -
GetOriginAccessControl— 200 with the same body and theETag; an unknown id answers
NoSuchOriginAccessControl/404. -
ListOriginAccessControls— 200 withOriginAccessControlList. Per the API Reference, an
account using no OACs answers noItemselement at all, not an empty one; that distinction is
asserted on the raw XML, since a decoder cannot tell absent from empty. -
DeleteOriginAccessControl— 204; missing or malformedIf-Matchanswers
InvalidIfMatchVersion/400, a stale onePreconditionFailed/412, an unknown id
NoSuchOriginAccessControl/404. -
CreateDistributionWithTags— routed on theWithTagsquery key, body
DistributionConfigWithTags, and the tags it carries are readable through
ListTagsForResourcein the same account. That round trip is the assertion a teardown check
makes. - Identifiers are minted from
RequestContext.IDsrather than drawn fromcrypto/rand, so a
replayed create reproduces its id —generateCloudFrontIDis one of Identifiers minted from crypto/rand make a replay diverge from its recording, and three replay checks are weakened for it #856's remaining draw sites
and adding a fifth caller to it would widen a list Identifiers minted from crypto/rand make a replay diverge from its recording, and three replay checks are weakened for it #856 is shortening. Converting it here crosses
CloudFront off that list. -
docs/services.md's CloudFront operation table gains the five rows, and the
/origin-access-controlpath family and the absent-Itemsreading are described.
Deliberately deferred, and why
OriginAccessControlInUse/409 is not in this issue. Answering it means knowing which
distributions reference the OAC, and substrate records no Origins for a distribution — that is
the same gap docs/services.md's "A configuration is not a distribution" section describes, and it
is why GetDistributionConfig can answer two of its five required members. #1271 is where a
distribution starts recording its configuration; the check becomes answerable there, and belongs
with it rather than as a guess here.
UpdateOriginAccessControl is out too: #1274 lists four OAC operations, no consumer has asked for
the fifth, and a converge loop that only creates-if-absent does not reach it.
Refs #1274.
Activity
feat(#1277): the CloudFront origin access control family, and a tagge…