open-vault/sdk/helper
Rémi Lapeyre d66333f7ac
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
..
authmetadata Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
base62 Swap out sdk/helper libs with implementations in go-secure-stdlib (#12088) 2021-07-15 01:56:37 -04:00
certutil Return names for leaf_not_after_behavior responses (#15336) 2022-05-11 13:12:04 -04:00
cidrutil only check Contains if IP address (#14487) 2022-03-15 09:55:50 -06:00
compressutil reformat using 'make fmt' (#13794) 2022-01-27 10:06:34 -08:00
consts Vault-6037 making filesystem permissions check opt-in (#15452) 2022-05-17 11:34:31 -07:00
cryptoutil Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
dbtxn VAULT-5827 Don't prepare SQL queries before executing them (#15166) 2022-04-26 12:47:06 -07:00
errutil Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
hclutil Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
identitytpl Add Custom metadata field to alias (#12502) 2021-09-17 11:03:47 -07:00
jsonutil Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
kdf reformat using 'make fmt' (#13794) 2022-01-27 10:06:34 -08:00
keysutil Fix a keysutil policy lock (#15447) 2022-05-16 13:00:16 -05:00
ldaputil Fix handling of username_as_alias during LDAP authentication (#15525) 2022-05-20 14:17:26 -07:00
license Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
locksutil Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00
logging Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
mlock Swap out sdk/helper libs with implementations in go-secure-stdlib (#12088) 2021-07-15 01:56:37 -04:00
parseutil Swap out sdk/helper libs with implementations in go-secure-stdlib (#12088) 2021-07-15 01:56:37 -04:00
password Swap out sdk/helper libs with implementations in go-secure-stdlib (#12088) 2021-07-15 01:56:37 -04:00
pathmanager oss port (#12755) 2021-10-07 11:25:16 -06:00
pluginutil Adds Vault version prerelease and metadata to logical.PluginEnvironment (#14851) 2022-04-04 22:31:01 -07:00
pointerutil Add int64 pointerutil (#7973) 2019-12-05 14:02:36 -08:00
policyutil Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
roottoken Add helper for encoding/decoding root tokens and OTP generation in SDK module (#10504) (#10505) 2021-12-01 08:05:49 -05:00
salt Send a test message before committing a new audit device. (#10520) 2020-12-16 16:00:32 -06:00
strutil Swap out sdk/helper libs with implementations in go-secure-stdlib (#12088) 2021-07-15 01:56:37 -04:00
template Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
tlsutil Swap out sdk/helper libs with implementations in go-secure-stdlib (#12088) 2021-07-15 01:56:37 -04:00
tokenutil Migrate to sdk/internalshared libs in go-secure-stdlib (#12090) 2021-07-15 20:17:31 -04:00
useragent sdk/useragent: plugin version string consistent with Vault version string (#14912) 2022-04-05 10:07:33 -07:00
wrapping Expose secret_id_accessor as WrappedAccessor when wrapping secret-id creation. (#12425) 2021-09-16 10:47:49 -07:00
xor Add helper for encoding/decoding root tokens and OTP generation in SDK module (#10504) (#10505) 2021-12-01 08:05:49 -05:00