Enable using the userpass client to log in to an ldap backend#161
Open
babbageclunk wants to merge 1 commit into
Open
Enable using the userpass client to log in to an ldap backend#161babbageclunk wants to merge 1 commit into
babbageclunk wants to merge 1 commit into
Conversation
The ldap backend response comes back with `"data": {}` because of this
line:
https://github.com/hashicorp/vault/blob/main/builtin/credential/ldap/backend.go#L121
For the login request `EndpointResult.data` is currently `Option<()>`,
but testing with serde shows that will only accept `"data":
null`. Changing the login response to `HashMap<(), ()>` means
`EndpointResult.data` can be `null` or `{}`.
Collaborator
|
Thanks for submitting this PR. Do you think it will be possible to provide some tests proving that's the LDAP login actually works ? |
Author
|
Ok, I'll look at adding some now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ldap backend login response has
"data": {}because of this line:https://github.com/hashicorp/vault/blob/main/builtin/credential/ldap/backend.go#L121
(This is different from the other backends I looked at, they all use a pattern more like this, so
logical.Response.Datawould always be nil.)When deserializing the login response the type of
EndpointResult.datais currentlyOption<()>, but testing with serde shows that"data": nullis the only value that can be read into that type. Changing the userpass login response type toHashMap<(), ()>allows data to benullor{}, so we can use it to login against an ldap backend.Fixes #104