File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ We maintain high test coverage for the project. When contributing:
48
48
49
49
1 . Ensure your code passes all tests
50
50
2 . Update the README.md if necessary
51
- 3 . Update the version number in ` version.go ` if making a significant change
52
- 4 . Submit your pull request with a clear description of the changes
51
+ 3 . Submit your pull request with a clear description of the changes
53
52
54
53
## Reporting Issues
55
54
@@ -62,10 +61,6 @@ If you find a bug or have a feature request:
62
61
- Expected and actual behavior
63
62
- Environment details (Go version, OS, etc.)
64
63
65
- ## Code of Conduct
66
-
67
- Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
68
-
69
64
## Development Workflow
70
65
71
66
1 . Create a new branch for your feature/fix:
Original file line number Diff line number Diff line change @@ -669,13 +669,23 @@ client := redis.NewClusterClient(&redis.ClusterOptions{
669
669
### Q: How do I implement custom authentication?
670
670
A: You can create a custom identity provider by implementing the ` IdentityProvider ` interface:
671
671
``` go
672
- type CustomProvider struct {
673
- // Your implementation
672
+ // IdentityProviderResponse is an interface that defines the methods for an identity provider authentication result.
673
+ // It is used to get the type of the authentication result, the authentication result itself (can be AuthResult or AccessToken),
674
+ type IdentityProviderResponse interface {
675
+ // Type returns the type of the auth result
676
+ Type () string
677
+ AuthResult () public.AuthResult
678
+ AccessToken () azcore.AccessToken
679
+ RawToken () string
674
680
}
675
681
676
- func (p *CustomProvider ) GetToken (ctx context .Context ) (string , error ) {
677
- // Your token retrieval logic
678
- return " your-token" , nil
682
+ // IdentityProvider is an interface that defines the methods for an identity provider.
683
+ // It is used to request a token for authentication.
684
+ // The identity provider is responsible for providing the raw authentication token.
685
+ type IdentityProvider interface {
686
+ // RequestToken requests a token from the identity provider.
687
+ // It returns the token, the expiration time, and an error if any.
688
+ RequestToken () (IdentityProviderResponse, error )
679
689
}
680
690
```
681
691
You can’t perform that action at this time.
0 commit comments