Hello everyone! I hope this video has helped solve your questions and issues. This video is shared because a solution has been found for the question/problem. I create videos for questions that have solutions. If you have any other issues, feel free to reach out to me on Instagram: / ky.emrah
Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!How to use different Request Transformer instances on service and route at the same time in Kong?
I'm trying to set up a route to a service in kong where both the route and the service use a Request Transformer plugin to make different modifications to the request.
However when I enable the Request Transformer on the route the Request Transformer on the service doesn't seem to have any effect anymore.
The setup I'm trying with has this service:
{
"port": 8048,
"path": "/sales",
"enabled": true,
"write_timeout": 60000,
"connect_timeout": 60000,
"name": "proxied-sales-api",
"host": "host.docker.internal",
"protocol": "http",
"id": "fd910d97-2a72-4414-b977-e90c5187bcbb",
"retries": 5,
"read_timeout": 60000
}
{
"port": 8048,
"path": "/sales",
"enabled": true,
"write_timeout": 60000,
"connect_timeout": 60000,
"name": "proxied-sales-api",
"host": "host.docker.internal",
"protocol": "http",
"id": "fd910d97-2a72-4414-b977-e90c5187bcbb",
"retries": 5,
"read_timeout": 60000
}
With this Request Transformer:
{
"service": {
"id": "fd910d97-2a72-4414-b977-e90c5187bcbb"
},
"enabled": true,
"id": "4573853b-c46e-4a85-98d2-0b082bcc694f",
"config": {
"add": {
"headers": [
"Authorization: Basic ******"
]
}
},
"name": "request-transformer",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
}
{
"service": {
"id": "fd910d97-2a72-4414-b977-e90c5187bcbb"
},
"enabled": true,
"id": "4573853b-c46e-4a85-98d2-0b082bcc694f",
"config": {
"add": {
"headers": [
"Authorization: Basic ******"
]
}
},
"name": "request-transformer",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
}
The route is:
{
"request_buffering": true,
"strip_path": true,
"service": {
"id": "fd910d97-2a72-4414-b977-e90c5187bcbb"
},
"regex_priority": 0,
"name": "b2b-auth",
"preserve_host": false,
"protocols": [
"http",
"https"
],
"id": "f60c7639-abe3-469a-94b2-4d2d8d5fc492",
"paths": [
"/sales-api"
],
"path_handling": "v0",
"https_redirect_status_code": 426,
"response_buffering": true
}
{
"request_buffering": true,
"strip_path": true,
"service": {
"id": "fd910d97-2a72-4414-b977-e90c5187bcbb"
},
"regex_priority": 0,
"name": "b2b-auth",
"preserve_host": false,
"protocols": [
"http",
"https"
],
"id": "f60c7639-abe3-469a-94b2-4d2d8d5fc492",
"paths": [
"/sales-api"
],
"path_handling": "v0",
"https_redirect_status_code": 426,
"response_buffering": true
}
With the routes Request Transformer:
{
"enabled": true,
"route": {
"id": "f60c7639-abe3-469a-94b2-4d2d8d5fc492"
},
"id": "12aad2ef-d8d0-4ee4-89bf-a36b320cf08e",
"config": {
"add": {
"body": [
"clientId:buffet-b2b-client",
"client_secret:foo"
],
"headers": [
"Content-Type: application/x-www-form-urlencoded"
],
}
},
"name": "request-transformer",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
}
{
"enabled": true,
"route": {
"id": "f60c7639-abe3-469a-94b2-4d2d8d5fc492"
},
"id": "12aad2ef-d8d0-4ee4-89bf-a36b320cf08e",
"config": {
"add": {
"body": [
"clientId:buffet-b2b-client",
"client_secret:foo"
],
"headers": [
"Content-Type: application/x-www-form-urlencoded"
],
}
},
"name": "request-transformer",
"protocols": [
"gSource of the question:
https://stackoverflow.com/questions/7...
Question and source license information:
https://meta.stackexchange.com/help/l...
https://stackoverflow.com/