Skip to content

chore(deps): update dependencies #5

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

Merged
merged 4 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

test.ci:
go test ./... -coverprofile=./cover.out -covermode=atomic -race -count 2 -timeout 5m

test:
go test ./... -coverprofile=./cover.out -covermode=atomic -race -count 1
go test ./... -bench=. -benchmem -count 1 -timeout 1m
41 changes: 41 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# v1.0.0

## Introduction

We are excited to announce the General Availability release of **go-redis-entraid**, a Go library that enables seamless Entra ID (formerly Azure AD) authentication for Redis Enterprise Cloud.

## Background

Redis Enterprise Cloud supports Microsoft Entra ID for authentication, allowing you to use your organization's existing identity management system to control access to Redis databases. The go-redis-entraid library bridges the gap between the popular [go-redis](https://github.com/redis/go-redis) client and Entra ID, providing:

- Automatic token acquisition and renewal
- Support for multiple authentication mechanisms
- Seamless integration with existing Redis applications
- Secure credential management

## Key Features

- **Multiple Authentication Methods**: Support for various Entra ID authentication flows:
- Client Secret
- Client Certificate
- Managed Identity (System and User-assigned)
- Default Azure Identity Provider (for local development)

- **Automatic Token Management**: Handles token acquisition, caching, and renewal without requiring manual intervention.

- **Configuration Flexibility**: Supports configuration through environment variables, code, or configuration files.

- **Comprehensive Error Handling**: Detailed error information and recovery strategies.

## Getting Started

### Installation

```bash
go get github.com/redis/[email protected]
```

## Compatibility

