Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d66b7ce
A geo module is called with the request, as a device module is
jwrosewell Oct 13, 2026
dbaa36b
The ts CLI's local services call the disabled geo as a module
jwrosewell Oct 13, 2026
9800980
Core builds the geo call in one helper
Jamesr51d Oct 13, 2026
5a1938d
Merge branch 'review-fix/32-cache-features' into review-fix/33-geo-call
Jamesr51d Oct 13, 2026
96f7f25
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 13, 2026
663caa0
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 13, 2026
f3e4fba
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 13, 2026
eae40be
Merge split/32-cache-features into split/33-geo-call
Jamesr51d Oct 13, 2026
bdc4359
Merge split/32-cache-features into split/33-geo-call
Jamesr51d Oct 13, 2026
19d754f
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 13, 2026
b2437bb
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 13, 2026
24995e3
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 13, 2026
376746a
The Fastly adapter resolves a response's geo headers with the module …
jwrosewell Oct 14, 2026
1b8b438
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 14, 2026
c5b04c2
The geo module request design
jwrosewell Oct 15, 2026
c8bcb8b
The geo module request design takes its round 1 review
jwrosewell Oct 15, 2026
6944f4e
Merge 32-cache-features into 33-geo-call
jwrosewell Oct 15, 2026
b53b345
The geo module request design takes its round 2 review
jwrosewell Oct 15, 2026
f655262
The geo module request design moves the x-geo response headers to a s…
jwrosewell Oct 16, 2026
e308e02
The x-geo response headers are written by the headers.geo serve middl…
jwrosewell Oct 16, 2026
30bef4b
The changelog and the guides say how a deployment gets the x-geo headers
jwrosewell Oct 16, 2026
c03c3a6
The geo header tests keep the written headers alive while they read them
jwrosewell Oct 16, 2026
df0bb60
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
a8d89fb
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
01e76c1
Hand the carried tests' services a geo module
jwrosewell Oct 16, 2026
4662c9d
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
ebeb8c7
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
74361d2
The parity tests' summary says no adapter writes an x-geo header
jwrosewell Oct 16, 2026
ffd7132
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
fc4b0d7
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
0555309
Merge the review fixes into split/33-geo-call
jwrosewell Oct 16, 2026
ce12dc6
Merge the review fixes into split/33-geo-call
jwrosewell Oct 16, 2026
5b2eca3
The design header names the pull request that carries it
jwrosewell Oct 16, 2026
c3d1460
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
d9aba6f
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
9cf8ba5
Two tests hand the services builder a geo module
jwrosewell Oct 16, 2026
a367ed6
The Fastly robots.txt test finalizes its answers without a location
jwrosewell Oct 16, 2026
cc9dd5a
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
11af8e2
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
d2d55e4
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
3c8ea8c
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 16, 2026
24b06f2
Axum and Spin refuse the platform geo lookup they do not have
jwrosewell Oct 17, 2026
7a8b287
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 18, 2026
ae04dce
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 18, 2026
d229232
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 18, 2026
8aeac1e
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 18, 2026
6546fe9
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 18, 2026
150a83d
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 19, 2026
e29744f
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 19, 2026
ba01d32
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 19, 2026
79a0421
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 19, 2026
c38c201
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
f5f7bbe
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
d897fd0
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
0c32d06
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
37e1d6b
The geo module test's services carry the sample policy
jwrosewell Oct 28, 2026
5075ced
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
c637537
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
27d5b32
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
08f6d36
Merge split/32-cache-features into split/33-geo-call
jwrosewell Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ test_details = "test --target aarch64-apple-darwin"
# native crate needs no change here. Axum (native), Cloudflare
# (wasm32-unknown-unknown), Spin, the CLI (native), and integration-tests
# (native) are simply not listed.
build-fastly = "build -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --target wasm32-wasip1"
check-fastly = "check -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --target wasm32-wasip1"
clippy-fastly = "clippy -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --all-targets --all-features --target wasm32-wasip1 -- -D warnings"
test-fastly = "test -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --target wasm32-wasip1"
build-fastly = "build -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-headers-geo -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --target wasm32-wasip1"
check-fastly = "check -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-headers-geo -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --target wasm32-wasip1"
clippy-fastly = "clippy -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-headers-geo -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --all-targets --all-features --target wasm32-wasip1 -- -D warnings"
test-fastly = "test -p trusted-server-core -p trusted-server-adapter-fastly -p trusted-server-device-fastly -p trusted-server-geo-fastly -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-headers-geo -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb -p trusted-server-js -p trusted-server-openrtb --target wasm32-wasip1"
# Feature-on counterpart of `test-fastly`. `test-fastly` does NOT pass
# --all-features, so without this the reusable-sandbox code is linted by
# `clippy-fastly` but its tests never execute.
Expand All @@ -40,8 +40,8 @@ test-fastly-reuse = "test -p trusted-server-adapter-fastly --target wasm32-wasip
# run with the Axum adapter in CI.
build-axum = "build -p trusted-server-adapter-axum"
check-axum = "check -p trusted-server-adapter-axum"
clippy-axum = "clippy -p trusted-server-adapter-axum -p trusted-server-permission-signal-gpc -p trusted-server-permission-signal-gpp -p trusted-server-permission-signal-mtm -p trusted-server-permission-signal-tcf -p trusted-server-permission-signal-us-privacy -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-loading-cache-51degrees -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb --all-targets --all-features -- -D warnings"
test-axum = "test -p trusted-server-adapter-axum -p trusted-server-permission-signal-gpc -p trusted-server-permission-signal-gpp -p trusted-server-permission-signal-mtm -p trusted-server-permission-signal-tcf -p trusted-server-permission-signal-us-privacy -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-loading-cache-51degrees -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb"
clippy-axum = "clippy -p trusted-server-adapter-axum -p trusted-server-permission-signal-gpc -p trusted-server-permission-signal-gpp -p trusted-server-permission-signal-mtm -p trusted-server-permission-signal-tcf -p trusted-server-permission-signal-us-privacy -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-headers-geo -p trusted-server-loading-cache-51degrees -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb --all-targets --all-features -- -D warnings"
test-axum = "test -p trusted-server-adapter-axum -p trusted-server-permission-signal-gpc -p trusted-server-permission-signal-gpp -p trusted-server-permission-signal-mtm -p trusted-server-permission-signal-tcf -p trusted-server-permission-signal-us-privacy -p trusted-server-cmp-osano -p trusted-server-modules -p trusted-server-identity-lockr -p trusted-server-audience-permutive -p trusted-server-cmp-sourcepoint -p trusted-server-cmp-didomi -p trusted-server-cmp-inmobi -p trusted-server-ads-txt-sellers -p trusted-server-headers-geo -p trusted-server-loading-cache-51degrees -p trusted-server-tag-google-tag -p trusted-server-tag-google-tag-manager -p trusted-server-testing-testlight -p trusted-server-framework-nextjs -p trusted-server-ad-tag-google -p trusted-server-bot-protection-datadome -p trusted-server-ad-server-mock -p trusted-server-auction-aps -p trusted-server-auction-prebid -p trusted-server-auction-prebid-server -p trusted-server-auction-protocol-openrtb"

