diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..029284b --- /dev/null +++ b/.env.dev @@ -0,0 +1,6 @@ +# [ad_server] +TRUSTED_SERVER__AD_SERVER__AD_PARTNER_URL=http://127.0.0.1:10180 + +# [synthetic] +TRUSTED_SERVER__SYNTHETIC__COUNTER_STORE=counter_store +TRUSTED_SERVER__SYNTHETIC__OPID_STORE=opid_store diff --git a/CHANGELOG.md b/CHANGELOG.md index 43da388..6a8201d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgrade to fastly-cli 11.3.0 - Changed to use constants for headers - Changed to use log statements +- Updated fastly.toml for local development ## [1.0.6] - 2025-05-29 @@ -56,7 +57,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Implemented GDPR consent for creating and passing synth headers - ## [1.0.4] - 2025-04-29 ### Added diff --git a/README.md b/README.md index e0efe68..7e48d58 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,13 @@ cargo install viceroy ``` #### Run Fastly server locally -Review configuration for [local_server](fastly.toml#L16) +- Review configuration for [local_server](fastly.toml#L16) +- Review env variables overrides in [.env.dev](.env.dev) + +```sh +export $(grep -v '^#' .env.dev | xargs -0) +``` + ```sh fastly -i compute serve ``` diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index bba32bb..3b52f74 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0" chrono = "0.4" config = "0.15.11" cookie = "0.18.1" -fastly = "0.11.2" +fastly = "0.11.5" futures = "0.3" handlebars = "6.3.2" hex = "0.4.3" diff --git a/crates/fastly/tests/kv_store/counter_store.json b/crates/fastly/tests/kv_store/counter_store.json new file mode 100644 index 0000000..35faa20 --- /dev/null +++ b/crates/fastly/tests/kv_store/counter_store.json @@ -0,0 +1,3 @@ +{ + "synthetic_id": 10 +} diff --git a/crates/fastly/tests/kv_store/opid_store.json b/crates/fastly/tests/kv_store/opid_store.json new file mode 100644 index 0000000..35faa20 --- /dev/null +++ b/crates/fastly/tests/kv_store/opid_store.json @@ -0,0 +1,3 @@ +{ + "synthetic_id": 10 +} diff --git a/fastly.toml b/fastly.toml index cead0cd..1a7181a 100644 --- a/fastly.toml +++ b/fastly.toml @@ -3,7 +3,7 @@ authors = ["jason@stackpop.com"] cloned_from = "https://github.com/fastly/compute-starter-kit-rust-default" -description = "aslk" +description = "Trusted Server" language = "rust" manifest_version = 3 name = "trusted-server-fastly" @@ -15,14 +15,14 @@ build = """ [local_server] [local_server.backends] - [local_server.backends.equativ_ad_api_2] # FIX ME: must match config - url = "http://127.0.0.1/" + [local_server.backends.ad_partner_url] + url = "http://127.0.0.1:10180/" [local_server.kv_stores] - [[local_server.kv_stores.jevans_synth_id_counter]] # FIX ME: must match config + [[local_server.kv_stores.counter_store]] key = "placeholder" data = "placeholder" - [[local_server.kv_stores.jevans_synth_id_opid]] # FIX ME: must match config + [[local_server.kv_stores.opid_store]] key = "placeholder" data = "placeholder"