Skip to content

Commit 50c261b

Browse files
authored
chore(deps): update dependencies (#5)
* chore(examples): update dependencies Add release notes * chore(deps): Update package dependencies * chore(makefile): Add makefile for tests Add Makefile to reproduce the test commands used in the CI. A better approach for the future would be to use the exact makefile in the CI pipelines. * chore(deps): Update deps and go version It turns out that the x/crypto with the security fixes requires go 1.23 anyway.
1 parent 0edba99 commit 50c261b

File tree

19 files changed

+123
-62
lines changed

19 files changed

+123
-62
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
test.ci:
3+
go test ./... -coverprofile=./cover.out -covermode=atomic -race -count 2 -timeout 5m
4+
5+
test:
6+
go test ./... -coverprofile=./cover.out -covermode=atomic -race -count 1
7+
go test ./... -bench=. -benchmem -count 1 -timeout 1m

RELEASE_NOTES.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# v1.0.0
2+
3+
## Introduction
4+
5+
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.
6+
7+
## Background
8+
9+
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:
10+
11+
- Automatic token acquisition and renewal
12+
- Support for multiple authentication mechanisms
13+
- Seamless integration with existing Redis applications
14+
- Secure credential management
15+
16+
## Key Features
17+
18+
- **Multiple Authentication Methods**: Support for various Entra ID authentication flows:
19+
- Client Secret
20+
- Client Certificate
21+
- Managed Identity (System and User-assigned)
22+
- Default Azure Identity Provider (for local development)
23+
24+
- **Automatic Token Management**: Handles token acquisition, caching, and renewal without requiring manual intervention.
25+
26+
- **Configuration Flexibility**: Supports configuration through environment variables, code, or configuration files.
27+
28+
- **Comprehensive Error Handling**: Detailed error information and recovery strategies.
29+
30+
## Getting Started
31+
32+
### Installation
33+
34+
```bash
35+
go get github.com/redis/[email protected]
36+
```
37+
38+
## Compatibility
39+
40+
- Go: 1.16+
41+
- go-redis: v9.9.0+

entraid_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ func (m *mockTokenManager) stop() error {
174174
}
175175
if m.done != nil {
176176
close(m.done)
177-
m.done = nil
178177
}
179178
return nil
180179
}
@@ -196,6 +195,7 @@ func mockTokenManagerLoop(mtm *mockTokenManager, tokenExpiration time.Duration,
196195
for {
197196
select {
198197
case <-mtm.done:
198+
mtm.done = nil
199199
return
200200
case <-time.After(tokenExpiration):
201201
mtm.lock.Lock()

examples/custom_idp/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module custom_example
33
go 1.23.4
44

55
require (
6-
github.com/redis/go-redis-entraid v0.0.0-20250415111332-9d087bc29c12
7-
github.com/redis/go-redis/v9 v9.5.3-0.20250415103233-40a89c56cc52
6+
github.com/redis/go-redis-entraid v1.0.0
7+
github.com/redis/go-redis/v9 v9.9.0
88
)
99

1010
require (

examples/custom_idp/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3434
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3535
github.com/redis/go-redis-entraid v0.0.0-20250415111332-9d087bc29c12 h1:H5ZfgueBAxs2eAvXtCMEbT2/fLQz/wxW5Ds4c0uzl50=
3636
github.com/redis/go-redis-entraid v0.0.0-20250415111332-9d087bc29c12/go.mod h1:uXKLxCMUAu1VKgWdt8gWc4PWCygiL2pAI5XpnRSVc0w=
37+
github.com/redis/go-redis-entraid v1.0.0/go.mod h1:b+YPtHM3oFJ74Y2eFHPuz1Cp59kUL0fwdiARp27VW8Q=
3738
github.com/redis/go-redis/v9 v9.5.3-0.20250415103233-40a89c56cc52 h1:jRx2gINoJsGKxi/RYXCq1VneAAYes9JxUp13xH2oU2g=
3839
github.com/redis/go-redis/v9 v9.5.3-0.20250415103233-40a89c56cc52/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
40+
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
3941
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
4042
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
4143
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=

examples/custom_idp/main.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type FakeIdentityProvider struct {
5050

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

@@ -85,7 +88,7 @@ func (f *fakeIdentityProviderResponseParser) ParseResponse(response entraid.Iden
8588
}
8689
username = parts[0]
8790
password = parts[1]
88-
expiresOnUnix, err := strconv.ParseInt(parts[2], 10, 64)
91+
expiresOnUnix, err = strconv.ParseInt(parts[2], 10, 64)
8992
if err != nil {
9093
return nil, fmt.Errorf("failed to parse raw token: %w", err)
9194
}

examples/entraid/clientcert/go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.23.4
44

55
require (
66
config v0.0.0
7-
github.com/redis/go-redis-entraid v0.0.0-20250519132904-1e25b29e9a07
8-
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
7+
github.com/redis/go-redis-entraid latest
8+
github.com/redis/go-redis/v9 latest
99
)
1010

1111
require (
@@ -28,5 +28,4 @@ require (
2828
replace (
2929
config => ../config
3030
github.com/redis/go-redis-entraid => ../../../
31-
github.com/redis/go-redis/v9 => github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
3231
)

examples/entraid/clientcert/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3434
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3535
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b h1:I6Y+sXfQLIUo8vkx+EcuTcAcs0ZnPceNe8cdQ0HsjQI=
3636
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
37+
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
3738
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
3839
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
3940
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=

examples/entraid/clientsecret/go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ go 1.23.4
44

55
require (
66
config v0.0.0
7-
github.com/redis/go-redis-entraid v0.0.0-20250519132904-1e25b29e9a07
8-
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
7+
github.com/redis/go-redis-entraid latest
8+
github.com/redis/go-redis/v9 latest
99
)
1010

1111
replace (
1212
config => ../config
1313
github.com/redis/go-redis-entraid => ../../../
14-
github.com/redis/go-redis/v9 => github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b
1514
)
1615

1716
require (

examples/entraid/clientsecret/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd
3232
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
3333
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
3434
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
35-
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b h1:I6Y+sXfQLIUo8vkx+EcuTcAcs0ZnPceNe8cdQ0HsjQI=
36-
github.com/redis/go-redis/v9 v9.5.3-0.20250519143649-1628b87c162b/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
35+
github.com/redis/go-redis/v9 v9.9.0 h1:URbPQ4xVQSQhZ27WMQVmZSo3uT3pL+4IdHVcYq2nVfM=
36+
github.com/redis/go-redis/v9 v9.9.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
3737
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
3838
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
3939
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=

0 commit comments

Comments
 (0)