- Go: 1.16+
- go-redis: v9.9.0+
2 changes: 1 addition & 1 deletion entraid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ func (m *mockTokenManager) stop() error {
}
if m.done != nil {
close(m.done)
m.done = nil
}
return nil
}
Expand All @@ -196,6 +195,7 @@ func mockTokenManagerLoop(mtm *mockTokenManager, tokenExpiration time.Duration,
for {
select {
case <-mtm.done:
mtm.done = nil
return
case <-time.After(tokenExpiration):
mtm.lock.Lock()
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_idp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module custom_example
go 1.23.4

require (
github.com/redis/go-redis-entraid v0.0.0-20250415111332-9d087bc29c12
github.com/redis/go-redis/v9 v9.5.3-0.20250415103233-40a89c56cc52
github.com/redis/go-redis-entraid v1.0.0
github.com/redis/go-redis/v9 v9.9.0
)

require (
Expand Down
2 changes: 2 additions & 0 deletions examples/custom_idp/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis-entraid v0.0.0-20250415111332-9d087bc29c12 h1:H5ZfgueBAxs2eAvXtCMEbT2/fLQz/wxW5Ds4c0uzl50=
github.com/redis/go-redis-entraid v0.0.0-20250415111332-9d087bc29c12/go.mod h1:uXKLxCMUAu1VKgWdt8gWc4PWCygiL2pAI5XpnRSVc0w=
github.com/redis/go-redis-entraid v1.0.0/go.mod h1:b+YPtHM3oFJ74Y2eFHPuz1Cp59kUL0fwdiARp27VW8Q=
github.com/redis/go-redis/v9 v9.5.3-0.20250415103233-40a89c56cc52 h1:jRx2gINoJsGKxi/RYXCq1VneAAYes9JxUp13xH2oU2g=
github.com/redis/go-redis/v9 v9.5.3-0.20250415103233-40a89c56cc52/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
Expand Down
9 changes: 6 additions & 3 deletions examples/custom_idp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type FakeIdentityProvider struct {

// RequestToken simulates a request to an identity provider and returns a fake token.
// In a real implementation, this would involve making a network request to the identity provider.
func (f *FakeIdentityProvider) RequestToken() (entraid.IdentityProviderResponse, error) {
func (f *FakeIdentityProvider) RequestToken(_ context.Context) (entraid.IdentityProviderResponse, error) {
// Simulate a successful token request
return shared.NewIDPResponse(
shared.ResponseTypeRawToken,
Expand All @@ -72,7 +72,10 @@ type fakeIdentityProviderResponseParser struct {
// ParseResponse simulates the parsing of a response from an identity provider.
func (f *fakeIdentityProviderResponseParser) ParseResponse(response entraid.IdentityProviderResponse) (*token.Token, error) {
if response.Type() == shared.ResponseTypeRawToken {
rawToken := response.RawToken()
rawToken, err := response.RawToken()
if err != nil {
return nil, fmt.Errorf("failed to get raw token: %w", err)
}
username, password := "", ""
var expiresOnUnix int64

Expand All @@ -85,7 +88,7 @@ func (f *fakeIdentityProviderResponseParser) ParseResponse(response entraid.Iden
}
username = parts[0]
password = parts[1]
expiresOnUnix, err := strconv.ParseInt(parts[2], 10, 64)
expiresOnUnix, err = strconv.ParseInt(parts[2], 10, 64)
if err != nil {
return nil, fmt.Errorf("failed to parse raw token: %w", err)
}
Expand Down
5 changes: 2 additions & 3 deletions examples/entraid/clientcert/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.23.4

require (
config v0.0.0
github.com/redis/go-redis-entraid v0.0.0-20250519132904-1e25b29e9a07
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
github.com/redis/go-redis-entraid latest
github.com/redis/go-redis/v9 latest
)

require (
Expand All @@ -28,5 +28,4 @@ require (
replace (
config => ../config
github.com/redis/go-redis-entraid => ../../../
github.com/redis/go-redis/v9 => github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
)
1 change: 1 addition & 0 deletions examples/entraid/clientcert/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b h1:I6Y+sXfQLIUo8vkx+EcuTcAcs0ZnPceNe8cdQ0HsjQI=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
Expand Down
5 changes: 2 additions & 3 deletions examples/entraid/clientsecret/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ go 1.23.4

require (
config v0.0.0
github.com/redis/go-redis-entraid v0.0.0-20250519132904-1e25b29e9a07
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
github.com/redis/go-redis-entraid latest
github.com/redis/go-redis/v9 latest
)

replace (
config => ../config
github.com/redis/go-redis-entraid => ../../../
github.com/redis/go-redis/v9 => github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
)

require (
Expand Down
4 changes: 2 additions & 2 deletions examples/entraid/clientsecret/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b h1:I6Y+sXfQLIUo8vkx+EcuTcAcs0ZnPceNe8cdQ0HsjQI=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/redis/go-redis/v9 v9.9.0 h1:URbPQ4xVQSQhZ27WMQVmZSo3uT3pL+4IdHVcYq2nVfM=
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
Expand Down
5 changes: 2 additions & 3 deletions examples/entraid/defaultcredentials/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.23.4

require (
config v0.0.0
github.com/redis/go-redis-entraid v0.0.0-00010101000000-000000000000
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
github.com/redis/go-redis-entraid latest
github.com/redis/go-redis/v9 latest
)

require (
Expand All @@ -28,5 +28,4 @@ require (
replace (
config => ../config
github.com/redis/go-redis-entraid => ../../../
github.com/redis/go-redis/v9 => github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
)
1 change: 1 addition & 0 deletions examples/entraid/defaultcredentials/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b h1:I6Y+sXfQLIUo8vkx+EcuTcAcs0ZnPceNe8cdQ0HsjQI=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
Expand Down
5 changes: 2 additions & 3 deletions examples/entraid/managedidentity_systemassigned/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ go 1.23.4

require (
config v0.0.0
github.com/redis/go-redis-entraid v0.0.0-20250519132904-1e25b29e9a07
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
github.com/redis/go-redis-entraid latest
github.com/redis/go-redis/v9 latest
)

replace (
config => ../config
github.com/redis/go-redis-entraid => ../../../
github.com/redis/go-redis/v9 => github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
)

require (
Expand Down
1 change: 1 addition & 0 deletions examples/entraid/managedidentity_systemassigned/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b h1:I6Y+sXfQLIUo8vkx+EcuTcAcs0ZnPceNe8cdQ0HsjQI=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
Expand Down
5 changes: 2 additions & 3 deletions examples/entraid/managedidentity_userassigned/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ go 1.23.4

require (
config v0.0.0
github.com/redis/go-redis-entraid v0.0.0-20250519132904-1e25b29e9a07
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
github.com/redis/go-redis-entraid latest
github.com/redis/go-redis/v9 latest
)

replace (
config => ../config
github.com/redis/go-redis-entraid => ../../../
github.com/redis/go-redis/v9 => github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
)

require (
Expand Down
1 change: 1 addition & 0 deletions examples/entraid/managedidentity_userassigned/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b h1:I6Y+sXfQLIUo8vkx+EcuTcAcs0ZnPceNe8cdQ0HsjQI=
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
Expand Down
1 change: 1 addition & 0 deletions examples/entraid/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ run_example() {
fi

pushd "$example_dir" > /dev/null
go get github.com/redis/go-redis/v9@master
go mod tidy
if ! go run main.go; then
echo "Error: $example_dir example failed"
Expand Down
33 changes: 16 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
module github.com/redis/go-redis-entraid

go 1.18
go 1.23.0

toolchain go1.23.4

require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0-beta.1
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.0
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/redis/go-redis/v9 v9.9.0
github.com/stretchr/testify v1.10.0
)

require (
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/uuid v1.6.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
golang.org/x/crypto v0.38.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading