Commit Graph

8 Commits

Author SHA1 Message Date
95a17597cf added glob matching to auth middleware 2026-02-01 19:55:04 +11:00
1c49b19197 fixed issue with hwsauth where table creation didnt work so user logins was broken if table didnt already exist 2026-01-24 03:08:39 +11:00
f25bc437c4 updated hwsauth: uses new hws version 2026-01-23 12:55:44 +11:00
3726ad738a fixed bad import 2026-01-11 23:35:05 +11:00
4c5af63ea2 refactor to improve database operability in hwsauth 2026-01-11 23:00:50 +11:00
1b25e2f0a5 Refactor database interface to use *sql.DB directly
Simplified the database layer by removing custom interface wrappers
and using standard library *sql.DB and *sql.Tx types directly.

Changes:
- Removed DBConnection and DBTransaction interfaces from database.go
- Removed NewDBConnection() wrapper function
- Updated TokenGenerator to use *sql.DB instead of DBConnection
- Updated all validation and revocation methods to accept *sql.Tx
- Updated TableManager to work with *sql.DB directly
- Updated all tests to use db.Begin() instead of custom wrappers
- Fixed GeneratorConfig.DB field (was DBConn)
- Updated documentation in doc.go with correct API usage

Benefits:
- Simpler API with fewer abstractions
- Works directly with database/sql standard library
- Compatible with GORM (via gormDB.DB()) and Bun (share same *sql.DB)
- Easier to understand and maintain
- No unnecessary wrapper layers

Breaking changes:
- GeneratorConfig.DBConn renamed to GeneratorConfig.DB
- Removed NewDBConnection() function - pass *sql.DB directly
- ValidateAccess/ValidateRefresh now accept *sql.Tx instead of DBTransaction
- Token.Revoke/CheckNotRevoked now accept *sql.Tx instead of DBTransaction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-11 17:39:30 +11:00
61d519399f fixed incorrect import 2026-01-04 01:11:25 +11:00
b13b783d7e created hwsauth module 2026-01-04 01:01:17 +11:00