Skip to content

Commit 69e9b7c

Browse files
Apply suggestions from code review
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
1 parent ea33034 commit 69e9b7c

File tree

1 file changed

+22
-24
lines changed
  • content/develop/clients/go

1 file changed

+22
-24
lines changed

content/develop/clients/go/amr.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ letting `go-redis-entraid` fetch and renew the authentication tokens for you aut
2929
Install [`go-redis`]({{< relref "/develop/clients/go" >}}) if you
3030
have not already done so.
3131

32-
From a Go module folder, install `go-redis-entraid` with the
32+
Install `go-redis-entraid` with the
3333
following command:
3434

3535
```bash
36-
go get github.com/redis-developer/go-redis-entraid
36+
go get github.com/redis/go-redis-entraid
3737
```
3838

3939
## Create a `StreamingCredentialsProvider` instance
@@ -84,16 +84,16 @@ import (
8484
.
8585
provider, err := entraid.NewConfidentialCredentialsProvider(
8686
entraid.ConfidentialIdentityProviderOptions{
87-
CredentialsProviderOptions: entraid.CredentialsProviderOptions{
88-
ClientID: "<your-azure-client-id>",
89-
},
90-
CredentialsType: identity.ClientSecretCredentialType,
91-
ClientSecret: "<your-azure-client-secret>",
92-
Authority: identity.AuthorityConfiguration{
93-
AuthorityType: identity.AuthorityTypeDefault,
94-
TenantID: "<your-azure-tenant-id>",
95-
},
96-
}
87+
ConfidentialIdentityProviderOptions: identity.ConfidentialIdentityProviderOptions{
88+
ClientID: "<your-azure-client-id>",
89+
ClientSecret: "<your-azure-client-secret>",
90+
CredentialsType: identity.ClientSecretCredentialType,
91+
Authority: identity.AuthorityConfiguration{
92+
AuthorityType: identity.AuthorityTypeDefault,
93+
TenantID: "<your-azure-tenant-id>",
94+
},
95+
},
96+
},
9797
)
9898
```
9999

@@ -118,13 +118,12 @@ import (
118118
.
119119
.
120120
provider, err := entraid.NewManagedIdentityCredentialsProvider(
121-
entraid.ManagedIdentityCredentialsProviderOptions{
122-
CredentialsProviderOptions: entraid.CredentialsProviderOptions{
123-
ClientID: "<your-azure-client-id>",
124-
},
125-
ManagedIdentityType: identity.UserAssignedIdentity,
126-
UserAssignedClientID: "<your-user-assigned-client-id>",
127-
},
121+
entraid.ManagedIdentityCredentialsProviderOptions{
122+
ManagedIdentityProviderOptions: identity.ManagedIdentityProviderOptions{
123+
ManagedIdentityType: identity.UserAssignedObjectID,
124+
UserAssignedObjectID: "<your-user-assigned-client-id>",
125+
},
126+
},
128127
)
129128
```
130129

@@ -135,7 +134,6 @@ configuration using the `TokenManagerOptions` field of `CredentialsProviderOptio
135134

136135
```go
137136
options := entraid.CredentialsProviderOptions{
138-
ClientID: os.Getenv("AZURE_CLIENT_ID"),
139137
TokenManagerOptions: manager.TokenManagerOptions{
140138
ExpirationRefreshRatio: 0.7,
141139
LowerRefreshBounds: 10000,
@@ -213,12 +211,12 @@ func main() {
213211
)
214212
}
215213

216-
// Create credentials provider
214+
// Create credentials provider for system assigned identity
217215
provider, err := entraid.NewManagedIdentityCredentialsProvider(
218216
entraid.ManagedIdentityCredentialsProviderOptions{
219-
CredentialsProviderOptions: entraid.CredentialsProviderOptions{
220-
ClientID: clientID,
221-
},
217+
ManagedIdentityProviderOptions: identity.ManagedIdentityProviderOptions{
218+
ManagedIdentityType: identity.SystemAssignedIdentity,
219+
},
222220
}
223221
)
224222
if err != nil {

0 commit comments

Comments
 (0)