From 7c91cbb08af6b36b66d0f8a2c8f5cb06655cd5a4 Mon Sep 17 00:00:00 2001 From: Haelnorr Date: Tue, 13 Jan 2026 18:07:11 +1100 Subject: [PATCH] updated hwsauth to use hlog --- hwsauth/README.md | 3 ++- hwsauth/authenticator.go | 6 +++--- hwsauth/go.mod | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hwsauth/README.md b/hwsauth/README.md index cf60d27..9a6a166 100644 --- a/hwsauth/README.md +++ b/hwsauth/README.md @@ -1,4 +1,4 @@ -# HWSAuth - v0.3.2 +# HWSAuth - v0.3.3 JWT-based authentication middleware for the HWS web framework. @@ -32,6 +32,7 @@ import ( "net/http" "git.haelnorr.com/h/golib/hwsauth" "git.haelnorr.com/h/golib/hws" + "git.haelnorr.com/h/golib/hlog" ) type User struct { diff --git a/hwsauth/authenticator.go b/hwsauth/authenticator.go index 48a716c..5fddf5c 100644 --- a/hwsauth/authenticator.go +++ b/hwsauth/authenticator.go @@ -1,10 +1,10 @@ package hwsauth import ( + "git.haelnorr.com/h/golib/hlog" "git.haelnorr.com/h/golib/hws" "git.haelnorr.com/h/golib/jwt" "github.com/pkg/errors" - "github.com/rs/zerolog" ) type Authenticator[T Model, TX DBTransaction] struct { @@ -12,7 +12,7 @@ type Authenticator[T Model, TX DBTransaction] struct { load LoadFunc[T, TX] beginTx BeginTX ignoredPaths []string - logger *zerolog.Logger + logger *hlog.Logger server *hws.Server errorPage hws.ErrorPageFunc SSL bool // Use SSL for JWT tokens. Default true @@ -28,7 +28,7 @@ func NewAuthenticator[T Model, TX DBTransaction]( load LoadFunc[T, TX], server *hws.Server, beginTx BeginTX, - logger *zerolog.Logger, + logger *hlog.Logger, errorPage hws.ErrorPageFunc, ) (*Authenticator[T, TX], error) { if load == nil { diff --git a/hwsauth/go.mod b/hwsauth/go.mod index da4fc7b..c76c6d1 100644 --- a/hwsauth/go.mod +++ b/hwsauth/go.mod @@ -8,11 +8,11 @@ require ( git.haelnorr.com/h/golib/hws v0.2.0 git.haelnorr.com/h/golib/jwt v0.10.0 github.com/pkg/errors v0.9.1 - github.com/rs/zerolog v1.34.0 + git.haelnorr.com/h/golib/hlog v0.9.1 ) 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/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/google/uuid v1.6.0 // indirect