-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Ability to use "Authorization: WhaTeVer base64(username:password)" #2963
Conversation
Hi, thanks for contributing! Since this PR adds new functionality, according to semantic versioning it should be targeting the next minor version, that is, the I see that this patch also fixes a bug in the pattern-matching of the "LDAP" string, which is a nice side-effect. :) I am a little concerned about constructing the case-insensitive pattern on every access, but this can be mitigated using memoization and a weak table. |
f00198c
to
ae7c3ee
Compare
well, thanks for developping!
that should be fine now
yes, I was surprised that it was not case-insensitive
I thought it wouldn't be an issue on the admin API, but that's not a reason for knowingly degrading perfs. I pushed a second commit that converts to lower case before matching. |
707f82a
to
d5b1f57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you for the updates in the PR!
Prior to #2963, this plugin did an incorrect pattern matching leading it to accept invalid type strings, as long as they ended with the letters in "LDAP". This adds a regression test for that situation.
Adds tests for the functionality introduced in PR #2963.
Make sure we don't match "invalidldap" when searching for "ldap". Prior to #2963, this plugin did an incorrect pattern matching leading it to accept invalid type strings, as long as they ended with the letters in "LDAP". This adds a regression test for that situation. Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
Adds tests for the functionality introduced in PR #2963. Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
Makes the `Authorization` header type configurable. The default remains `LDAP`, but strings such as `Basic` can be used for ease of testing via the browser. Incidentally, this fixes the case-insensitive parsing of the `LDAP` string, which was broken. PR: #2963.
Make sure we don't match "invalidldap" when searching for "ldap". Prior to #2963, this plugin did an incorrect pattern matching leading it to accept invalid type strings, as long as they ended with the letters in "LDAP". This adds a regression test for that situation. Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
Adds tests for the functionality introduced in PR #2963. Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
Makes the `Authorization` header type configurable. The default remains `LDAP`, but strings such as `Basic` can be used for ease of testing via the browser. Incidentally, this fixes the case-insensitive parsing of the `LDAP` string, which was broken. PR: #2963.
Make sure we don't match "invalidldap" when searching for "ldap". Prior to #2963, this plugin did an incorrect pattern matching leading it to accept invalid type strings, as long as they ended with the letters in "LDAP". This adds a regression test for that situation. Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
Adds tests for the functionality introduced in PR #2963. Signed-off-by: Thibault Charbonnier <thibaultcha@me.com>
I just saw the status |
@francois-maillard don't worry, I should have removed that label when you responded last time and I merged it :) |
NOTE: Please read the CONTRIBUTING.md guidelines before submitting your patch,
and ensure you followed them all:
https://github.com/Mashape/kong/blob/master/CONTRIBUTING.md#contributing
Summary
Ability to use
Authorization: WhaTeVer base64(username:password)
has a authorization header for the ldap-auth plugin.In particular, when not using the basic-auth plugin, using
Authorization: Basic base64(username:password)
instead of "Authorization: LDAP base64(username:password)` will allow you to use any client (web browser, curl) without having to fool around the headers manually.Full changelog
Authorization type
you want, such asAuthorization: LDAP base64(username:password)
,Authorization: Basic base64(username:password)
,Authorization: WhaTeVer base64(username:password)
. This can be set through the newconfig.header_type
configuration option for the ldap-auth plugin. Its default value isldap