Fix TokenExchange sequence example in custom authorization token guide#11286
Fix TokenExchange sequence example in custom authorization token guide#11286notdulain wants to merge 1 commit intowso2:masterfrom
Conversation
…name collision
The TokenExchange sequence used 'Custom' as both the intermediate
property name and the original transport header name. Reading
get-property('Custom') without a scope picked up the wrong value,
breaking the example. Rename the intermediate property to 'CustomValue'.
Resolves wso2#11155
📝 WalkthroughWalkthroughThis change corrects a Synapse mediation sequence example in the API Gateway documentation. The 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Purpose
Fix the broken
TokenExchangesequence example in the "Passing a Custom Authorization Token to the Backend" documentation. The intermediate Synapse property and the original transport header both used the nameCustom, soget-property('Custom')resolved to the wrong scope and the example did not exchange the token as described.Resolves: #11155
Goals
Make the documented example work as written by giving the intermediate property a unique name (
CustomValue), so readers who copy the snippet get the behavior the surrounding text describes.Approach
Rename the intermediate property in the
TokenExchangesequence fromCustomtoCustomValueinen/docs/api-gateway/policies/passing-a-custom-authorization-token-to-the-backend.md. This matches the fix proposed in the issue. Text-only documentation change, no behavioral or build impact.User stories
As a reader following this guide, I want the sequence example to work when I copy it into
tokenExchange.j2, so that theCustomheader value is correctly promoted to theAuthorizationheader before the request reaches the backend.Release note
Documentation: Fixed the
TokenExchangesequence example in "Passing a Custom Authorization Token to the Backend" to use a distinct intermediate property name.Documentation
Updated file:
en/docs/api-gateway/policies/passing-a-custom-authorization-token-to-the-backend.mdTraining
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning
Re-read the Synapse
get-propertysemantics: when the second argument is omitted it looks up the default scope, so reusing the transport header nameCustomfor an intermediate property masked the intended value. Renaming the intermediate property toCustomValueremoves the collision.