Looking for upstream URL re-writer based on X-Consumer-Custom-ID. List of community plugins?

313 views
Skip to first unread message

Tomasz Rdzak

unread,
Jun 27, 2017, 4:49:41 AM6/27/17
to Kong
Hi all,

I expected Request Transformer plugin to be able to modify any part of the request including the URL. I'm aware I can sent headers and query parameters, even body upstream, but it seems as if modifying the path is not supported. 

I need to call upstream REST API like that:
/customers/{X-Consumer-Custom-ID}/something)


Example for for X-Consumer-Custom-ID value 123:
/customers/123/something


This, to me looks like a common pattern in  API with restful resources access. Does anybody know how to do it?

I can try to dive into plugin development but perhaps we have it already?

Many thanks!

P.S: Also - Is there a list of community plugins maintained somewhere?

Thibault Charbonnier

unread,
Jun 27, 2017, 11:16:13 AM6/27/17
to kong...@googlegroups.com
Hi,

The request-transformer indeed does not support inserting dynamic values into parts of the upstream request at this time.

A plugin of your own could do it, but no, no plugin does this out of the box as of today.

Best,
Thibault
--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+...@googlegroups.com.
To post to this group, send email to kong...@googlegroups.com.
Visit this group at https://groups.google.com/group/konglayer.
To view this discussion on the web visit https://groups.google.com/d/msgid/konglayer/18e5eadd-ea71-424f-beeb-a7ca9b983d3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cooper Marcus

unread,
Jun 30, 2017, 5:04:12 PM6/30/17
to Kong
Hi Tomasz,
Is this https://github.com/Mashape/kong/issues/677 what you are seeking? If so, please click the Thumbs Up - thanks!

For community plugins, there is no one central list, but searching LuaRocks for Kong is helpful https://luarocks.org/search?q=kong

Cheers, Cooper

On Tue, Jun 27, 2017 at 8:16 AM, Thibault Charbonnier <thib...@mashape.com> wrote:
Hi,

The request-transformer indeed does not support inserting dynamic values into parts of the upstream request at this time.

A plugin of your own could do it, but no, no plugin does this out of the box as of today.

Best,
Thibault


On 6/27/17 10:49 AM, Tomasz Rdzak wrote:
Hi all,

I expected Request Transformer plugin to be able to modify any part of the request including the URL. I'm aware I can sent headers and query parameters, even body upstream, but it seems as if modifying the path is not supported. 

I need to call upstream REST API like that:
/customers/{X-Consumer-Custom-ID}/something)


Example for for X-Consumer-Custom-ID value 123:
/customers/123/something


This, to me looks like a common pattern in  API with restful resources access. Does anybody know how to do it?

I can try to dive into plugin development but perhaps we have it already?

Many thanks!

P.S: Also - Is there a list of community plugins maintained somewhere?
--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+unsubscribe@googlegroups.com.

To post to this group, send email to kong...@googlegroups.com.
Visit this group at https://groups.google.com/group/konglayer.

Tomasz Rdzak

unread,
Jul 19, 2017, 11:19:53 AM7/19/17
to Kong
Hi Cooper,

Thanks for reply! I did indeed up-vote it. I hope PR gets in quickly! But most off all, I hope that within params in regex urls I will be able to use the ones I care for, such as x-consumer-custom-id...

Regards




On Friday, 30 June 2017 22:04:12 UTC+1, Cooper Marcus wrote:
Hi Tomasz,
Is this https://github.com/Mashape/kong/issues/677 what you are seeking? If so, please click the Thumbs Up - thanks!

For community plugins, there is no one central list, but searching LuaRocks for Kong is helpful https://luarocks.org/search?q=kong

Cheers, Cooper
On Tue, Jun 27, 2017 at 8:16 AM, Thibault Charbonnier <thib...@mashape.com> wrote:
Hi,

The request-transformer indeed does not support inserting dynamic values into parts of the upstream request at this time.

A plugin of your own could do it, but no, no plugin does this out of the box as of today.

Best,
Thibault


On 6/27/17 10:49 AM, Tomasz Rdzak wrote:
Hi all,

I expected Request Transformer plugin to be able to modify any part of the request including the URL. I'm aware I can sent headers and query parameters, even body upstream, but it seems as if modifying the path is not supported. 

I need to call upstream REST API like that:
/customers/{X-Consumer-Custom-ID}/something)


Example for for X-Consumer-Custom-ID value 123:
/customers/123/something


This, to me looks like a common pattern in  API with restful resources access. Does anybody know how to do it?

I can try to dive into plugin development but perhaps we have it already?

Many thanks!

P.S: Also - Is there a list of community plugins maintained somewhere?
--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+...@googlegroups.com.

To post to this group, send email to kong...@googlegroups.com.
Visit this group at https://groups.google.com/group/konglayer.

Tomasz Rdzak

unread,
Aug 14, 2017, 12:39:27 PM8/14/17
to Kong
Unfortunately this update does not solve the problem, because it's not the capturing group of original request what I need to use as part of the upstream url, but internally created value coming from auth plugin (X-Consumer-Custom-ID). Request Transformer is the place where this functionality belongs (as Thibault Charbonnier mentioned) and to me it seems like very basic requirement for modern APIs with url-based restful resources.

Premananda Mohapatra

unread,
Nov 13, 2017, 7:05:27 AM11/13/17
to Kong
Folks, one basic doubt. It looks logical but the URI regex doesnot work with strip uri.
Is it possible in the CE edition or we have to jump to Enterprise Edition now?

-Prem
Reply all
Reply to author
Forward
0 new messages