feat: make integration proxy paths configurable per customer#759
Open
vasujain00 wants to merge 1 commit into
Open
feat: make integration proxy paths configurable per customer#759vasujain00 wants to merge 1 commit into
vasujain00 wants to merge 1 commit into
Conversation
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.
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!)