Skip to content

Expose runtime_env_config for custom Fastly entry points - #351

Open
aram356 wants to merge 1 commit into
mainfrom
expose-fastly-runtime-env-config
Open

Expose runtime_env_config for custom Fastly entry points#351
aram356 wants to merge 1 commit into
mainfrom
expose-fastly-runtime-env-config

Conversation

@aram356

@aram356 aram356 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Closes #349.

edgezero-adapter-fastly resolved EDGEZERO__* runtime overrides from the edgezero_runtime_env Config Store only inside the private loader behind run_app. A downstream app with a custom Fastly entry point (Trusted Server builds its app directly) could not reach it, so a staged version silently loaded production config selectors (IABTechLab/trusted-server#940).

This renames the loader to runtime_env_config and exports it, keeping the missing-store warning and empty-EnvConfig fallback so custom entry points resolve staged selectors identically to run_app. The key-derivation rules move into a pure runtime_env_keys helper with a unit test pinning them: a __NAME selector per declared store id, __KEY for config stores only. The helper is gated cfg(any(feature = "fastly", test)) because the crate's default features exclude fastly, which is what lets the test run in the plain workspace test suite.

Verified in this branch: cargo test -p edgezero-adapter-fastly (54 passed, new test included), cargo fmt --check, cargo clippy --all-targets --all-features -D warnings, and cargo check --workspace --all-targets --features "fastly cloudflare spin".

Rename the private env_config_from_runtime_dictionary loader to
runtime_env_config and export it from edgezero-adapter-fastly, so
custom Fastly entry points that bypass run_app can resolve staged
EDGEZERO__* store selectors identically instead of duplicating the
store name and key-derivation rules.

Split the key derivation into a pure runtime_env_keys helper and pin
its rules (a __NAME selector per store id, __KEY for config stores
only) with a unit test that runs without a Fastly host.

Closes #349
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.

Expose a public runtime-env EnvConfig API for custom Fastly entry points

1 participant