diff --git a/backend/app/cmd/avatar.go b/backend/app/cmd/avatar.go index 3baa4185..d5a91427 100644 --- a/backend/app/cmd/avatar.go +++ b/backend/app/cmd/avatar.go @@ -7,7 +7,7 @@ import ( log "github.com/go-pkgz/lgr" bolt "go.etcd.io/bbolt" - "github.com/go-pkgz/auth/avatar" + "github.com/go-pkgz/auth/v2/avatar" ) // AvatarCommand set of flags and command for avatar migration diff --git a/backend/app/cmd/avatar_test.go b/backend/app/cmd/avatar_test.go index 551ed6d7..a2bc7673 100644 --- a/backend/app/cmd/avatar_test.go +++ b/backend/app/cmd/avatar_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/go-pkgz/auth/avatar" + "github.com/go-pkgz/auth/v2/avatar" "github.com/jessevdk/go-flags" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/backend/app/cmd/server.go b/backend/app/cmd/server.go index 990d359e..42c9b3f3 100644 --- a/backend/app/cmd/server.go +++ b/backend/app/cmd/server.go @@ -23,11 +23,11 @@ import ( "github.com/kyokomi/emoji/v2" bolt "go.etcd.io/bbolt" - "github.com/go-pkgz/auth" - "github.com/go-pkgz/auth/avatar" - "github.com/go-pkgz/auth/provider" - "github.com/go-pkgz/auth/provider/sender" - "github.com/go-pkgz/auth/token" + "github.com/go-pkgz/auth/v2" + "github.com/go-pkgz/auth/v2/avatar" + "github.com/go-pkgz/auth/v2/provider" + "github.com/go-pkgz/auth/v2/provider/sender" + "github.com/go-pkgz/auth/v2/token" cache "github.com/go-pkgz/lcw/v2" "github.com/umputun/remark42/backend/app/migrator" @@ -1355,11 +1355,11 @@ func newAuthRefreshCache() *authRefreshCache { } // Get implements cache getter with key converted to string -func (c *authRefreshCache) Get(key interface{}) (interface{}, bool) { - return c.LoadingCache.Peek(key.(string)) +func (c *authRefreshCache) Get(key string) (token.Claims, bool) { + return c.LoadingCache.Peek(key) } // Set implements cache setter with key converted to string -func (c *authRefreshCache) Set(key, value interface{}) { - _, _ = c.LoadingCache.Get(key.(string), func() (token.Claims, error) { return value.(token.Claims), nil }) +func (c *authRefreshCache) Set(key string, value token.Claims) { + _, _ = c.LoadingCache.Get(key, func() (token.Claims, error) { return value, nil }) } diff --git a/backend/app/cmd/server_test.go b/backend/app/cmd/server_test.go index 251189ff..bc13ba9e 100644 --- a/backend/app/cmd/server_test.go +++ b/backend/app/cmd/server_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/go-pkgz/auth/token" + "github.com/go-pkgz/auth/v2/token" "github.com/golang-jwt/jwt/v5" "github.com/jessevdk/go-flags" "go.uber.org/goleak" diff --git a/backend/app/rest/api/admin.go b/backend/app/rest/api/admin.go index 49b3bd8a..34ab9933 100644 --- a/backend/app/rest/api/admin.go +++ b/backend/app/rest/api/admin.go @@ -8,7 +8,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/render" - "github.com/go-pkgz/auth" + "github.com/go-pkgz/auth/v2" cache "github.com/go-pkgz/lcw/v2" log "github.com/go-pkgz/lgr" R "github.com/go-pkgz/rest" diff --git a/backend/app/rest/api/admin_test.go b/backend/app/rest/api/admin_test.go index 577c9bb1..ecbe33dd 100644 --- a/backend/app/rest/api/admin_test.go +++ b/backend/app/rest/api/admin_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/go-pkgz/auth/token" + "github.com/go-pkgz/auth/v2/token" cache "github.com/go-pkgz/lcw/v2" R "github.com/go-pkgz/rest" "github.com/golang-jwt/jwt/v5" diff --git a/backend/app/rest/api/rest.go b/backend/app/rest/api/rest.go index 293e793d..5922fc30 100644 --- a/backend/app/rest/api/rest.go +++ b/backend/app/rest/api/rest.go @@ -21,7 +21,7 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/go-chi/cors" "github.com/go-chi/render" - "github.com/go-pkgz/auth" + "github.com/go-pkgz/auth/v2" "github.com/go-pkgz/lcw/v2" log "github.com/go-pkgz/lgr" R "github.com/go-pkgz/rest" diff --git a/backend/app/rest/api/rest_private.go b/backend/app/rest/api/rest_private.go index 41e4b2ce..cbe95792 100644 --- a/backend/app/rest/api/rest_private.go +++ b/backend/app/rest/api/rest_private.go @@ -16,8 +16,8 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/render" - "github.com/go-pkgz/auth" - "github.com/go-pkgz/auth/token" + "github.com/go-pkgz/auth/v2" + "github.com/go-pkgz/auth/v2/token" cache "github.com/go-pkgz/lcw/v2" log "github.com/go-pkgz/lgr" R "github.com/go-pkgz/rest" diff --git a/backend/app/rest/api/rest_private_test.go b/backend/app/rest/api/rest_private_test.go index 6d0d4c88..8bdb440d 100644 --- a/backend/app/rest/api/rest_private_test.go +++ b/backend/app/rest/api/rest_private_test.go @@ -17,7 +17,7 @@ import ( "time" "github.com/go-chi/render" - "github.com/go-pkgz/auth/token" + "github.com/go-pkgz/auth/v2/token" "github.com/go-pkgz/lgr" R "github.com/go-pkgz/rest" "github.com/golang-jwt/jwt/v5" diff --git a/backend/app/rest/api/rest_test.go b/backend/app/rest/api/rest_test.go index 804e2c21..f5085c10 100644 --- a/backend/app/rest/api/rest_test.go +++ b/backend/app/rest/api/rest_test.go @@ -16,10 +16,10 @@ import ( "testing" "time" - "github.com/go-pkgz/auth" - "github.com/go-pkgz/auth/avatar" - "github.com/go-pkgz/auth/provider" - "github.com/go-pkgz/auth/token" + "github.com/go-pkgz/auth/v2" + "github.com/go-pkgz/auth/v2/avatar" + "github.com/go-pkgz/auth/v2/provider" + "github.com/go-pkgz/auth/v2/token" cache "github.com/go-pkgz/lcw/v2" R "github.com/go-pkgz/rest" "github.com/stretchr/testify/assert" diff --git a/backend/app/rest/user.go b/backend/app/rest/user.go index f908bea9..44963333 100644 --- a/backend/app/rest/user.go +++ b/backend/app/rest/user.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/go-pkgz/auth/token" + "github.com/go-pkgz/auth/v2/token" "github.com/umputun/remark42/backend/app/store" )