-
Notifications
You must be signed in to change notification settings - Fork 8
Extract client IP and TLS info once at adapter boundary (PR7) #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
prk-Jr
wants to merge
23
commits into
feature/edgezero-pr6-backend-http-client
Choose a base branch
from
feature/edgezero-pr7-geo-client-info
base: feature/edgezero-pr6-backend-http-client
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
2ff0ce9
Add PR7 design spec for geo lookup + client info extract-once
prk-Jr ead539c
Fix spec review issues in PR7 design doc
prk-Jr 8bbfc74
Update PR7 spec to address all five agent review findings
prk-Jr b39cd79
Add PR7 implementation plan and address plan review findings
prk-Jr d6a624a
Fix three plan review findings and two open questions
prk-Jr 986a1b2
Broaden two low-severity doc cleanup steps in PR7 plan
prk-Jr 86079c5
Fix two remaining low findings in PR7 plan
prk-Jr a03a765
Fix count drift in Step 7: four → five locations
prk-Jr ac79961
Add client_info field to AuctionContext and fix all construction sites
prk-Jr b96aec0
Change RequestInfo::from_request to take &ClientInfo, thread services…
prk-Jr 661e3df
Add Task 2 follow-up coverage and README route fixes
prk-Jr 774a07f
Add services param to generate_synthetic_id, remove Fastly IP/geo cal…
prk-Jr 95ce45e
Revert premature publisher geo change from Task 3
prk-Jr b10dcec
Replace deprecated GeoInfo::from_request in publisher.rs with service…
prk-Jr 888170d
Remove Fastly IP extraction from Didomi copy_headers, use ClientInfo …
prk-Jr f856b68
Move IpAddr import to test module level in didomi.rs
prk-Jr eb12522
Apply rustfmt formatting to didomi.rs, publisher.rs, and synthetic.rs
prk-Jr 7fcb3b4
Add test coverage for generate_synthetic_id with concrete client IP
prk-Jr 1844290
Align geo lookup warn log format with codebase convention ({e} not {e…
prk-Jr 0132a36
Apply Prettier formatting to PR7 plan and spec docs
prk-Jr 14f282b
Merge branch 'feature/edgezero-pr6-backend-http-client' into feature/…
prk-Jr bf579a2
Merge branch 'feature/edgezero-pr6-backend-http-client' into feature/…
prk-Jr 43dcee0
Merge branch 'feature/edgezero-pr6-backend-http-client' into feature/…
prk-Jr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,8 @@ use crate::constants::{HEADER_X_TS_EC, HEADER_X_TS_EC_FRESH}; | |
| use crate::creative; | ||
| use crate::edge_cookie::generate_ec_id; | ||
| use crate::error::TrustedServerError; | ||
| use crate::geo::GeoInfo; | ||
| use crate::openrtb::{to_openrtb_i32, OpenRtbBid, OpenRtbResponse, ResponseExt, SeatBid, ToExt}; | ||
| use crate::platform::{GeoInfo, RuntimeServices}; | ||
| use crate::settings::Settings; | ||
|
|
||
| use super::orchestrator::OrchestrationResult; | ||
|
|
@@ -83,14 +83,17 @@ pub struct BannerUnit { | |
| pub fn convert_tsjs_to_auction_request( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 thinking — This function now takes exactly 7 parameters, which is the project convention limit. It passes today, but one more addition will require restructuring. |
||
| body: &AdRequest, | ||
| settings: &Settings, | ||
| services: &RuntimeServices, | ||
| req: &Request, | ||
| consent: ConsentContext, | ||
| ec_id: &str, | ||
| geo: Option<GeoInfo>, | ||
| ) -> Result<AuctionRequest, Report<TrustedServerError>> { | ||
| let ec_id = ec_id.to_owned(); | ||
| let fresh_id = generate_ec_id(settings, req).change_context(TrustedServerError::Auction { | ||
| message: "Failed to generate fresh EC ID".to_string(), | ||
| })?; | ||
| let fresh_id = | ||
| generate_ec_id(settings, services).change_context(TrustedServerError::Auction { | ||
| message: "Failed to generate fresh EC ID".to_string(), | ||
| })?; | ||
|
|
||
| // Convert ad units to slots | ||
| let mut slots = Vec::new(); | ||
|
|
@@ -137,9 +140,8 @@ pub fn convert_tsjs_to_auction_request( | |
| user_agent: req | ||
| .get_header_str("user-agent") | ||
| .map(std::string::ToString::to_string), | ||
| ip: req.get_client_ip_addr().map(|ip| ip.to_string()), | ||
| #[allow(deprecated)] | ||
| geo: GeoInfo::from_request(req), | ||
| ip: services.client_info.client_ip.map(|ip| ip.to_string()), | ||
| geo, | ||
| }); | ||
|
|
||
| // Forward allowed config entries from the JS request into the context map. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.