feat: make integration proxy paths configurable per customer#759
Open
vasujain00 wants to merge 2 commits into
Open
feat: make integration proxy paths configurable per customer#759vasujain00 wants to merge 2 commits into
vasujain00 wants to merge 2 commits into
Conversation
Collaborator
There was a problem hiding this comment.
Thanks for the contribution — making these proxy paths configurable is a good direction, and I appreciate that the default route behavior is covered. I found two implementation gaps that look worth addressing before relying on custom Didomi paths.
I left the main items inline. One additional follow-up: once the behavior is wired through, please update docs/guide/integrations/didomi.md to document proxy_path, its default, accepted format, and the custom endpoint examples.
694d607 to
6c287b3
Compare
added 2 commits
June 11, 2026 16:56
Fixes IABTechLab#741 Adds a `proxy_prefix()` method to the `IntegrationProxy` trait with a default implementation that preserves existing behavior (`/integrations/{name}`). Integrations can override this to use a customer-configured path that is harder for ad blockers to target. Implements the feature for the Didomi integration as the first example: [integrations.didomi] proxy_path = "my-custom-consent-path" When `proxy_path` is set, routes are registered under `/<proxy_path>/*` instead of the default `/integrations/didomi/consent/*`. The same pattern can be adopted by other integrations. This is a backwards-compatible change -- if `proxy_path` is not set, the default prefix is used and existing deployments are unaffected.
1. Validate proxy_path at config load time:
- Reject empty, trailing slash, double slash, and matchit
metacharacters ({, }, *, ?, #, space)
- Uses validator crate custom function (runs automatically
via Settings::integration_config)
- Added 5 validation unit tests
2. Pass custom proxy path to client-side JS:
- Implement IntegrationHeadInjector for DidomiIntegration
- Injects window.__tsjs_didomi={proxyPath:"/..."}
- TypeScript reads from window.__tsjs_didomi?.proxyPath,
falls back to default /integrations/didomi/consent/
- Existing Didomi JS tests still pass (318 total)
3. Document proxy_path in docs/guide/integrations/didomi.md:
- Added to Configuration Options table
- New 'Custom Proxy Path' section with format rules, examples
- Added environment variable equivalent
6c287b3 to
ea3c6b8
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #741
Summary
proxy_prefix()method to theIntegrationProxytrait allowing integrations to use customer-configured paths instead of hardcoded/integrations/{name}pathsproxy_pathfor the Didomi integration as the first adopterproxy_pathis not setChanges
crates/trusted-server-core/src/integrations/registry.rsproxy_prefix()method toIntegrationProxytrait; updatedget(),post(),put(),delete(),patch()helpers to use itcrates/trusted-server-core/src/integrations/didomi.rsproxy_pathconfig field; overridesproxy_prefix()when set; updated routes and path strippingCloses
Closes #741
Test plan
cargo test --workspacecargo clippy --workspace --all-targets --all-features -- -D warningscargo fmt --all -- --checkcd crates/js/lib && npx vitest runcd crates/js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute serveregisters_custom_proxy_pathverifies custom path routes correctly and default path no longer matchesChecklist
unwrap()in production code -- useexpect("should ...")tracingmacros (notprintln!)