Skip to content

Commit 2613976

Browse files
committed
update documentation
1 parent 818339b commit 2613976

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ We maintain high test coverage for the project. When contributing:
4848

4949
1. Ensure your code passes all tests
5050
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
5352

5453
## Reporting Issues
5554

@@ -62,10 +61,6 @@ If you find a bug or have a feature request:
6261
- Expected and actual behavior
6362
- Environment details (Go version, OS, etc.)
6463

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-
6964
## Development Workflow
7065

7166
1. Create a new branch for your feature/fix:

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,13 +669,23 @@ client := redis.NewClusterClient(&redis.ClusterOptions{
669669
### Q: How do I implement custom authentication?
670670
A: You can create a custom identity provider by implementing the `IdentityProvider` interface:
671671
```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
674680
}
675681

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)
679689
}
680690
```
681691

0 commit comments

Comments
 (0)