Skip to content

feat: optional bearer authentication with RSS_API_TOKEN - #26

Merged
Skulldorom merged 3 commits into
mainfrom
hermes/auth-optional-token
Jul 20, 2026
Merged

feat: optional bearer authentication with RSS_API_TOKEN#26
Skulldorom merged 3 commits into
mainfrom
hermes/auth-optional-token

Conversation

@Skulldorom

Copy link
Copy Markdown
Owner

Summary

Merges codex/add-api-authentication-with-tests with the latest main (13 commits ahead) and makes RSS_API_TOKEN optional.

When RSS_API_TOKEN is not set, the API works exactly as before — no authentication required. Set it to a long random secret to require Authorization: Bearer <token> on /freshrss/unread.

Changes

  • RSS_API_TOKEN is optional — removed from the required-env startup check
  • require_api_token() passes through when token is not configured
  • Merged all 13 commits from main (Pydantic validation, reauth, URL encoding, etc.)
  • Resolved merge conflicts in main.py, tests/test_main.py, docker-compose.yml, README.md
  • docker-compose.yml uses ${RSS_API_TOKEN:-} — safe default to empty
  • Tests: 48/48 pass, auth off by default, auth-specific tests enable token at runtime
  • Added test_unread_allows_requests_when_token_not_configured — proves no-auth mode works

Docker Image Impact

  • No Dockerfile changes — image builds identically
  • Container starts without RSS_API_TOKEN — backward compatible
  • If user sets RSS_API_TOKEN, auth is enforced; if not, everything works as today

Test Plan

uv sync && uv run pytest tests/ -v  # 48 passed

…token

# Conflicts:
#	README.md
#	docker-compose.yml
#	main.py
#	tests/test_main.py
- remove RSS_API_TOKEN from _missing check — auth is skipped when unset
- require_api_token() passes through when RSS_API_TOKEN is not configured
- merge main (13 commits: Pydantic validation, reauth, URL encoding, etc.)
- update tests: auth off by default, auth-specific tests enable token at runtime
- update docker-compose: RSS_API_TOKEN defaults to empty (no crash)
- update README and .env.example: document optional nature
@Skulldorom
Skulldorom marked this pull request as ready for review July 20, 2026 10:14
@Skulldorom
Skulldorom merged commit 545825f into main Jul 20, 2026
2 checks passed
@Skulldorom
Skulldorom deleted the hermes/auth-optional-token branch July 20, 2026 10:15
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.

1 participant