-
Notifications
You must be signed in to change notification settings - Fork 12
Make creative sanitization opt-in and restore creative iframe origin isolation #956
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
base: feature/optional-creative-rewriting
Are you sure you want to change the base?
Changes from all commits
6b4e82e
6fcbee0
f341a17
9456b95
b4f5def
59f968f
1929dc8
3b2b689
fde8351
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -357,7 +357,11 @@ fn named_routes() -> [NamedRoute; 13] { | |
| }, | ||
| NamedRoute { | ||
| path: "/first-party/proxy-rebuild", | ||
| primary_methods: &[Method::POST], | ||
| // GET serves the click guard's navigation fallback: the creative | ||
| // iframe is an opaque origin (sandbox without `allow-same-origin`), | ||
| // so its JSON POST is blocked by CORS and the guard navigates here | ||
| // for a 302 instead. | ||
| primary_methods: &[Method::GET, Method::POST], | ||
|
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. 🔧 P1 — Axum cannot complete the new GET rebuild redirect chain The rebuild handler now accepts an origin-form URI and returns a relative Please make the shared signed-target parser accept both absolute-form and origin-form URIs, rather than fixing only the rebuild parser, and add an Axum integration test with a valid signed click that follows both redirects. |
||
| handler: NamedRouteHandler::FirstPartyProxyRebuild, | ||
| }, | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -517,6 +517,25 @@ async fn first_party_proxy_rebuild_is_routed() { | |
| ); | ||
| } | ||
|
|
||
| #[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
| async fn first_party_proxy_rebuild_get_is_routed() { | ||
|
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. ⛏ nitpick — The comment promises more than the assertion checks
The test only asserts |
||
| // The opaque-origin creative click guard recovers via GET navigation, so the | ||
| // route must be registered for GET (the handler 302s) and must not fall | ||
| // through to the publisher origin. | ||
| let router = test_router(); | ||
| let req = request_builder() | ||
| .method("GET") | ||
| .uri("/first-party/proxy-rebuild?tsclick=%2Ffirst-party%2Fclick%3Ftsurl%3Dhttps%253A%252F%252Fexample.com") | ||
| .body(edgezero_core::body::Body::empty()) | ||
| .expect("should build request"); | ||
| let resp = route(router, req).await; | ||
| assert_ne!( | ||
| resp.status().as_u16(), | ||
| 404, | ||
| "GET /first-party/proxy-rebuild must be routed" | ||
| ); | ||
| } | ||
|
|
||
| // --------------------------------------------------------------------------- | ||
| // First-party absolute-URI regression — Spin delivers a path-only request URI | ||
| // (built from IncomingRequest::path_with_query), so the shared proxy/click/sign | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.