summaryrefslogtreecommitdiff
path: root/internal/authkeys
AgeCommit message (Collapse)Author
2026-04-14fix: shadowing, version.Tag, prealloc LoadRecords (ask 54)Paul Buetow
- CreateKey: avoid shadowing named return err on rand.Read - daemon Run: rename slog logger to slogLog vs stdlib log package - version: rename Version to Tag to avoid version.Version stutter - LoadRecords: COUNT(*) then make slice with capacity Made-with: Cursor
2026-04-14fix(r3): use errors.Is for sentinel error comparisonsPaul Buetow
Replace direct == checks with errors.Is so wrapped errors are handled correctly (authkeys Verify, daemon server/EOF, Magefile uninstall). Refs: ask r3, 100 Go Mistakes #51 Made-with: Cursor
2026-04-14n3: validate SQLite with PingContext after OpenPaul Buetow
Call db.PingContext in storage.Open and authkeys.OpenStore; close DB and return wrapped errors on failure. Add tests for canceled context and invalid directory path. Made-with: Cursor
2026-04-14test: microservice coverage for task 63Paul Buetow
Add table-driven HTTP and unit tests for report (all formats, negatives), upload/auth boundaries, upload helpers, readiness, Run and logging. Extend authkeys tests for Close, CreateKey validation, and post-close errors. Add CLI tests for defaultListenFromEnv and create-client-key with -auth-db only. Add mage CoverMicroservice for local/CI-style coverage measurement. Use context.Background and os.Chdir for Go 1.21-compatible tests. Made-with: Cursor
2026-04-14task 13: upload API keys in SQLite, Bearer auth, create-client-key CLIPaul Buetow
- Add internal/authkeys with SHA-256 hashed tokens and KeyCount gate - PUT /upload/{host}/{kind} for uptimed files; auth when any key exists - Daemon -auth-db and Config.AuthDB; plain HTTP unchanged - CLI: goprecords --create-client-key HOSTNAME (-stats-dir|-auth-db) Made-with: Cursor