[request] pushpin plugin #7195
Replies: 13 comments
-
Which integration did we decide to start with? After we know exactly what to build, we can brainstorm on how to build it. |
Beta Was this translation helpful? Give feedback.
-
I'd say a minimum viable plugin should do the following:
This would be enough for a user to create a "Kong -> Pushpin -> Backend" proxy chain without any additional configuration. |
Beta Was this translation helpful? Give feedback.
-
I think the MVP I posted above is still the simplest plan forward, with the addition that the plugin should launch the Pushpin server on startup (and terminate it when Kong terminates). This would be the simplest user experience because then the user wouldn't have to manage a separate service. Later on we could consider how to run the code in the same process (via a libpushpin library with C interface, that the Kong plugin loads), but for now we'll have the plugin do some process management. Tonight we also talked about the possibility of Kong/Nginx handling the outbound proxying. This way, other plugins get a chance to do post processing on whatever requests Pushpin might send out to the API backend. So instead of Pushpin doing the proxying directly to the API backend, it would feed proxied requests back into Kong. Perhaps this could be done by having the plugin listen on a private port that Pushpin could be pointed at for outbound requests. Getting WebSockets to work through Pushpin is probably not too hard. Detect if an incoming request is a WebSocket connection, and if it is then just proxy it out without invoking any of the plugins (and if the Pushpin plugin is in use, then that would mean proxying to Pushpin). However, for this to be of much value, you'll want to be able to run plugin processing, especially Auth related stuff for example. Now, if we supported feeding Pushpin's own proxied requests back into Kong, and Pushpin's WebSocket->HTTP conversion mode is enabled, then Kong could run all the normal plugins against the HTTP requests generated by Pushpin. This should allow the Auth plugin to work. An auth failure flow could look like this:
|
Beta Was this translation helpful? Give feedback.
-
So the two big questions to answer are:
|
Beta Was this translation helpful? Give feedback.
-
Oh and there is another big question:
|
Beta Was this translation helpful? Give feedback.
-
@jkarneges these are all valid questions and some of them are related to #218 - with a Pushpin plugin we can write any kind of logic and avoid loops. I guess at this point we should try to experiment with it and see what happens, since we don't know what we don't know. I would say first thing would be investigating Kong's support for Websockets, and then introduce Pushpin into the equation. |
Beta Was this translation helpful? Give feedback.
-
We discussed this issue today and decided that Pushpin should always live in front of Kong, and that the Pushpin plugin would configure Pushpin how to behave as well as act as a publish relay so that published traffic can be captured. Kong will configure Pushpin via HTTP. It will be possible to set up the plugin per-API, with independent pubsub channel scopes. Tasks:
|
Beta Was this translation helpful? Give feedback.
-
Next steps:
|
Beta Was this translation helpful? Give feedback.
-
Configuration:
Publishing:
A publish request may contain multiple items to publish, and each item may contain a number of fields. Rather than have Kong be fully aware of all possible item fields, it should copy the whole JSON and modify it before relaying to Pushpin. The only modification needed is to prepend the channel with the route ID (which we will say is the API ID + hyphen). If channel is "foo" and API ID is "123", then the channel becomes "123-foo". If a publish request contains more than one item, Kong should be sure to rewrite the channel of all items. |
Beta Was this translation helpful? Give feedback.
-
The necessary Pushpin changes have been implemented in the kong-stuff branch of the pushpin git. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, some update on this? it will be great! |
Beta Was this translation helpful? Give feedback.
-
Hi @jorgecuesta , no update on our end but thanks for the reminder about this. The branch is outdated and we'll try to find time to clean it up. |
Beta Was this translation helpful? Give feedback.
-
To make it easier to deploy Kong and Pushpin together, there should be a way to route traffic to Pushpin as well as have its configuration inherited from Kong's configuration.
Some ideas for the plugin:
Beta Was this translation helpful? Give feedback.
All reactions