Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ src/*.html
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.specstory
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added basic unit tests
- Added publisher config
- Add AI assist rules. Based on https://github.com/hashintel/hash
- Added ability to construct GAM requests from static permutive segments with test pages

### Changed
- Upgrade to rust 1.87.0
Expand Down
88 changes: 87 additions & 1 deletion Cargo.lock

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

77 changes: 77 additions & 0 deletions PUBLISHER_IDS_AUDIT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Publisher-Specific IDs Audit

This document lists all publisher-specific IDs and configurations found in the codebase that are currently hardcoded to test publisher values.

## Configuration Files

### trusted-server.toml

**GAM Configuration:**
- `publisher_id = "3790"` (line 14)
- `server_url = "https://securepubads.g.doubleclick.net/gampad/ads"` (line 15)

**Equativ Configuration:**
- `sync_url = "https://adapi-srv-eu.smartadserver.com/ac?pgid=2040327&fmtid=137675&synthetic_id={{synthetic_id}}"` (line 8)
- Page ID: `2040327`
- Format ID: `137675`

**Test Publisher Domain:**
- `domain = "test-publisher.com"` (line 2)
- `cookie_domain = ".test-publisher.com"` (line 3)
- `origin_url = "https://origin.test-publisher.com"` (line 4)

**KV Store Names (user-specific):**
- `counter_store = "jevans_synth_id_counter"` (line 24)
- `opid_store = "jevans_synth_id_opid"` (line 25)

## Hardcoded in Source Code

### /Users/jevans/trusted-server/crates/common/src/gam.rs

**Permutive Segment Data (lines 295 and 486):**
```rust
.with_prmtvctx("129627,137412,138272,139095,139096,139218,141364,143196,143210,143211,143214,143217,144331,144409,144438,144444,144488,144543,144663,144679,144731,144824,144916,145933,146347,146348,146349,146350,146351,146370,146383,146391,146392,146393,146424,146995,147077,147740,148616,148627,148628,149007,150420,150663,150689,150690,150692,150752,150753,150755,150756,150757,150764,150770,150781,150862,154609,155106,155109,156204,164183,164573,165512,166017,166019,166484,166486,166487,166488,166492,166494,166495,166497,166511,167639,172203,172544,173548,176066,178053,178118,178120,178121,178133,180321,186069,199642,199691,202074,202075,202081,233782,238158,adv,bhgp,bhlp,bhgw,bhlq,bhlt,bhgx,bhgv,bhgu,bhhb,rts".to_string())
```

This large string contains Permutive segment IDs that appear to be captured from a specific test publisher's live traffic.

### /Users/jevans/trusted-server/crates/common/src/prebid.rs

**Equativ Integration:**
- `"pageId": 2040327` (matches config)
- `"formatId": 137675` (matches config)

### Test Files

**Test Support Files:**
- GAM publisher ID `"3790"` in test configurations
- `"test-publisher.com"` and related test domains in multiple test files

## Impact Assessment

### High Priority (Publisher-Specific)
1. **GAM Publisher ID (3790)** - Core identifier for ad serving
2. **Permutive Segments** - Large hardcoded segment string from test traffic
3. **Equativ Page/Format IDs (2040327, 137675)** - Ad network integration

### Medium Priority (Environment-Specific)
1. **Test Publisher Domains** - Should be configurable per deployment
2. **KV Store Names** - Currently user-specific (jevans_*)

### Low Priority (Infrastructure)
1. **Server URLs** - Generally standard but should be configurable

## Recommendations

1. Move hardcoded Permutive segments to configuration
2. Make GAM publisher ID environment-specific
3. Make Equativ IDs configurable per publisher
4. Generalize KV store naming convention
5. Create publisher-specific configuration templates

## Files to Update

- `trusted-server.toml` - Add permutive segments configuration
- `crates/common/src/gam.rs` - Remove hardcoded segments (lines 295, 486)
- `crates/common/src/prebid.rs` - Use configuration for Equativ IDs
- Test files - Use environment-agnostic test data
3 changes: 3 additions & 0 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ publish = false
license = "Apache-2.0"

[dependencies]
brotli = "3.3"
chrono = "0.4"
config = "0.15.11"
cookie = "0.18.1"
Expand All @@ -27,6 +28,8 @@ serde_json = "1.0.91"
sha2 = "0.10.9"
tokio = { version = "1.46", features = ["sync", "macros", "io-util", "rt", "time"] }
url = "2.4.1"
uuid = { version = "1.0", features = ["v4"] }
urlencoding = "2.1"

[build-dependencies]
serde = { version = "1.0", features = ["derive"] }
Expand Down
Loading