Compare commits

..

9 Commits

Author SHA1 Message Date
7c91cbb08a updated hwsauth to use hlog 2026-01-13 18:07:11 +11:00
h
1c66e6dd66 Merge pull request 'hlogdoc' (#3) from hlogdoc into master
Reviewed-on: #3
2026-01-13 13:53:12 +11:00
h
614be4ed0e Merge branch 'master' into hlogdoc 2026-01-13 13:52:54 +11:00
h
ddd570230b Merge pull request 'h-patch-1' (#2) from h-patch-1 into master
Reviewed-on: #2
2026-01-13 13:33:39 +11:00
h
a255ee578e Update hlog/README.md 2026-01-13 13:31:47 +11:00
h
1b1fa12a45 Add hlog/LICENSE 2026-01-13 13:31:15 +11:00
h
90976ca98b Update hlog/README.md 2026-01-13 13:26:09 +11:00
h
328adaadee Merge pull request 'Updated hlog documentation to comply with GOLIB rules.' (#1) from hlogdoc into master
Reviewed-on: #1
2026-01-13 13:24:55 +11:00
h
5be9811afc Update hlog/README.md 2026-01-13 13:24:07 +11:00
4 changed files with 28 additions and 6 deletions

21
hlog/LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 haelnorr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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