Files
floci/docs
TATSUNO “Taz” Yasuhiro 8bff1ba0f3 feat(cloudfront): sign requests to a Lambda Web Function origin under OAC (#6037)
* feat(cloudfront): sign requests to a Lambda Web Function origin under OAC

CreateOriginAccessControl now takes always-amz-auth for the lambda origin
type and sigv4a for s3 and lambda, with the AWS validation messages.
Distributions check the origin access control of a Lambda origin as AWS
does, and refuse a Lambda@Edge origin trigger in front of an origin signed
with always-amz-auth or sigv4a.

Under always-amz-auth, CloudFront signs its requests to a Web Function
endpoint of this Floci for the distribution. An IamAuth endpoint lets them
through, or under IAM enforcement evaluates the function policy for
cloudfront.amazonaws.com with aws:SourceArn and aws:SourceAccount.

* fix(cloudfront): refuse unknown and in-use OAC changes as AWS does

A distribution naming an origin access control that does not exist is
InvalidOriginAccessControl. A control an origin uses can no longer change
its origin type, its signing protocol, or whether it is always-amz-auth,
which AWS answers with IllegalUpdate.

* fix(cloudfront): match a Lambda origin by the end of its hostname

CloudFront takes a Lambda origin only from a hostname under on.aws, and it matches the fixed labels case sensitively. Floci also takes one under its own host.

The CloudFront check and the caller check now share the endpoint condition keys. The docs say when CloudFront forwards the viewer Authorization.

* fix(cloudfront): read the Floci host for Lambda origins from the authority

URI.getHost is null for a host with an underscore, such as a Compose service name, which broke CloudFront at startup. The Web Function endpoints are named from the authority, so the match reads it the same way.
2026-10-20 08:26:11 -04:00
..
2026-03-15 17:43:56 -05:00