# --- Cloudflare adapter (native host + wasm32-unknown-unknown) ---
# Build/check target the WASM runtime (requires the `cloudflare` feature);
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ crates/
fastly/ # trusted-server-device-fastly (opt-in TLS/H2 device module)
edgecookie/ # vendor Edge Cookie module crates (built-in HMAC module is in core)
geo/ # vendor geo module crates (host geo is injected by the adapter)
headers/ # response header module crates (geo, which writes the x-geo-* headers)
permission-signal/ # permission signal module crates, one per scheme (gpc, gpp, tcf, us-privacy), and core links none
trusted-server-js/ # TypeScript/JS build — per-integration IIFE bundles
lib/ # TS source, Vitest tests, esbuild pipeline
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **Breaking for crates outside core:** a geo module is a `GeoModule`, called with the request's module call as a device module is (`locate(call)`), so it sees the request's evidence, the settings and the services. `RuntimeServicesBuilder::geo`, `RuntimeServices::with_geo` and `IntegrationRegistrationBuilder::with_geo_module` take an `Arc<dyn GeoModule>`, and `RuntimeServices::geo()`, `IntegrationRegistry::geo_module()`, the `IntegrationRegistration::geo_module` field and `build_geo_module` return or hold one. A module that resolves from the client address alone keeps implementing `PlatformGeo` and is offered through `PlatformGeoModule::new(name, module)`, which hands the platform lookup the address the call carries. Core's lookups on the Edge Cookie and auction paths build the call from the request.
- **Breaking:** no response carries an `x-geo-*` header, `x-geo-info-available` included, unless the deployment selects `headers.geo` (`[headers] modules = ["geo"]`) and names it in a `[[serve]]` entry. That serve middleware writes the location already resolved for the request on the responses the entry covers, and no adapter calls a geo module or writes the headers when it finishes a response. For crates outside core, `GeoInfo::set_response_headers` and the `HEADER_X_GEO_*` constants are gone from core.
- The Axum dev server and Spin, which have no geo lookup, refuse `[geo] module = "platform"` at startup naming the setting. The selection located no request there and still counted as a geo module, so a deployment running an Edge Cookie module was never asked to set `[geo] assume_single_jurisdiction`. The configuration and Cloudflare guides say that Cloudflare places a visitor in a region only from the `cf-region-code` request header.
- A module declares the caches it loads through, by name, and a deployment selects a loading cache for each in its own `[cache.<name>]` table, the way `[cache.robots-txt]` selects one for robots.txt. A `[cache.<name>]` table naming a cache no linked module declares is refused by `ts config validate` and when the deployment starts, naming the ones it does, and a module declaring `robots-txt` or a name another module declares is refused. `IntegrationBuilder::with_cache_features` declares them, `CacheSettings` has a new public field `declared`, `CacheSettings::loading_caches` returns a `Vec` in place of an array, listing core's own and the declared ones, and `LoadingCaches::insert` takes any name.
- **Breaking for crates outside core:** the cookie constants `COOKIE_TS_EC`, `COOKIE_TS_EC_RESOLVED`, `COOKIE_TS_EC_PULL_COMPLETE`, `COOKIE_TS_EIDS` and `COOKIE_TS_TESTER` are `COOKIE_EC`, `COOKIE_EC_RESOLVED`, `COOKIE_EC_PULL_COMPLETE`, `COOKIE_EIDS` and `COOKIE_TESTER`, holding the entry's name alone, and a cookie is named through the request's public prefix with `services.public_prefix().cookie_name(COOKIE_EC)`. A module's response header naming a cookie under the public prefix is refused as one under `ts-` was.
- A robots.txt module's answer is held by the loading cache of the one loading cache module the build links, or of the module `[cache.robots-txt] module` names, briefly in memory and in the host's shared store outside it, so a module is asked again only when no copy young enough is held, rather than by every request. With no loading cache module linked, or several and none named, nothing is held and every request for the file asks each module, as every request did when no adapter gave the file a key-value store. The last answer is kept apart for 30 days and served when the module cannot answer, in the value cache on Fastly and in the key-value store on Cloudflare and Spin, and Axum, which has no key-value store, keeps none.
Expand Down
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"crates/cmp/didomi",
"crates/cmp/inmobi",
"crates/ads-txt/sellers",
"crates/headers/geo",
"crates/loading-cache/51degrees",
"crates/tag/google-tag",
"crates/tag/google-tag-manager",
Expand Down Expand Up @@ -169,6 +170,7 @@ trusted-server-cmp-sourcepoint = { path = "crates/cmp/sourcepoint" }
trusted-server-cmp-didomi = { path = "crates/cmp/didomi" }
trusted-server-cmp-inmobi = { path = "crates/cmp/inmobi" }
trusted-server-ads-txt-sellers = { path = "crates/ads-txt/sellers" }
trusted-server-headers-geo = { path = "crates/headers/geo" }
trusted-server-loading-cache-51degrees = { path = "crates/loading-cache/51degrees" }
trusted-server-tag-google-tag = { path = "crates/tag/google-tag" }
trusted-server-tag-google-tag-manager = { path = "crates/tag/google-tag-manager" }
Expand Down
4 changes: 3 additions & 1 deletion crates/auction/prebid-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2854,7 +2854,9 @@ mod tests {
.kv_store(Arc::new(edgezero_core::key_value_store::NoopKvStore))
.backend(Arc::new(backend))
.http_client(Arc::new(NoopHttpClient))
.geo(Arc::new(NoopGeo))
.geo(Arc::new(
trusted_server_core::platform::PlatformGeoModule::new("noop", Arc::new(NoopGeo)),
))
.client_info(ClientInfo {
client_ip: None,
tls_protocol: None,
Expand Down
24 changes: 22 additions & 2 deletions crates/cmp/didomi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,24 @@ impl DidomiIntegration {
&& matches!(backend, DidomiBackend::Sdk)
&& is_notice_loader(&parts.method, consent_path)
{
// The geo module is called as every geo call is, with the
// request as evidence, its services and its client.
let host = parts
.headers
.get(header::HOST)
.and_then(|value| value.to_str().ok())
.unwrap_or_default();
let scheme = parts.uri.scheme_str().unwrap_or("https");
let request = trusted_server_core::module_context::ModuleRequest::new(
&parts.method,
host,
scheme,
parts.uri.path(),
)
.with_query(parts.uri.query().unwrap_or_default());
let geo = match services
.geo()
.lookup(services.client_info().client_ip, services)
.locate_request(request, Some(&parts.headers), None, services)
.await
{
Ok(Some(geo)) => match normalize_didomi_geo(&geo) {
Expand Down Expand Up @@ -711,7 +726,12 @@ mod tests {
.kv_store(Arc::new(edgezero_core::key_value_store::NoopKvStore))
.backend(Arc::new(StubBackend))
.http_client(http_client)
.geo(Arc::new(StubGeo(geo_result)))
.geo(Arc::new(
trusted_server_core::platform::PlatformGeoModule::new(
"stub",
Arc::new(StubGeo(geo_result)),
),
))
.client_info(ClientInfo {
client_ip: Some(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 7))),
..ClientInfo::default()
Expand Down
Loading
Loading