From 7c97b5936a3fb7af051692f0ac06d008dde50302 Mon Sep 17 00:00:00 2001 From: JMGoldsmith Date: Tue, 12 Nov 2024 14:54:06 +0100 Subject: [PATCH 1/3] remove strings package, add test case, remove lowercasing of username --- builtin/credential/radius/backend_test.go | 3 ++- builtin/credential/radius/path_users.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/credential/radius/backend_test.go b/builtin/credential/radius/backend_test.go index 3c885008422a..3d83f23674ce 100644 --- a/builtin/credential/radius/backend_test.go +++ b/builtin/credential/radius/backend_test.go @@ -185,7 +185,8 @@ func TestBackend_users(t *testing.T) { testStepUpdateUser(t, "web", "foo"), testStepUpdateUser(t, "web2", "foo"), testStepUpdateUser(t, "web3", "foo"), - testStepUserList(t, []string{"web", "web2", "web3"}), + testStepUpdateUser(t, "Web4", "foo"), + testStepUserList(t, []string{"Web4", "web", "web2", "web3"}), }, }) } diff --git a/builtin/credential/radius/path_users.go b/builtin/credential/radius/path_users.go index 21ebd262f0d7..3ba81b792790 100644 --- a/builtin/credential/radius/path_users.go +++ b/builtin/credential/radius/path_users.go @@ -6,7 +6,6 @@ package radius import ( "context" "fmt" - "strings" "github.com/hashicorp/vault/sdk/framework" "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") } - entry, err := s.Get(ctx, "user/"+strings.ToLower(username)) + entry, err := s.Get(ctx, "user/"+username) if err != nil { return nil, err } From 6e7e0e8c9f2881d16c4a317906a5962465500a10 Mon Sep 17 00:00:00 2001 From: JMGoldsmith Date: Tue, 12 Nov 2024 15:13:48 +0100 Subject: [PATCH 2/3] adding changelog --- changelog/28884.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/28884.txt diff --git a/changelog/28884.txt b/changelog/28884.txt new file mode 100644 index 000000000000..c9b064d217f5 --- /dev/null +++ b/changelog/28884.txt @@ -0,0 +1,3 @@ +```release-note:bug +auth/radius: Fixed and issue where upper case items were returning as lower case. +``` \ No newline at end of file From cafd5df5f985aec410b8341d5293922cb0c9f803 Mon Sep 17 00:00:00 2001 From: JMGoldsmith Date: Mon, 18 Nov 2024 12:49:26 +0100 Subject: [PATCH 3/3] Update changelog/28884.txt Co-authored-by: John-Michael Faircloth --- changelog/28884.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/28884.txt b/changelog/28884.txt index c9b064d217f5..3a797146ef65 100644 --- a/changelog/28884.txt +++ b/changelog/28884.txt @@ -1,3 +1,3 @@ ```release-note:bug -auth/radius: Fixed and issue where upper case items were returning as lower case. +auth/radius: Fixed an issue where usernames with upper case characters where not honored ``` \ No newline at end of file