refactor(PRO-401): serve /__mcl/* from edge-core's endpoints; the Lambda is an adapter - #15
Merged
Merged
Conversation
…bda is an adapter http.ts converts the origin-request event to a Fetch API Request and the shared Response back to a CloudFront generated response. breaker.ts wraps the shared breaker with the KVS brk mirror on transitions. runtime.ts builds the endpoint runtime from the baked secrets and the live KVS config. endpoints.ts and responses.ts are gone; the Function is untouched. The shared endpoints take the allowed verify origins from here (the deployment's hosts plus the distribution domain, or the same-origin statement when none are named) and serve the challenge page and resident script as the shared, cacheable kind. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
npm kept the lockfile's previous commit for the github: spec, so the first commit installed 0.6.0. Re-resolved explicitly; typecheck, tests and the build run against the tagged 0.7.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Lambda is now the CloudFront adapter for edge-core 0.7.0 (spurintel/monocle-edge-core#16, plan D9 in
monocle-fastly-port-plan.md).http.tsconverts the origin-request event to a Fetch APIRequestand the sharedResponseback to a CloudFront generated response;breaker.tswraps the shared breaker with the KVSbrkmirror on transitions;runtime.tsbuilds the endpoint runtime from the baked secrets and the live KVS config.endpoints.tsandresponses.tsare gone. The Function is untouched.What the shared endpoints take from here
allowedOrigins: the deployment's hosts plus the distribution domain, or the browser's same-origin statement when the deployment names none. Never the origin-request Host.sharedPages: the challenge page and the resident script stay cacheable per segment, and the session tag still comes from/__mcl/state.Behaviour
Nothing user-visible changes on this platform: the endpoint responses, the script segment formula the dashboard derives, the cacheable challenge page and the breaker mirror are the ones the Lambda had, now produced by the shared code.
Verification
Typecheck clean; 61 tests;
npm run buildpasses with the Function at 8,379 of 10,240 bytes. Pinned tov0.7.0-rc.1; repin tov0.7.0once the edge-core PR merges.🤖 Generated with Claude Code