Skip to content

Add Entra ID Authentication Support for Redis ( go-redis ) #1

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

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e62008e
Initial Setup - Core Files
ndyakov Mar 24, 2025
9b0b345
Initial Setup - Configuration Files
ndyakov Mar 25, 2025
bdc94c8
Core Interfaces
ndyakov Mar 26, 2025
6c1490b
Testing Infrastructure - Core Setup
ndyakov Mar 27, 2025
49585a7
Identity Provider - Core Interface
ndyakov Mar 28, 2025
62ee78b
Identity Provider - Default Implementation
ndyakov Mar 29, 2025
9219edc
Token Management - Core Interface
ndyakov Mar 30, 2025
d5d0aa8
Token Management - Implementation
ndyakov Mar 31, 2025
c846eb0
Token Listener Implementation
ndyakov Apr 1, 2025
d7b60dd
Credentials Provider - Core Interface
ndyakov Apr 2, 2025
02f9fe1
Configuration - Core Options
ndyakov Apr 3, 2025
e6ee88d
Version Management - Core
ndyakov Apr 4, 2025
8dd60ed
CI/CD - GitHub Actions
ndyakov Apr 5, 2025
49dd82c
CI/CD - Git Hooks
ndyakov Apr 6, 2025
72bd3d7
Documentation - README
ndyakov Apr 7, 2025
52a8be5
Documentation - Contributing Guide
ndyakov Apr 8, 2025
02d53c9
Version Management - Tests
ndyakov Apr 9, 2025
3bf1fa9
Identity Provider Tests
ndyakov Apr 10, 2025
e0d0879
Token Listener Tests
ndyakov Apr 11, 2025
305fcaf
Fix flaky test
ndyakov Apr 12, 2025
bf65058
improve credentials provider
ndyakov Apr 12, 2025
43a2779
add more tests
ndyakov Apr 14, 2025
e05c56c
refactor tests
ndyakov Apr 14, 2025
89b83e6
improve answer in readme
ndyakov Apr 15, 2025
9d087bc
export shared types
ndyakov Apr 15, 2025
217097d
Address PR comments related to token tests
ndyakov Apr 15, 2025
87f7d84
add deadlock test
ndyakov Apr 16, 2025
2a286c6
Address PR comments, refactor
ndyakov Apr 16, 2025
07ab789
Update documentation and RetryOptions
ndyakov Apr 16, 2025
7ad6674
close the context when token manager is stopped
ndyakov Apr 16, 2025
2631968
update go.mod go.sum
ndyakov Apr 16, 2025
1fca220
Update identity/confidential_identity_provider.go
ndyakov Apr 17, 2025
22dc6ae
Change IdentityProviderResponse interface
ndyakov Apr 17, 2025
15c4d5d
Update Readme.md
ndyakov Apr 17, 2025
f493bda
refactor(response)!: getters will return err
ndyakov Apr 24, 2025
aba78bf
chore(comments): Updated some comments
ndyakov Apr 28, 2025
76cefcc
fix(manager): requestTimeout and parser
ndyakov Apr 28, 2025
3b9fcb7
refactor(manager)!: remove Stop method
ndyakov Apr 28, 2025
57e500d
refactor(tokenparser): simplify default parser
ndyakov Apr 28, 2025
7755fb9
test(parser): add additional tests for bad token
ndyakov Apr 28, 2025
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
4 changes: 4 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

goimports -l -w . # includes go fmt
golangci-lint run # includes golint, go vet
49 changes: 49 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Benchmark Performance
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "stable"
- name: Install dependencies
run: go mod tidy
- name: Run benchmark
run: go test ./... -bench=. -benchmem -count 2 -timeout 1m | tee benchmarks.txt
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Go Benchmark
tool: 'go'
output-file-path: benchmarks.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@ndyakov'
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install dependencies
run: go mod tidy
- name: Run tests with coverage
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
run: go test ./... -coverprofile=./cover.out -covermode=atomic -race -count 2 -timeout 5m
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
*.tar.gz
*.dic
coverage.txt
cover.out
**/coverage.txt
**/cover.out
.vscode
tmp/
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "2"
run:
tests: false
linters:
disable:
- depguard

12 changes: 6 additions & 6 deletions .testcoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ profile: cover.out
threshold:
# (optional; default 0)
# Minimum coverage percentage required for individual files.
file: 70
file: 85

# (optional; default 0)
# Minimum coverage percentage required for each package.
package: 80
package: 85

# (optional; default 0)
# Minimum overall project coverage percentage required.
total: 95
total: 90

# Holds regexp rules which will override thresholds for matched files or packages
# using their paths.
Expand All @@ -28,9 +28,9 @@ threshold:
# new threshold to it. If project has multiple rules that match same path,
# override rules should be listed in order from specific to more general rules.
override:
# Increase coverage threshold to 100% for `foo` package
# (default is 80, as configured above in this example).
- path: ^pkg/lib/foo$
- path: ^internal$
threshold: 95
- path: ^token$
threshold: 100

# Holds regexp rules which will exclude matched files or packages
Expand Down
103 changes: 103 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Contributing to go-redis-entraid

We welcome contributions from the community! If you'd like to contribute to this project, please follow these guidelines:

## Getting Started

1. Fork the repository
2. Create a new branch for your feature or bugfix
3. Make your changes
4. Run the tests and ensure they pass
5. Submit a pull request

## Development Setup

```bash
# Clone your fork
git clone https://github.com/your-username/go-redis-entraid.git
cd go-redis-entraid

# Install dependencies
go mod download

# Run tests
go test ./...
```

## Code Style and Standards

- Follow the Go standard formatting (`go fmt`)
- Write clear and concise commit messages
- Include tests for new features
- Update documentation as needed
- Follow the existing code style and patterns

## Testing

We maintain high test coverage for the project. When contributing:

- Add tests for new features
- Ensure existing tests pass
- Run the test coverage tool:
```bash
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out
```

## Pull Request Process

1. Ensure your code passes all tests
2. Update the README.md if necessary
3. Submit your pull request with a clear description of the changes

## Reporting Issues

If you find a bug or have a feature request:

1. Check the existing issues to avoid duplicates
2. Create a new issue with:
- A clear title and description
- Steps to reproduce (for bugs)
- Expected and actual behavior
- Environment details (Go version, OS, etc.)

## Development Workflow

1. Create a new branch for your feature/fix:
```bash
git checkout -b feature/your-feature-name
```

2. Make your changes and commit them:
```bash
git add .
git commit -m "Description of your changes"
```

3. Push your changes to your fork:
```bash
git push origin feature/your-feature-name
```

4. Create a pull request from your fork to the main repository

## Review Process

- All pull requests will be reviewed by maintainers
- Be prepared to make changes based on feedback
- Ensure your code meets the project's standards
- Address any CI/CD failures

## Documentation

- Update relevant documentation when making changes
- Include examples for new features
- Update the README if necessary
- Add comments to complex code sections

## Questions?

If you have any questions about contributing, please:
1. Check the existing documentation
2. Look through existing issues
3. Create a new issue if your question hasn't been answered
Loading
Loading