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

Fix handling of username_as_alias during LDAP authentication #15525

Merged
merged 7 commits into from May 20, 2022

Commits on May 19, 2022

  1. Fix handling of username_as_alias during LDAP authentication

    There is a bug that was introduced in the LDAP authentication method by hashicorp#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 hashicorp#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.
    remilapeyre committed May 19, 2022
    Configuration menu
    Copy the full SHA
    1bd9e76 View commit details
    Browse the repository at this point in the history
  2. Add changelog

    remilapeyre committed May 19, 2022
    Configuration menu
    Copy the full SHA
    92be303 View commit details
    Browse the repository at this point in the history
  3. Add tests

    remilapeyre committed May 19, 2022
    Configuration menu
    Copy the full SHA
    ac7c85c View commit details
    Browse the repository at this point in the history
  4. Format code

    remilapeyre committed May 19, 2022
    Configuration menu
    Copy the full SHA
    ae7e2e9 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2022

  1. Update builtin/credential/ldap/backend.go

    Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
    remilapeyre and calvn committed May 20, 2022
    Configuration menu
    Copy the full SHA
    04d8cb9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3a713c1 View commit details
    Browse the repository at this point in the history
  3. Reword changelog

    remilapeyre committed May 20, 2022
    Configuration menu
    Copy the full SHA
    a741e0d View commit details
    Browse the repository at this point in the history