Skip to content

Commit

Permalink
allow overrides for upstream jwt plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ikethecoder committed Nov 9, 2023
1 parent 3c7bc99 commit a8d80e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions microservices/gatewayApi/utils/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ def proxy_cache (plugin, plugin_configs=None):
for k, v in override_config.items():
plugin_config[k] = v

def upstream_jwt (plugin, plugin_configs=None):
override_config = conf['plugins']['upstream_jwt']

if 'config' in plugin:
plugin_config = plugin['config']
else:
plugin['config'] = {}
plugin_config = plugin['config']

for k, v in override_config.items():
plugin_config[k] = v


def rate_limiting (plugin, plugin_configs=None):
override_config = conf['plugins']['rate_limiting']

Expand Down Expand Up @@ -77,6 +90,8 @@ def traverse_plugins (yaml, plugin_configs = None):
rate_limiting(item, plugin_configs)
elif item['name'] == 'proxy-cache':
proxy_cache(item, plugin_configs)
elif item['name'] == 'kong-upstream-jwt':
upstream_jwt(item, plugin_configs)
traverse_plugins (item, plugin_configs)


Expand Down

0 comments on commit a8d80e0

Please sign in to comment.