mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-21 22:51:09 +02:00
Vault 27392 log ldap warning - remove from warning from response (#29134)
* log ldap warnings instead of returning them to end user * add cl * code review * Update changelog/29134.txt Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com> * Update changelog/29134.txt Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com> * fix test --------- Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
This commit is contained in:
parent
035b7e6d8e
commit
f18801693b
@ -121,14 +121,12 @@ func (b *backend) Login(ctx context.Context, req *logical.Request, username stri
|
|||||||
if b.Logger().IsDebug() {
|
if b.Logger().IsDebug() {
|
||||||
b.Logger().Debug(errString)
|
b.Logger().Debug(errString)
|
||||||
}
|
}
|
||||||
ldapResponse.AddWarning(errString)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, warning := range c.Warnings {
|
for _, warning := range c.Warnings {
|
||||||
if b.Logger().IsDebug() {
|
if b.Logger().IsDebug() {
|
||||||
b.Logger().Debug(string(warning))
|
b.Logger().Debug(string(warning))
|
||||||
}
|
}
|
||||||
ldapResponse.AddWarning(string(warning))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var allGroups []string
|
var allGroups []string
|
||||||
|
@ -1183,8 +1183,8 @@ func testAccStepLoginNoGroupDN(t *testing.T, user string, pass string) logicalte
|
|||||||
|
|
||||||
// Verifies a search without defined GroupDN returns a warning rather than failing
|
// Verifies a search without defined GroupDN returns a warning rather than failing
|
||||||
Check: func(resp *logical.Response) error {
|
Check: func(resp *logical.Response) error {
|
||||||
if len(resp.Warnings) != 1 {
|
if len(resp.Warnings) != 0 {
|
||||||
return fmt.Errorf("expected a warning due to no group dn, got: %#v", resp.Warnings)
|
return fmt.Errorf("expected a no warnings, got: %#v", resp.Warnings)
|
||||||
}
|
}
|
||||||
|
|
||||||
return logicaltest.TestCheckAuth([]string{"bar", "default"})(resp)
|
return logicaltest.TestCheckAuth([]string{"bar", "default"})(resp)
|
||||||
|
3
changelog/29134.txt
Normal file
3
changelog/29134.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
```release-note:change
|
||||||
|
auth/ldap: No longer return authentication warnings to client.
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user