Add comprehensive config validation and race testing target

Split config validation into validateFields() (pure logic) and
validateFiles() (filesystem checks) for testability. New validations:
TLS file existence, token TTL parseability/positivity, Argon2 params > 0,
valid log level, non-empty listen addresses. Added 18 tests covering all
validation paths. Added `make test-race` target. Resolves A-015 and A-017.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 20:49:16 -07:00
parent c5469c6bdf
commit 41839b7284
4 changed files with 307 additions and 7 deletions

View File

@@ -137,10 +137,13 @@ severity levels. All critical and high issues resolved.
### A-015: Incomplete Config Validation
- **Severity**: Medium
- **Status**: Open
- **Status**: ~~Resolved~~
- **Description**: TLS files not checked for existence at startup.
Token TTL, WebAuthn config not validated.
- **Plan**: Add file existence checks and config field validation.
- **Resolution**: Split validation into `validateFields()` and
`validateFiles()`. Added checks for: TLS file existence, token TTL
parseability and positivity, Argon2 params > 0, valid log level,
non-empty listen addresses. Full test coverage in config_test.go.
### A-016: Inconsistent Error Types
- **Severity**: Low
@@ -150,9 +153,9 @@ severity levels. All critical and high issues resolved.
### A-017: No Race Condition Testing
- **Severity**: Low
- **Status**: Open
- **Status**: ~~Resolved~~
- **Description**: Test suite does not use `-race` flag.
- **Plan**: Add `make test-race` target.
- **Resolution**: Added `make test-race` target that runs `go test -race ./...`.
---
@@ -174,9 +177,9 @@ severity levels. All critical and high issues resolved.
| A-012 | Medium | Accepted |
| A-013 | Medium | Accepted |
| A-014 | Medium | Open |
| A-015 | Medium | Open |
| A-015 | Medium | ~~Resolved~~ |
| A-016 | Low | Open |
| A-017 | Low | Open |
| A-017 | Low | ~~Resolved~~ |
## Design Note: Single-User Model