Skip to content

Commit 1bfb2e6

Browse files
committed
Finish the default_country retirement across the seam branches
The retirement on the permissions branch left stale references in content the later branches carry. The seam-probe fixtures and the Axum probe tests no longer write the retired setting and acknowledge running without a geo provider instead, the moved DisabledGeo doc and two settings serialization tests describe the rules tree rather than the retired field, and the configuration guide's remaining prose follows. The deployer states the policy in permissions.yaml, and the software encodes no jurisdiction's law.
1 parent 5f92e0c commit 1bfb2e6

5 files changed

Lines changed: 16 additions & 21 deletions

File tree

crates/integrations/seam-probe/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ mod tests {
652652
passphrase = "test-secret-key-32-bytes-minimum"
653653
654654
[geo]
655-
default_country = "US"
656655
assume_single_jurisdiction = true
657656
658657
[integrations.seam_probe]
@@ -726,7 +725,6 @@ mod tests {
726725
passphrase = "test-secret-key-32-bytes-minimum"
727726
728727
[geo]
729-
default_country = "US"
730728
assume_single_jurisdiction = true
731729
"#,
732730
)

crates/trusted-server-adapter-axum/tests/seam_probe.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ const MAX_BODY_BYTES: usize = 4 * 1024 * 1024;
4040
/// The settings baked into the binary carry placeholder secrets that
4141
/// `get_settings()` rejects by design, so every test states its own.
4242
fn settings_with(extra: &str) -> Settings {
43-
// The permission model requires a `[geo] default_country`, because there
44-
// must always be a permission baseline for a request the geo provider
45-
// leaves unmatched. Tests that select a geo provider write their own
46-
// `[geo]` table, so only supply one when the caller has not.
43+
// A request the geo provider leaves unmatched resolves at the top of the
44+
// permissions.yaml rules tree, and a deployment that runs an Edge Cookie
45+
// provider with no geo provider acknowledges that explicitly. Tests that
46+
// select a geo provider write their own `[geo]` table, so only supply one
47+
// when the caller has not.
4748
let geo = if extra.contains("[geo]") {
4849
String::new()
4950
} else {
5051
"
5152
[geo]
52-
default_country = \"US\"
5353
assume_single_jurisdiction = true
5454
"
5555
.to_owned()
@@ -221,7 +221,6 @@ async fn proxy_route_reports_the_modules_geo_and_that_the_preparer_ran() {
221221
r#"
222222
[geo]
223223
provider = "seam_probe"
224-
default_country = "US"
225224
{PROBE_BLOCK}
226225
"#
227226
));
@@ -345,7 +344,6 @@ fn geo_selector_naming_a_module_without_a_provider_fails_at_startup() {
345344
r#"
346345
[geo]
347346
provider = "seam_probe"
348-
default_country = "US"
349347
350348
[integrations.seam_probe]
351349
country = "ZZ"
@@ -467,7 +465,6 @@ fn settings_selecting_module(extra: &str) -> Settings {
467465
proxy_secret = "seam-probe-test-proxy-secret"
468466
469467
[geo]
470-
default_country = "US"
471468
assume_single_jurisdiction = true
472469
473470
{extra}

crates/trusted-server-core/src/platform/geo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use super::{GeoInfo, PlatformError, PlatformGeo, RuntimeServices};
1111
/// sent to any host geo service, so a default deployment is not tied to any host
1212
/// geo capability. Every geo consumer already treats [`GeoInfo`] as optional, so
1313
/// a `None` result degrades gracefully: the permission baseline falls back to
14-
/// the configured `[geo] default_country`, the auction omits geo, and so on.
14+
/// the top of the `permissions.yaml` rules tree, the auction omits geo, and so on.
1515
///
1616
/// Adapter crates should use this type rather than defining their own stub so
1717
/// the behavior is the same on every platform.

crates/trusted-server-core/src/settings.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,17 +4193,18 @@ mod tests {
41934193
// set must not appear in the blob. A `deny_unknown_fields` binary that
41944194
// predates the selector rejects the key during rollout or rollback.
41954195
//
4196-
// The `[geo]` table itself is always written now that `default_country`
4197-
// is required, so the assertion is about the selector key rather than
4198-
// the table, which is what the blob's compatibility actually turns on.
4196+
// The shared fixture writes a `[geo]` table (it acknowledges running
4197+
// with no geo provider), so the assertion is about the selector key
4198+
// rather than the table, which is what the blob's compatibility
4199+
// actually turns on.
41994200
let settings = Settings::from_toml(&crate_test_settings_str())
42004201
.expect("should parse settings without a geo selector");
42014202

42024203
let value = serde_json::to_value(&settings).expect("should serialize settings");
42034204

42044205
let geo = value
42054206
.get("geo")
4206-
.expect("the geo table is written because default_country is required");
4207+
.expect("the geo table is written because the fixture acknowledges no geo provider");
42074208
assert!(
42084209
geo.get("provider").is_none(),
42094210
"an unset geo selector should not be serialized, got {geo}"
@@ -4218,10 +4219,9 @@ mod tests {
42184219

42194220
#[test]
42204221
fn a_selected_geo_provider_stays_in_the_serialized_config() {
4221-
// The shared test settings already carry a `[geo]` table, because
4222-
// `default_country` is required, so the selector is set inside that
4223-
// table rather than in a second one, which TOML rejects as a duplicate
4224-
// key.
4222+
// The shared test settings already carry a `[geo]` table, so the
4223+
// selector is set inside that table rather than in a second one, which
4224+
// TOML rejects as a duplicate key.
42254225
let settings = Settings::from_toml(&crate_test_settings_str().replace(
42264226
"[geo]",
42274227
"[geo]

docs/guide/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ Selects how a client IP is resolved into geolocation (country, region, coordinat
629629
| `provider` | String or null | No | Key of the geo provider. Omit, or set `none`, to resolve no location and make no host geo call. Set `platform` to use the host's own geo lookup. |
630630
| `assume_single_jurisdiction` | Boolean | See description | With no geo provider, every request resolves at the top of the `permissions.yaml` rules tree. A deployment that runs an Edge Cookie provider without a geo provider acknowledges that by setting this to `true`. |
631631

632-
No provider is the default, so a default deployment is not tied to any host geo service. Selecting an unknown provider key fails at startup. A failed geo lookup at request time does not fall back to `default_country`; it resolves every permission to the requires-signal floor and is logged at error level, so an outage is handled protectively.
632+
No provider is the default, so a default deployment is not tied to any host geo service. Selecting an unknown provider key fails at startup. A failed geo lookup at request time does not fall back to the rules tree. It resolves every permission to the requires-signal floor and is logged at error level, so an outage is handled protectively.
633633

634634
**Example**:
635635

@@ -650,7 +650,7 @@ A provider advertises the technical permissions its data use requires, and Trust
650650

651651
### Country and region rules (`permissions.yaml`)
652652

653-
The country and region permission rules are defined in a human-editable `permissions.yaml` at the repository root, compiled into the build (not loaded at runtime). Edit that file and rebuild to change the policy. There is no `[permissions]` block in `trusted-server.toml`. It defines named **groups** (baselines such as `gdpr-eu`, `gdpr-uk`, `us-opt-out`) and **rules** that map a country or country/state to a group, with an optional `permissions` map that overrides single Data Uses (`granted`, `requires_signal`, or `denied`). A request that matches no rule uses the required `[geo] default_country` set in `trusted-server.toml`. See the [Permission Model](/guide/permission-model) for the schema and the shipped defaults.
653+
The country and region permission rules are defined in a human-editable `permissions.yaml` at the repository root, compiled into the build (not loaded at runtime). Edit that file and rebuild to change the policy. There is no `[permissions]` block in `trusted-server.toml`. It defines named **groups** (baselines such as `gdpr-eu` and `us-opt-out`) and a **rules** tree whose nodes map a country, and regions beneath it, to a group, with an optional `permissions` map that overrides single Data Uses (`granted`, `requires_signal`, or `denied`). A request that matches no node resolves at the top of the tree, which also names the `jurisdiction` for consent handling. See the [Permission Model](/guide/permission-model) for the schema and the shipped defaults.
654654

655655
## Geo Configuration
656656

0 commit comments

Comments
 (0)