Expose runtime_env_config for custom Fastly entry points - #351
Open
aram356 wants to merge 1 commit into
Open
Conversation
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
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.
Closes #349.
edgezero-adapter-fastlyresolvedEDGEZERO__*runtime overrides from theedgezero_runtime_envConfig Store only inside the private loader behindrun_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_configand exports it, keeping the missing-store warning and empty-EnvConfigfallback so custom entry points resolve staged selectors identically torun_app. The key-derivation rules move into a pureruntime_env_keyshelper with a unit test pinning them: a__NAMEselector per declared store id,__KEYfor config stores only. The helper is gatedcfg(any(feature = "fastly", test))because the crate's default features excludefastly, 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, andcargo check --workspace --all-targets --features "fastly cloudflare spin".