Repository navigation
Conversation
Fastly reads geo_lookup for the client address and Cloudflare reads the request's cf metadata. Both are always selected and pass their outcome through dispatch_admitted_with_geo, so public extensions still cannot replace it. Platform values that fail validation, such as Cloudflare's XX and T1 placeholders, report missing metadata rather than an invalid assertion. GeoSource and GeoTrustBasis gain platform variants and become non_exhaustive; fastly and cloudflare are reserved provider IDs.
[adapters.axum.geo] carries provider, alb_peer_cidrs and origin_credential_header_name defaults, each overridden by the matching EDGEZERO__ADAPTER__GEO__* setting. Precedence is with_geo, then settings, then the manifest, then off, and misconfiguration fails startup instead of falling back. The dev run_app reads settings only. geo_capability() stays explicit-only and geo_capability_for::<A>() reports the runner's view.
This branch has not been deployed
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.
Summary
ctx.geo()now reports country and region on Fastly (geo_lookupfor the client address) and Cloudflare (the request'scfmetadata), always on, so applications such as Trusted Server no longer need platform-specific geo code (EZI-4, EZI-4c).[adapters.axum.geo]inedgezero.toml, with every key overridable byEDGEZERO__ADAPTER__GEO__*at startup. This replaces Trusted Server'sTS_NATIVE_GEO_PROFILEboot profile (EZI-4a); deploy-time values such as ALB networks stay out of the compiled manifest.feature/pluggable-geo-providers) becausemainhas no geo code yet. Spin (EZI-4s) follows separately.Changes
edgezero-core/src/geo.rsGeoSource::{Fastly, Cloudflare},GeoTrustBasis::PlatformMetadata, both enums#[non_exhaustive]; reservedfastly/cloudflareprovider IDs;GeoOutcome::platform()treats unusable platform values (e.g. CloudflareXX/T1) as missing metadata, not a forged assertionedgezero-core/src/manifest.rs[adapters.axum.geo]table (provider,alb_peer_cidrs,origin_credential_header_name); rejectsprovider = "off"with policy fields and the table on non-Axum adaptersedgezero-adapter-fastly/src/request.rsdispatch_admitted_with_geoedgezero-adapter-cloudflare/src/request.rscf.country/cf.regionCodeand dispatches withdispatch_admitted_with_geoedgezero-adapter-axum/src/geo.rs,run_options.rs,dev_server.rswith_geo→ settings → manifest → off; misconfiguration fails before listening; devrun_appreads settings only;geo_capability()stays explicit-only, newgeo_capability_for::<A>()reports the runner's selection; shared geo setting-name listcfmetadata, Axum precedence/rejection units, end-to-end manifest + settings hosting test, dev-runner test, baked-manifest round trip; #439 contract tests updated for always-on platform geodocs/guide/native-geo.md,configuration.md,adapters/axum.mdCloses
Part of #482 (Fastly, Cloudflare and Axum). Spin (EZI-4s) remains, so this does not close the issue.
Test plan
cargo test --workspace --all-targets(2921 passed)cargo clippy --workspace --all-targets --all-features -- -D warnings(pinned 1.98.1)cargo fmt --all -- --checkcargo check --workspace --all-targets --features "fastly cloudflare spin"wasm32-wasip1(Fastly) /wasm32-wasip2(Spin) /wasm32-unknown-unknown(Cloudflare)examples/app-demoworkspace:cd examples/app-demo && cargo test --workspace --all-targetsedgezero serve --adapter axumproduction_hostinggeo tests with and withoutgeo-cloudfront; Axum doc testsLocal Viceroy 0.21.1 aborts some Fastly outbound backend tests (e.g.
configured_connect_timeout_reads_registered_sdk_timeout_settings) on unmodified #439 as well; CI's patched Viceroy is the reference.Checklist
{id}syntax (not:id)edgezero_core(nothttpcrate)KvRegistry/ConfigRegistry/SecretRegistry(not the legacy single-handle setters) — see spec §6.6