Skip to content
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
34d4796
Moved handlers to separate files
aram356 Jul 9, 2025
8870004
Fixed formatting
aram356 Jul 9, 2025
9fcb0e0
Initalize logger with formatting
aram356 Jul 9, 2025
67ce18b
Use env variables during build
aram356 Jul 9, 2025
433554c
Fixed clippy
aram356 Jul 9, 2025
21b03f1
Use updated depedencies
aram356 Jul 9, 2025
b0001ef
Proxy publisher content
aram356 Jul 9, 2025
d4618ef
Fixed Cargo.lock
aram356 Jul 10, 2025
0540e07
Fixed warning
aram356 Jul 10, 2025
f9f8eb1
Replace origin host
aram356 Jul 10, 2025
ce4a890
Implemented stream replacer
aram356 Jul 10, 2025
212bc8d
Fixed streaming
aram356 Jul 10, 2025
2cfb096
Detect TLS connection
aram356 Jul 15, 2025
9f7bcbf
Merge branch 'main' into feature/move-handlers
aram356 Jul 15, 2025
feb896c
Merge branch 'feature/move-handlers' into feature/init-logger
aram356 Jul 15, 2025
eeecaa0
Merge branch 'feature/init-logger' into feature/use-env-vars-during-b…
aram356 Jul 15, 2025
04d763d
Merge branch 'feature/use-env-vars-during-build' into feature/publish…
aram356 Jul 15, 2025
9862ec6
Updated packages
aram356 Jul 15, 2025
4c42783
Removed unnecessary files
aram356 Jul 16, 2025
1fd1fcc
Output logs to stdout
aram356 Jul 17, 2025
b589d41
Output logs to stdout
aram356 Jul 17, 2025
f7c73e5
Merge branch 'feature/init-logger' into feature/use-env-vars-during-b…
aram356 Jul 17, 2025
381471c
Merge branch 'feature/use-env-vars-during-build' into feature/publish…
aram356 Jul 17, 2025
94b80e0
Merge branch 'main' into feature/publisher-proxy
aram356 Jul 18, 2025
4247e30
Simplify streaming replacer logic
aram356 Jul 22, 2025
20d7da8
Merge branch 'main' into feature/publisher-proxy
aram356 Aug 7, 2025
ae93b43
Fixed formatting
aram356 Aug 11, 2025
61bfcfe
Added flag for enable edge pubs
aram356 Aug 11, 2025
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
3 changes: 3 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# [ad_server]
TRUSTED_SERVER__AD_SERVER__AD_PARTNER_BACKEND=http://127.0.0.1:10180

# [publisher]
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL=http://localhost:9090

# [synthetic]
TRUSTED_SERVER__SYNTHETIC__COUNTER_STORE=counter_store
TRUSTED_SERVER__SYNTHETIC__OPID_STORE=opid_store
70 changes: 56 additions & 14 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ publish = false
license = "Apache-2.0"

[dependencies]
brotli = "3.3"
brotli = "8.0"
chrono = "0.4"
config = "0.15.11"
cookie = "0.18.1"
derive_more = { version = "2.0", features = ["display", "error"] }
error-stack = "0.5"
fastly = "0.11.5"
flate2 = "1.0"
futures = "0.3"
handlebars = "6.3.2"
hex = "0.4.3"
Expand All @@ -35,10 +36,11 @@ urlencoding = "2.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.91"
config = "0.15.11"
derive_more = { version = "2.0", features = ["display", "error"] }
derive_more = { version = "1.0", features = ["display", "error"] }
error-stack = "0.5"
http = "1.3.1"
toml = "0.9.0"
url = "2.4.1"

[dev-dependencies]
regex = "1.1.1"
Expand Down
46 changes: 26 additions & 20 deletions crates/common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ pub enum TrustedServerError {
#[display("Configuration error: {message}")]
Configuration { message: String },

/// GAM (Google Ad Manager) integration error.
#[display("GAM error: {message}")]
Gam { message: String },
/// GDPR consent handling error.
#[display("GDPR consent error: {message}")]
GdprConsent { message: String },

/// The synthetic secret key is using the insecure default value.

#[display("Synthetic secret key is set to the default value - this is insecure")]
InsecureSecretKey,

Expand All @@ -31,29 +39,26 @@ pub enum TrustedServerError {
#[display("Invalid HTTP header value: {message}")]
InvalidHeaderValue { message: String },

/// Key-value store operation failed.
#[display("KV store error: {store_name} - {message}")]
KvStore { store_name: String, message: String },

/// Prebid integration error.
#[display("Prebid error: {message}")]
Prebid { message: String },

/// Proxy error.
#[display("Proxy error: {message}")]
Proxy { message: String },

/// Settings parsing or validation failed.
#[display("Settings error: {message}")]
Settings { message: String },

/// GAM (Google Ad Manager) integration error.
#[display("GAM error: {message}")]
Gam { message: String },
/// GDPR consent handling error.
#[display("GDPR consent error: {message}")]
GdprConsent { message: String },

/// Synthetic ID generation or validation failed.
#[display("Synthetic ID error: {message}")]
SyntheticId { message: String },

/// Prebid integration error.
#[display("Prebid error: {message}")]
Prebid { message: String },

/// Key-value store operation failed.
#[display("KV store error: {store_name} - {message}")]
KvStore { store_name: String, message: String },

/// Template rendering error.
#[display("Template error: {message}")]
Template { message: String },
Expand All @@ -75,14 +80,15 @@ impl IntoHttpResponse for TrustedServerError {
fn status_code(&self) -> StatusCode {
match self {
Self::Configuration { .. } | Self::Settings { .. } => StatusCode::INTERNAL_SERVER_ERROR,
Self::InsecureSecretKey => StatusCode::INTERNAL_SERVER_ERROR,
Self::InvalidUtf8 { .. } => StatusCode::BAD_REQUEST,
Self::InvalidHeaderValue { .. } => StatusCode::BAD_REQUEST,
Self::Gam { .. } => StatusCode::BAD_GATEWAY,
Self::GdprConsent { .. } => StatusCode::BAD_REQUEST,
Self::SyntheticId { .. } => StatusCode::INTERNAL_SERVER_ERROR,
Self::Prebid { .. } => StatusCode::BAD_GATEWAY,
Self::InsecureSecretKey => StatusCode::INTERNAL_SERVER_ERROR,
Self::InvalidHeaderValue { .. } => StatusCode::BAD_REQUEST,
Self::InvalidUtf8 { .. } => StatusCode::BAD_REQUEST,
Self::KvStore { .. } => StatusCode::SERVICE_UNAVAILABLE,
Self::Prebid { .. } => StatusCode::BAD_GATEWAY,
Self::Proxy { .. } => StatusCode::BAD_GATEWAY,
Self::SyntheticId { .. } => StatusCode::INTERNAL_SERVER_ERROR,
Self::Template { .. } => StatusCode::INTERNAL_SERVER_ERROR,
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//! - [`prebid`]: Prebid integration and real-time bidding support
//! - [`privacy`]: Privacy utilities and helpers
//! - [`settings`]: Configuration management and validation
//! - [`streaming_replacer`]: Streaming URL replacement for large responses
//! - [`synthetic`]: Synthetic ID generation using HMAC
//! - [`templates`]: Handlebars template handling
//! - [`test_support`]: Testing utilities and mocks
Expand All @@ -33,6 +34,7 @@ pub mod privacy;
pub mod publisher;
pub mod settings;
pub mod settings_data;
pub mod streaming_replacer;
pub mod synthetic;
pub mod templates;
pub mod test_support;
Expand Down
Loading