Kong: [feat] plugin by name on consumer management api endpoint

Created on 5 Apr 2017  路  4Comments  路  Source: Kong/kong

see https://github.com/Mashape/kong/pull/2252#issuecomment-291798403

Add an endpoint /consumer/{consumer}/{plugin name or id} where the name of the plugin can be used to retrieve the configuration.

good first issue tasfeature

Most helpful comment

This proposed endpoint is supposed to deliver plugins configured for the consumer identified in the uri-parameter. Hence it will never return an auth plugin as they cannot be configured on a consumer.

if you look at the api.lua files, you'll quickly see how these work. Resolve names (in parameters) to uuids and return the query results.

have a look at #2252 for some ideas of how it is supposed to work.

All 4 comments

I think it should be : /consumer/{consumer}/plugins/{plugin name}

Authentication plugins have no_consumer set.
To fetch the configuration of a plugin for a given consumer, we have to see if there is:
1- The plugin in the plugins table
2- xxxx_credentials where xxxx is the plugin name and then lookup for an entry in this table to validate that the configuration in the plugins table is the one for the consumer.

For the rest of the plugins, look directly in the plugins table.

Is it right?

This proposed endpoint is supposed to deliver plugins configured for the consumer identified in the uri-parameter. Hence it will never return an auth plugin as they cannot be configured on a consumer.

if you look at the api.lua files, you'll quickly see how these work. Resolve names (in parameters) to uuids and return the query results.

have a look at #2252 for some ideas of how it is supposed to work.

@Tieske @kikito Should we close this one?

Was this page helpful?
0 / 5 - 0 ratings