Skip to content

ci/test/auth: add static-token auth, expand regression tests, and add lint CI#12

Merged
rschmied merged 4 commits into
mainfrom
dev
Mar 18, 2026
Merged

ci/test/auth: add static-token auth, expand regression tests, and add lint CI#12
rschmied merged 4 commits into
mainfrom
dev

Conversation

@rschmied

Copy link
Copy Markdown
Owner

This PR improves client authentication, increases test coverage for edge cases,
and adds consistent linting in both CI and local workflows.

Changes:

  • feat(auth): add a static-token authentication method via StaticTokenProvider
    and WithStaticToken; tighten auth error handling.
  • test(logging): add tests for SetDefault(nil) and Debug/Info/Warn/Error wrapper
    behavior; add model tests for annotation union handling and ImageDefinition
    disk_image nil/missing/unmarshal behavior.
  • ci: add a GitHub Actions lint job (go vet + golangci-lint) and add Makefile
    targets (test/vet/lint); update README linting instructions.

Why:

  • Support token-based auth flows without extra auth endpoint calls.
  • Catch regressions in JSON (un)marshal edge cases and logging wiring.
  • Ensure consistent lint enforcement locally and in CI.

- implement StaticTokenProvider returning consistent token
- introduce WithStaticToken option in client configuration
- ensure no calls to /api/v0/auth_extended with retries on 401
- enhance AuthProvider to error on missing credentials
- add tests for SetDefault(nil) using slog.Default
- verify emitted slog records with Debug/Info/Warn/Error wrappers
- enhance tests in pkg/models for error handling in annotations
- ensure proper behavior of DiskImage1 unmarshal and omit optional fields
- add `lint` job in GitHub Actions after build
- integrate `go vet` and `golangci-lint-action v6` for linting
- update Makefile with phony targets `test`, `vet`, `lint`
- revise README.md with new linting instructions
@coveralls

coveralls commented Mar 18, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 92.929% (+1.2%) from 91.763%
when pulling 998b8c5 on dev
into 629a854 on main.

@rschmied rschmied merged commit cf17ff6 into main Mar 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants