Skip to content

cloudfront: the origin access control set is unroutable, so a private-S3-origin deploy cannot run #1277

Closed

Description

@scttfrdmn

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-control with an
    OriginAccessControlConfig body; 201 with <OriginAccessControl><Id/><OriginAccessControlConfig/></OriginAccessControl>
    and an ETag header.
  • Name, OriginAccessControlOriginType, SigningBehavior and SigningProtocol are
    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 the ETag; an unknown id answers
    NoSuchOriginAccessControl/404.
  • ListOriginAccessControls — 200 with OriginAccessControlList. Per the API Reference, an
    account using no OACs answers no Items element 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 malformed If-Match answers
    InvalidIfMatchVersion/400, a stale one PreconditionFailed/412, an unknown id
    NoSuchOriginAccessControl/404.
  • CreateDistributionWithTags — routed on the WithTags query key, body
    DistributionConfigWithTags, and the tags it carries are readable through
    ListTagsForResource in the same account. That round trip is the assertion a teardown check
    makes.
  • Identifiers are minted from RequestContext.IDs rather than drawn from crypto/rand, so a
    replayed create reproduces its id — generateCloudFrontID is 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-control path family and the absent-Items reading 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

  1. added this to the v0.121.0 milestone on Sep 26, 2026
  2. added a commit that references this issue on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions