Commit Graph

16 Commits

Author SHA1 Message Date
Luis (LT) Carbonell
cc570c11bb
Add Paging Interface for LDAP Connection (#17640) 2022-10-26 14:05:53 -05:00
Rémi Lapeyre
03d923c14c
Fix handling of username_as_alias during LDAP authentication (#15525)
* Fix handling of username_as_alias during LDAP authentication

There is a bug that was introduced in the LDAP authentication method by https://github.com/hashicorp/vault/pull/11000.
It was thought to be backward compatible but has broken a number of users. Later
a new parameter `username_as_alias` was introduced in https://github.com/hashicorp/vault/pull/14324
to make it possible for operators to restore the previous behavior.
The way it is currently working is not completely backward compatible thought
because when username_as_alias is set, a call to GetUserAliasAttributeValue() will
first be made, then this value is completely discarded in pathLogin() and replaced
by the username as expected.

This is an issue because it makes useless calls to the LDAP server and will break
backward compatibility if one of the constraints in GetUserAliasAttributeValue()
is not respected, even though the resulting value will be discarded anyway.

In order to maintain backward compatibility here we have to only call
GetUserAliasAttributeValue() if necessary.

Since this change of behavior was introduced in 1.9, this fix will need to be
backported to the 1.9, 1.10 and 1.11 branches.

* Add changelog

* Add tests

* Format code

* Update builtin/credential/ldap/backend.go

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>

* Format and fix declaration

* Reword changelog

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
2022-05-20 14:17:26 -07:00
Vinny Mannello
eadbe96507
EscapeLDAPValue - catch trailing escape character (#13452)
* [VAULT-4018] - EscapeLDAPValue catch trailing escape character
2021-12-15 13:17:07 -08:00
John-Michael Faircloth
fcc5b4abe1
ensure errors are checked (#12989) 2021-11-01 13:34:51 -05:00
Guillaume
4cc2673651
Added support for a LDAP user search filter. Documentation, tests and UI included (#11000) 2021-10-26 10:39:12 -07:00
Jeff Mitchell
861454e0ed
Migrate to sdk/internalshared libs in go-secure-stdlib (#12090)
* Swap sdk/helper libs to go-secure-stdlib

* Migrate to go-secure-stdlib reloadutil

* Migrate to go-secure-stdlib kv-builder

* Migrate to go-secure-stdlib gatedwriter
2021-07-15 20:17:31 -04:00
Brian Kassouf
2df57a0418
Fix a few static analysis findings (#11307) 2021-04-07 16:48:40 -07:00
ncabatoff
4e7c2ebfb0
Restore the original code used for setting userDN based on the result of our query. (#9041) 2020-05-20 14:47:59 -04:00
Jerry Aldrich
72071016e4
Fix error interpolation in LDAP client (#8426)
Signed-off-by: jerryaldrichiii <jerryaldrichiii@gmail.com>
2020-03-24 13:22:06 -07:00
Jorge Heleno
6eba9c0766
Add LDAP anonymous group search and client certs (#8365) 2020-03-06 10:27:09 -08:00
Michel Vocks
348b04ecb4
Fix ldap client upndomain (#8333) 2020-02-14 10:26:30 -08:00
Becca Petrin
39455f38a8
Avoid potential panic in LDAP client (#8047)
* fix potential panic

* add comment

* vendor the ldap update

* use localhost in test
2019-12-17 16:33:59 -08:00
Calvin Leung Huang
6191cfaf91
sdk/ldaputil: add request_timeout configuration option (#7909)
* sdk/ldaputil: add request_timeout configuration option

* go mod vendor
2019-11-20 11:26:13 -08:00
Jeff Mitchell
82f2b55710 Bump go-ldap
Closes https://github.com/hashicorp/vault/pull/7780

Changes to other parts of Vault have to come piece by piece, that's
next.
2019-11-08 11:18:36 -05:00
Jeff Mitchell
7932afafe2
Port LDAP getCN changes to 1.2 branch (#7209) 2019-07-29 15:43:34 -04:00
Jeff Mitchell
f95571a361 Move ldaputil and tlsutil over to sdk 2019-04-12 18:26:54 -04:00