Skip to content

feat(cloudfront): OAC + cache, origin request, response headers, continuous deployment policies#779

Merged
vieiralucas merged 3 commits intomainfrom
worktree-batch2-cloudfront-policies
Apr 26, 2026
Merged

feat(cloudfront): OAC + cache, origin request, response headers, continuous deployment policies#779
vieiralucas merged 3 commits intomainfrom
worktree-batch2-cloudfront-policies

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 26, 2026

Summary

  • Origin Access Control: full CRUD + List with ETag/If-Match concurrency
  • Cache Policy: full CRUD + List with ?Type=managed|custom filter
  • Origin Request Policy: full CRUD + List
  • Response Headers Policy: full CRUD + List
  • Continuous Deployment Policy: full CRUD + List
  • AWS-managed cache, origin-request, response-headers policies pre-seeded by their well-known IDs (Managed-CachingOptimized etc.) and reject Update/Delete with IllegalUpdate/IllegalDelete
  • +30 ops (cloudfront 29 -> 59, total 2,077 -> 2,107)

Test plan

  • cargo test -p fakecloud-cloudfront — 16 unit tests pass
  • cargo test -p fakecloud-e2e --test cloudfront_policies — 6 E2E tests pass
  • FAKECLOUD_RUN_CONFORMANCE=1 cargo test -p fakecloud-conformance --test cloudfront_policies — 30 conformance tests pass
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all clean
  • README + website docs updated to reflect new ops + managed-policy seeding

Summary by cubic

Adds CloudFront OAC and Cache/Origin Request/Response Headers/Continuous Deployment policies with full CRUD + List. Seeds AWS‑managed policies, enforces ETag/If-Match, fixes managed Response Headers policy IDs and by‑X ListDistributions response roots, validates Name on Update, and bumps CloudFront ops 29→59 (total 2,107).

  • New Features
    • Full CRUD + List for OAC, CachePolicy, OriginRequestPolicy, ResponseHeadersPolicy, ContinuousDeploymentPolicy.
    • ETag/If-Match concurrency and separate Get* and Get*Config endpoints.
    • AWS‑managed Cache/OriginRequest/ResponseHeaders policies pre-seeded; Update/Delete return IllegalUpdate/IllegalDelete; ListCachePolicies supports ?Type=managed|custom.

Written for commit b29585b. Summary will update on new commits.

…inuous deployment policies

- Origin Access Control: full CRUD + List with ETag/If-Match concurrency
- Cache Policy: full CRUD + List with ?Type=managed|custom filter
- Origin Request Policy: full CRUD + List
- Response Headers Policy: full CRUD + List
- Continuous Deployment Policy: full CRUD + List
- AWS-managed cache, origin-request, response-headers policies pre-seeded
  by their well-known IDs and rejected for Update/Delete
- 30 new operations (cloudfront 29 -> 59, total 2,077 -> 2,107)
- 6 E2E tests + 30 conformance tests with Smithy checksums
- README + website docs synced
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 10.44003% with 1038 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rates/fakecloud-cloudfront/src/policies_service.rs 0.00% 898 Missing ⚠️
crates/fakecloud-cloudfront/src/policies.rs 46.66% 128 Missing ⚠️
crates/fakecloud-cloudfront/src/service.rs 52.94% 8 Missing ⚠️
crates/fakecloud-cloudfront/src/state.rs 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/fakecloud-cloudfront/src/policies.rs">

<violation number="1" location="crates/fakecloud-cloudfront/src/policies.rs:603">
P2: Duplicate managed response-headers policy ID causes one seeded policy to overwrite another.</violation>
</file>

<file name="crates/fakecloud-cloudfront/src/policies_service.rs">

<violation number="1" location="crates/fakecloud-cloudfront/src/policies_service.rs:315">
P2: Update handlers miss the non-empty `Name` validation used by create handlers, so invalid policy names can be persisted via update.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread crates/fakecloud-cloudfront/src/policies.rs Outdated
Comment thread crates/fakecloud-cloudfront/src/policies_service.rs
- Managed-SimpleCORS had duplicate ID (5cc3b908) overwriting Managed-CORS-with-preflight
  in seeded map. Use AWS-correct ID 60669652-455b-4ae9-85a4-c4c02393f86c for SimpleCORS
  and e61eb60c-9c35-4d20-a928-2b84e02af89c for CORS-and-SecurityHeadersPolicy.
- Add Name validation to all four policy Update handlers (OAC, Cache,
  OriginRequest, ResponseHeaders) so empty Name is rejected on update,
  matching Create handler behavior.
- Add unit tests asserting managed policy IDs are unique + seeded count
  equals declared length, plus E2E regression test for empty-Name update rejection.
…ings

Audit was already failing on PR #778 (16 missing tests across
AssociateDistributionWebACL, CopyDistribution, CreateDistributionWithTags,
DisassociateDistributionWebACL, and 12 ListDistributionsBy* variants).
Pre-existing red CI surfaces here — not new with batch 2 — but per
'never merge red CI' policy, fix on the spot.

- Add 16 conformance tests with Smithy checksums covering all the
  by-X listings + WebACL/Copy/WithTags ops.
- Fix list_distributions_by response root mapping per AWS spec:
  cache/origin-request/response-headers/key-group/vpc-origin policy
  IDs return DistributionIdList; owned-resource returns
  DistributionIdOwnerList; trust-store/web-acl/anycast/connection-mode/
  connection-function/realtime-log return DistributionList.
@vieiralucas vieiralucas merged commit a568aa3 into main Apr 26, 2026
48 checks passed
@vieiralucas vieiralucas deleted the worktree-batch2-cloudfront-policies branch April 26, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant