VAULT-31525 Remove lowercasing of RADIUS auth. (#28884)

* remove strings package, add test case, remove lowercasing of username

* adding changelog

* Update changelog/28884.txt

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>

---------

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
This commit is contained in:
JMGoldsmith
2024-11-22 10:25:25 +01:00
committed by GitHub
parent 3bce8d385e
commit b9d0b7aeb4
3 changed files with 6 additions and 3 deletions

View File

@@ -185,7 +185,8 @@ func TestBackend_users(t *testing.T) {
testStepUpdateUser(t, "web", "foo"), testStepUpdateUser(t, "web", "foo"),
testStepUpdateUser(t, "web2", "foo"), testStepUpdateUser(t, "web2", "foo"),
testStepUpdateUser(t, "web3", "foo"), testStepUpdateUser(t, "web3", "foo"),
testStepUserList(t, []string{"web", "web2", "web3"}), testStepUpdateUser(t, "Web4", "foo"),
testStepUserList(t, []string{"Web4", "web", "web2", "web3"}),
}, },
}) })
} }

View File

@@ -6,7 +6,6 @@ package radius
import ( import (
"context" "context"
"fmt" "fmt"
"strings"
"github.com/hashicorp/vault/sdk/framework" "github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/helper/policyutil" "github.com/hashicorp/vault/sdk/helper/policyutil"
@@ -87,7 +86,7 @@ func (b *backend) user(ctx context.Context, s logical.Storage, username string)
return nil, fmt.Errorf("missing username") return nil, fmt.Errorf("missing username")
} }
entry, err := s.Get(ctx, "user/"+strings.ToLower(username)) entry, err := s.Get(ctx, "user/"+username)
if err != nil { if err != nil {
return nil, err return nil, err
} }

3
changelog/28884.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
auth/radius: Fixed an issue where usernames with upper case characters where not honored
```