Skip to content
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

feat: Add ldap-auth plugin #3894

Merged
merged 34 commits into from
Oct 13, 2021
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a5d1ab9
add lualdap
jp-gouin Mar 16, 2021
2e2ffb0
add ldap plugin
jp-gouin Mar 16, 2021
6cfe4cd
add ldap plugin
jp-gouin Mar 16, 2021
7b01646
add ldap plugin
jp-gouin Mar 16, 2021
979e46b
add ldap-auth plugin , add test case , need to debug the test case
jp-gouin Mar 23, 2021
d46d980
correct typo
jp-gouin Mar 23, 2021
fad0827
update of readme and test case
jp-gouin Mar 23, 2021
d410f56
add test cases for ldap-auth plugin, update travis to deploy openldap…
jp-gouin Apr 6, 2021
8a43bc3
resolve merge conflict
jp-gouin Apr 6, 2021
6c29529
resolve merge conflict
jp-gouin Apr 6, 2021
3946036
remove trailing space, use libldap libldap-2.4-2
jp-gouin Apr 6, 2021
b67b69d
change libldap to libldap2-dev to avoid error upon lualdap installation
jp-gouin Apr 6, 2021
47d30e1
resolve merge conflicts
jp-gouin Aug 21, 2021
0bbc7e4
Merge branch 'apache-master' into master
jp-gouin Aug 21, 2021
c178e17
Add dependency openldap-devel or libldap2-dev for CI.
jp-gouin Aug 22, 2021
bb2ccfd
mispelling in ldap-auth
jp-gouin Aug 22, 2021
cb8cb6f
remove unused variable
jp-gouin Aug 22, 2021
48870cb
add libldap2-dev in Linux Get dependencies step
jp-gouin Aug 22, 2021
a2ceb94
update admin/plugins test cases 1 and 9 to include ldap-auth
jp-gouin Sep 14, 2021
7d10e1e
patch error when linking label to versionDB , the new api of harbor i…
jp-gouin Sep 14, 2021
558f8a8
update admin/plugins test cases 1 to include ldap-auth at the right p…
jp-gouin Sep 14, 2021
66b69a7
Merge branch 'master' of github.com:jp-gouin/apisix into master
jp-gouin Sep 14, 2021
078f628
change require style to match existing requirs , remove additionalPro…
jp-gouin Sep 18, 2021
23253f4
change require style to match existing requirs , remove additionalPro…
jp-gouin Sep 18, 2021
33fc909
remove additionalProperties from test case
jp-gouin Sep 19, 2021
89f8d6a
Add openldap reference in the install-dependencies.md, add sub foncti…
jp-gouin Oct 2, 2021
15cf6ee
resolve merge conflict
jp-gouin Oct 2, 2021
9c87c10
remove trailing space, reindex test case
jp-gouin Oct 2, 2021
9663476
add verification on extract_header, remove reference to apisix dashbo…
jp-gouin Oct 4, 2021
abe1090
revert wrong commit, add check on extract_header
jp-gouin Oct 4, 2021
10a4d87
remove unnecessary check
jp-gouin Oct 4, 2021
8ab4df8
commit change per review
jp-gouin Oct 10, 2021
79b01a6
add libldap2-dev dependency in .github/workflows/cli.yml
jp-gouin Oct 10, 2021
78032ba
remove unexisting err from ngx.decode_base64(m[1])
jp-gouin Oct 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apisix/plugins/ldap-auth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ local function extract_auth_header(authorization)

local decoded, err = ngx.decode_base64(m[1])

if err then
return nil, "failed to decode authentication header"
if not decoded or err then
return nil, "failed to decode authentication header: " .. m[1]
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not decoded then
        return nil, "failed to decode authentication header: " .. m[1]
end


local res
Expand All @@ -106,7 +106,7 @@ local function extract_auth_header(authorization)
return nil, "split authorization err:" .. err
end
if #res < 2 then
return nil, "split authorization length is invalid"
return nil, "split authorization err: invalid decoded data: " .. decoded
end

obj.username = ngx.re.gsub(res[1], "\\s+", "", "jo")
Expand Down