checkvist-api is a type-safe, idiomatic Go client library for the Checkvist (https://checkvist.com/) API.
Find a file
Oliver Jakoubek b91e35a684 Implement authentication with auto token renewal
Add authentication methods to client.go:
- Authenticate(ctx) for explicit login
- AuthenticateWith2FA(ctx, token) for 2FA support
- refreshToken(ctx) for token renewal
- ensureAuthenticated(ctx) for auto-auth before requests
- CurrentUser(ctx) to get logged-in user info
- getToken() for thread-safe token access

Features:
- Token stored with expiry time (23h for safety margin)
- Auto-refresh when token expires within 1 hour
- Falls back to full authentication if refresh fails
- Thread-safe token access using RWMutex
- Sends token via X-Client-Token header

API endpoints used:
- POST /auth/login.json?version=2
- POST /auth/refresh_token.json?version=2
- GET /auth/curr_user.json

Closes checkvist-api-lpn
2026-01-14 13:26:39 +01:00
.beads Implement authentication with auto token renewal 2026-01-14 13:26:39 +01:00
magefiles Initial commit 2026-01-14 12:42:00 +01:00
testdata Initial commit 2026-01-14 12:42:00 +01:00
.gitattributes Initial commit 2026-01-14 12:42:00 +01:00
.gitignore Initial commit 2026-01-14 12:42:00 +01:00
AGENTS.md Initial commit 2026-01-14 12:42:00 +01:00
checklists.go Initial commit 2026-01-14 12:42:00 +01:00
client.go Implement authentication with auto token renewal 2026-01-14 13:26:39 +01:00
errors.go Implement error types and sentinel errors 2026-01-14 13:23:48 +01:00
filter.go Initial commit 2026-01-14 12:42:00 +01:00
go.mod Initial commit 2026-01-14 12:42:00 +01:00
LICENSE Initial commit 2026-01-14 12:42:00 +01:00
models.go Implement data models for Checkvist API entities 2026-01-14 13:22:29 +01:00
notes.go Initial commit 2026-01-14 12:42:00 +01:00
options.go Implement Client struct with functional options 2026-01-14 13:25:03 +01:00
tasks.go Initial commit 2026-01-14 12:42:00 +01:00