Skip to content

Releases: go-pkgz/auth

Version 2.1.1

22 Dec 19:57
fe8d691

Choose a tag to compare

  • #262 fix: set cookies alongside header when SendJWTHeader is enabled
  • #260 fix Content-Type header not being set for error responses
  • #258 upgrade go-pkgz/repeater to v2

Version 2.1.0

04 Dec 00:16
2416d11

Choose a tag to compare

  • #257 update dependencies
  • #256 migrate example from chi to stdlib + routegroup
  • #255 update dependencies and migrate golangci-lint to v2
  • #253 Fix: setAvatar panics when AvatarSaver is a typed nil pointer
  • #247 update README links to v2 and fix line numbers
  • #243 Update all dependencies to address security vulnerabilities
  • #240 Fix golangci-lint v2 reported problems
  • #213 Improve provider name handling

Version 2.0.0

23 Mar 22:53

Choose a tag to compare

We're pleased to announce the release of v2.0.0, a significant update to our authentication library that modernizes the JWT implementation and improves type safety while maintaining API compatibility.

Key Improvements

  • JWT Library Upgrade: Updated to use github.com/golang-jwt/jwt/v5 (from v3)
  • Modern JWT Token Claims:
    • StandardClaims replaced with RegisteredClaims
    • Time fields changed from int64 to *jwt.NumericDate
    • Id field renamed to ID
    • Audience changed from string to string array
  • Improved Type Safety:
    • RefreshCache interface updated with strongly typed values:
      • Get(key string) (value token.Claims, ok bool)
      • Set(key string, value token.Claims)
    • Enhanced type safety across various interfaces and functions

Migration Guide

To migrate from v1 to v2:

  1. Update import paths to use /v2 (e.g., github.com/go-pkgz/auth/v2)
  2. Update any custom code that accesses token fields to use the new structures
  3. If implementing RefreshCache interface, update method signatures

For a real-world migration example, see umputun/remark42#1758.

Core Functionality

All existing functionality remains intact with the same reliable performance:

  • Multiple OAuth2 providers (GitHub, Google, Facebook, Microsoft, Twitter, Yandex, Battle.net, Apple, Patreon, Discord, Telegram)
  • Secure JWT cookies with XSRF protection
  • Direct and verified authentication
  • Avatar proxy with various backend options
  • Role-based access control
  • Highly customizable hooks and middleware

Notable PRs and Commits

  • #223: Added Discord OAuth2 Provider
  • #205: Updated to JWT v5 library
  • #210: Fixed XSRF protections
  • #218: Changed Content-Type to plain text for logout and reset endpoints
  • #215: Fixed race conditions in Telegram auth tests
  • #200: Initial v2 directory structure with modernized JWT implementation

Recommendation

The v2 version is now the actively developed branch, and we recommend using it for all new projects. Version 1.x moves into maintenance mode.

Version 1.25.1

23 Mar 22:44

Choose a tag to compare

What's Changed

  • Bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2 in /v2 by @dependabot in #235
  • Update golangci-lint to v6 and update configuration settings by @paskal in #236
  • Update go modules by @paskal in #237
  • Bump golang.org/x/crypto from 0.14.0 to 0.31.0 in /v2 by @dependabot in #238

Full Changelog: v1.25.0...v1.25.1

Version 1.25.0

24 Feb 17:08

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.24.2...v1.25.0

Version 1.24.2

22 Sep 19:26

Choose a tag to compare

What's Changed

  • Detect and set proper Content-Type for avatars by @paskal in #219

Full Changelog: v1.24.1...v1.24.2

Version 1.24.1

19 Sep 23:47
458e57e

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.24.0...v1.24.1

Version 1.24.0

30 Jul 20:21
533e9f2

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.23.0...v1.24.0

Version 1.23.0

22 Mar 22:46
d60c4b1

Choose a tag to compare

What's Changed

  • Remove bluemonday and fix double-escaping by @david-bezero in #184
  • Rename github.com/nullrocks/identicon to github.com/rrivera/identicon by @avbasov in #192
  • Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 by @dependabot in #198
  • Update go modules, CI actions, fix golangci-lint errors by @paskal in #199

New Contributors

Full Changelog: v1.22.1...v1.23.0

Version 1.22.1

11 Jan 06:39
eb8671b

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.22.0...v1.22.1