feat: add user API tokens for long-lived auth #14

Merged
blacklight merged 11 commits from feat/api-tokens into main 2026-08-24 00:51:11 +02:00
Owner
  • Add /auth/api-tokens endpoints to create, list, and revoke tokens
  • Add ApiToken model and migration plus issuance/validation service
  • Update auth deps to accept API-token JWTs and track last_used_at
  • Add tests and README route entry

Closes: #13

- Add /auth/api-tokens endpoints to create, list, and revoke tokens - Add ApiToken model and migration plus issuance/validation service - Update auth deps to accept API-token JWTs and track last_used_at - Add tests and README route entry Closes: #13
feat: add user API tokens for long-lived auth
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
68228e9a0b
- Add /auth/api-tokens endpoints to create, list, and revoke tokens
- Add ApiToken model and migration plus issuance/validation service
- Update auth deps to accept API-token JWTs and track last_used_at
- Add tests and README route entry
fix: avoid startup hang from sqlite migration lock and overlay timeout
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
b114cef0f1
Use NullPool for the SQLite synchronous migration engine so it does not
hold a lock on the database after migrations complete, which was
blocking the async `_sync_settings_overlay` during Tornado startup.

Wrap the settings overlay coroutine in `asyncio.wait_for` with a 10s
ceiling so a stuck database query cannot delay server startup
indefinitely. Keep the explicit `new_event_loop`/`run_until_complete`
pattern instead of `asyncio.run` to avoid unsetting Tornado's current
IOLoop in test contexts.
- Add TZDateTime to enforce aware timestamps across models
- Track token usage in Redis and flush periodically to DB
- Flush buffered usage on token revocation
- Enhance API token schemas with examples and field descriptions
- Add migrations utils for table/column/index existence
- Use shared table_exists in api_tokens migration
- Add unit tests for migrations utils
refactor(migrations): centralize helpers and reuse sync url conversion
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
ebec7f4a9e
- Move ensure_migrated and url helpers into migrations/utils.py
- Export migration helpers from migrations/__init__.py
- Use shared to_sync_url in Alembic env.py
fix(migrations): use absolute import for to_sync_url
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/pr Build was killed
ccdf8c24f7
chore(requirements): Remove upper bound for alembic
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
5e4fe01084
This prevents the execution of duplicate CI pipelines - one for the push
event and one for the pull_request event. The push event is sufficient.
ci(drone): Update tests step to use Python 3.14
All checks were successful
continuous-integration/drone/push Build is passing
eb9c65f5f5
blacklight deleted branch feat/api-tokens 2026-08-24 00:51:11 +02:00
Sign in to join this conversation.
No description provided.