Skip to content

fix(key-auth): change hide_credentials behaviour #14656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfeledyn
Copy link

Summary

Change key-auth plugin "hide_credentials" parameter behaviour.

Before proposed change, "hide_credentials" parameter of key-auth plugin makes "apikey" parameter removed from both headers and query_string regardless of search locations. This very simple fix allows to remove apikey from query and/or from headers accordingly to search locations.
This is required for me as I have some API backends that rely on a "apikey" value set as header, and the Kong gateway is set to find the "apikey" in query.
Fix:

  • remove parameter in query only if configured to search in query
  • remove parameter in headers only if configured to search in headers

Checklist

Successfully tested.
Code change is obvious and does not require a full test spec.

Issue reference

Key-auth plugin hide_credentials parameter now removes credentials
only in search locations. This allows to use apikey parameter awaited
by Kong in the query string, and preserve another value in apikey
HTTP header for the upstream server. Or vice-versa.

Successfully tested. Code change is obvious.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Mickael Feledyn seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@team-eng-enablement team-eng-enablement added the author/community PRs from the open-source community (not Kong Inc) label Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author/community PRs from the open-source community (not Kong Inc) size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants