From 51a299be21bd5ec0927fbad394a8a70d1d944f15 Mon Sep 17 00:00:00 2001 From: Aram Grigoryan <132480+aram356@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:28:48 -0700 Subject: [PATCH 1/3] Testing deployment of temporary changes to the trusted server configuration. --- trusted-server.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trusted-server.toml b/trusted-server.toml index 0a3c3b2..af98e50 100644 --- a/trusted-server.toml +++ b/trusted-server.toml @@ -1,7 +1,7 @@ [publisher] -domain = "test-publisher.com" -cookie_domain = ".test-publisher.com" -origin_url = "https://origin.test-publisher.com" +domain = "auburndao.com" +cookie_domain = ".auburndao.com" +origin_url = "https://origin.auburndao.com" [ad_server] ad_partner_url = "equativ_ad_api_2" From c0620cbbb78ba160d505654dfdb289b18bed326f Mon Sep 17 00:00:00 2001 From: Aram Grigoryan <132480+aram356@users.noreply.github.com> Date: Thu, 17 Jul 2025 06:23:52 -0700 Subject: [PATCH 2/3] Fix gam content type --- crates/common/src/gam.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/common/src/gam.rs b/crates/common/src/gam.rs index bd42ac0..18e71e7 100644 --- a/crates/common/src/gam.rs +++ b/crates/common/src/gam.rs @@ -206,7 +206,7 @@ impl GamRequest { } Ok(Response::from_status(response.get_status()) - .with_header(header::CONTENT_TYPE, "application/json") + .with_header(header::CONTENT_TYPE, "text/plain") .with_header(header::CACHE_CONTROL, "no-store, private") .with_header(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*") .with_header("X-GAM-Test", "true") From cea9008ae5a47fd1de6c3e8b3e6ecdbbc996358d Mon Sep 17 00:00:00 2001 From: Aram Grigoryan <132480+aram356@users.noreply.github.com> Date: Thu, 17 Jul 2025 06:34:46 -0700 Subject: [PATCH 3/3] Fixed fastly logging --- Cargo.lock | 11 +++++++++++ crates/fastly/Cargo.toml | 2 ++ crates/fastly/src/main.rs | 27 +++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2689050..b124f18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -535,6 +535,15 @@ dependencies = [ "wit-bindgen-rt 0.42.1", ] +[[package]] +name = "fern" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" +dependencies = [ + "log", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1661,8 +1670,10 @@ dependencies = [ name = "trusted-server-fastly" version = "0.1.0" dependencies = [ + "chrono", "error-stack", "fastly", + "fern", "futures", "log", "log-fastly", diff --git a/crates/fastly/Cargo.toml b/crates/fastly/Cargo.toml index d98e2b5..618bd06 100644 --- a/crates/fastly/Cargo.toml +++ b/crates/fastly/Cargo.toml @@ -4,8 +4,10 @@ version = "0.1.0" edition = "2021" [dependencies] +chrono = "0.4.41" error-stack = "0.5" fastly = "0.11.5" +fern = "0.7.1" futures = "0.3" log = "0.4.20" log-fastly = "0.11.5" diff --git a/crates/fastly/src/main.rs b/crates/fastly/src/main.rs index 77cb614..5fb31cf 100644 --- a/crates/fastly/src/main.rs +++ b/crates/fastly/src/main.rs @@ -5,6 +5,7 @@ use fastly::http::{header, Method, StatusCode}; use fastly::KVStore; use fastly::{Error, Request, Response}; use log::LevelFilter::Info; +use log_fastly::Logger; use serde_json::json; mod error; @@ -34,6 +35,8 @@ use trusted_server_common::why::WHY_TEMPLATE; #[fastly::main] fn main(req: Request) -> Result { + init_logger(); + // Print Settings only once at the beginning let settings = match Settings::new() { Ok(s) => s, @@ -155,8 +158,6 @@ fn handle_main_page(settings: &Settings, mut req: Request) -> Result Result) + .apply() + .expect("Failed to initialize logger"); +}