liyuntao / kong-init

Declarative configuration tool for Kong
Apache License 2.0
38 stars 8 forks source link

basic-auth example #9

Closed mwesox closed 6 years ago

mwesox commented 6 years ago

Hi ,

do you support also basic-auth ? If so, do you have an example? Are we able to provide credentials on consumer level?

thx

liyuntao commented 6 years ago

Yeah, kong-init do support basic-auth plugin, but not on consumer level yet.

e.g. in version 1 (under api definition):

plugins:
- name: whatever-just-a-description
  plugin_type: basic-auth
  target_api: cookie-api # can be applied to global/apis
  config:
    hide_credentials: false

or in version 2(under service/route definition):

plugins:
- name: basic-auth # type of plugin here
  enabled: true
  target: s[netdisk,dummy] # can be applied to services/routes/global
  config:
    hide_credentials: false

In fact, kong-init will just passing the plugins.config struct to kong-admin-api, thus support any independent plugin out of the box.

However plugins/credentials on consumer level is currently not supported yet. Do you have anything to share on the specific scene about consumer level credentials? (currently we are using a simple micro-service for creating credentials and sign JWT-token when user doing login action)

mwesox commented 6 years ago

Thx