Skip to content

Conversation

@developerkunal
Copy link
Contributor

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

🔧 Changes

This PR adds comprehensive documentation and linting configuration for v3:

Documentation Added:

  • doc.go package documentation for all packages:
    • Main package: Architecture overview, quick start, examples
    • core/doc.go: Core-Adapter pattern, context helpers
    • validator/doc.go: JWT validation with jwx v3, supported algorithms
    • jwks/doc.go: JWKS provider configuration and caching
    • internal/oidc/doc.go: OIDC discovery endpoints

Documentation Updated:

  • README.md: Complete v3 API documentation
    • Added working JWT examples with curl commands
    • Updated Go version requirement to 1.24+
    • Included correct import paths
    • Added "Try it out" section with test tokens
  • MIGRATION_GUIDE.md: Complete v2 to v3 migration guide
    • Side-by-side API comparisons
    • Step-by-step migration instructions
    • Updated to reflect v3 API accurately (GetClaimsT usage, no exported ContextKey)

Linting Configuration:

  • .golangci.yml: golangci-lint v2.6.2 configuration
    • 16 linters enabled with appropriate settings
    • Test files excluded from linting
  • .github/workflows/lint.yaml: Updated to use golangci-lint-action v9.1.0 with v2.6.2
  • Makefile: Added golangci-lint v2.6.2 installation target

Code Cleanup:

  • Removed validator/security.go and validator/security_test.go
  • Removed CVE references from all documentation
  • Fixed linting issues: Body.Close error handling, formatting

Types/Functions Changed:

  • No API changes - documentation and configuration only
  • Existing public API remains unchanged

📚 References

🔬 Testing

Test Coverage:

  • Main middleware: 98.2%
  • Core: 100%
  • Validator: 100%
  • JWKS: 100%
  • OIDC: 100%
  • Overall: 99.4%

Linting:

  • Production code: 0 issues
  • Test files: Excluded

Manual Testing:

# Verify linting
make lint

# Verify tests
make test

# Verify examples compile
cd examples/http-example && go build
cd examples/http-jwks-example && go test

# Test JWT from README
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnby1qd3QtbWlkZGxld2FyZS1leGFtcGxlIiwiYXVkIjoiYXVkaWVuY2UtZXhhbXBsZSIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsInVzZXJuYW1lIjoidXNlcjEyMyJ9.XFhrzWzntyINkgoRt2mb8dES84dJcuOoORdzKfwUX70" \
  http://localhost:3000

Verification:

  • All godoc examples are valid Go code
  • JWT tokens in documentation work with examples
  • All examples compile and tests pass

  - Add doc.go files for all packages (main, core, validator, jwks, oidc)
  - Update README.md for v3 API with working JWT examples
  - Update MIGRATION_GUIDE.md with complete v2 to v3 guide
  - Remove CVE-2025-27144 mitigation (handled by jwx v3)
  - Configure golangci-lint v2.6.2 with proper test exclusions
  - Fix JWT token configuration to match working examples
  - Update Go version requirement to 1.24+
  - Fix import paths (github.com/auth0/go-jwt-middleware/v3)
  - Clarify GetClaims[T]() is required (ContextKey no longer exported)
  - Update GitHub Actions to use golangci-lint v2.6.2
  - Update Makefile with lint installation

  Coverage: 99.4% (98.2% main, 100% core/validator/jwks/oidc)
  Linting: 0 issues
@developerkunal developerkunal requested a review from a team as a code owner November 24, 2025 05:12
@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.86%. Comparing base (54615e2) to head (c3e8206).

Additional details and impacted files
@@                         Coverage Diff                          @@
##           v3-phase1-pr5-middleware-options     #361      +/-   ##
====================================================================
- Coverage                             98.88%   98.86%   -0.02%     
====================================================================
  Files                                    13       12       -1     
  Lines                                   718      707      -11     
====================================================================
- Hits                                    710      699      -11     
  Misses                                    4        4              
  Partials                                  4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  - Change version to string format ("2" not 2)
  - Move linter settings from top-level to linters.settings
  - Move exclusions to linters.exclusions with new structure
  - Remove unsupported output fields
  - Update exclusions format (presets, paths, rules)

  Verified with: golangci-lint config verify
@developerkunal developerkunal changed the title docs: add documentation and linting configuration for v3 chore(docs): PR 1.6 add documentation and linting configuration for v3 Nov 24, 2025
developerkunal and others added 3 commits November 24, 2025 11:37
…lidateToken

- Update doc.go with all examples using WithValidator
- Update README.md examples throughout
- Update MIGRATION_GUIDE.md with correct v3 API
- Update option.go comment example
- Align all documentation with the new API that accepts *validator.Validator instances

All documentation now correctly shows the v3 API where middleware
accepts validator instances via WithValidator, enabling future
extensibility for methods like ValidateDPoP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants