Compare commits

..

1 Commits

Author SHA1 Message Date
7c91cbb08a updated hwsauth to use hlog 2026-01-13 18:07:11 +11:00
3 changed files with 7 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
# HWSAuth - v0.3.2 # HWSAuth - v0.3.3
JWT-based authentication middleware for the HWS web framework. JWT-based authentication middleware for the HWS web framework.
@@ -32,6 +32,7 @@ import (
"net/http" "net/http"
"git.haelnorr.com/h/golib/hwsauth" "git.haelnorr.com/h/golib/hwsauth"
"git.haelnorr.com/h/golib/hws" "git.haelnorr.com/h/golib/hws"
"git.haelnorr.com/h/golib/hlog"
) )
type User struct { type User struct {

View File

@@ -1,10 +1,10 @@
package hwsauth package hwsauth
import ( import (
"git.haelnorr.com/h/golib/hlog"
"git.haelnorr.com/h/golib/hws" "git.haelnorr.com/h/golib/hws"
"git.haelnorr.com/h/golib/jwt" "git.haelnorr.com/h/golib/jwt"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/rs/zerolog"
) )
type Authenticator[T Model, TX DBTransaction] struct { type Authenticator[T Model, TX DBTransaction] struct {
@@ -12,7 +12,7 @@ type Authenticator[T Model, TX DBTransaction] struct {
load LoadFunc[T, TX] load LoadFunc[T, TX]
beginTx BeginTX beginTx BeginTX
ignoredPaths []string ignoredPaths []string
logger *zerolog.Logger logger *hlog.Logger
server *hws.Server server *hws.Server
errorPage hws.ErrorPageFunc errorPage hws.ErrorPageFunc
SSL bool // Use SSL for JWT tokens. Default true SSL bool // Use SSL for JWT tokens. Default true
@@ -28,7 +28,7 @@ func NewAuthenticator[T Model, TX DBTransaction](
load LoadFunc[T, TX], load LoadFunc[T, TX],
server *hws.Server, server *hws.Server,
beginTx BeginTX, beginTx BeginTX,
logger *zerolog.Logger, logger *hlog.Logger,
errorPage hws.ErrorPageFunc, errorPage hws.ErrorPageFunc,
) (*Authenticator[T, TX], error) { ) (*Authenticator[T, TX], error) {
if load == nil { if load == nil {

View File

@@ -8,11 +8,11 @@ require (
git.haelnorr.com/h/golib/hws v0.2.0 git.haelnorr.com/h/golib/hws v0.2.0
git.haelnorr.com/h/golib/jwt v0.10.0 git.haelnorr.com/h/golib/jwt v0.10.0
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.34.0 git.haelnorr.com/h/golib/hlog v0.9.1
) )
require ( require (
git.haelnorr.com/h/golib/hlog v0.9.1 // indirect github.com/rs/zerolog v1.34.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/logr v1.4.3 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect