- Add IMPLEMENTATION_EXACT.md with exact code changes for all phases
- Update IMPLEMENTATION_PLAN.md with clarifications on two-field approach:
- device_identifier: Serial number (Kobo) or UUID (KOReader)
- auth_token: Auto-generated API key for authentication
- Resolve all user questions with ✅ marked decisions
- Add verification steps for documentation accuracy
- Document Kobo vs KOReader registration workflow differences
- Add SQL query for token regeneration (UpdateDeviceAuthToken)
- Include TypeScript device management code
- Add Bruno API test files for all new endpoints
- Update Kobo setup documentation for URL path token approach
- Add Section 16.1: Codebase investigation results
- Document that device_identifier was added in Phase 1 (commit 3b2075f)
- Clarify it's for device management, not authentication
- Show active usage in device registration (line 37: validate:"required,min=1,max=255")
- Identify dead code: GetDeviceByIdentifier query exists but not called
- Confirm OPDS uses device.id for lookup (not device_identifier)
- Distinguish authentication (auth_token) from device identification (device_identifier)
- Remove duplicate Go code block in Section 9.6 (line 676)
- Keep canonical version in Section 14.2 (line 1081)
- Eliminates ~25 lines of duplicate content
- Plan now has single source of truth for middleware implementation
- Add Section 16: Documentation Updates Required
- Detail specific line numbers and changes for koreader-setup.md:
- Line 126: Change "Basic Auth" to "Bearer Token"
- Lines 127-128: Remove username/password references
- Detail verification needed for kobo-setup.md:
- Lines 37-53: Confirm no serial number references
- Verify registration flow describes automatic token generation
- Update Phase 1 tasks with specific line number references
- Update Phase 2 Kobo documentation tasks with verification notes
- Replace serial number approach with API key in URL path for Kobo
- Add authentication strategy section documenting Kobo and KOReader methods
- Update unified authentication architecture to support URL path parameters
- Document Komga-proven approach for stock Kobo firmware
- Update feature matrix with new authentication methods
- Revise user flows for API key-based registration
- Clarify OPDS security (already using DeviceAuthMiddleware)
- Update security considerations to reflect revocable API keys
Add detailed implementation plan covering:
- Enhanced authentication middleware (Bearer + serial)
- Kobo native sync with serial-based auth
- KOReader plugin development plan
- OPDS security hardening
- Parallel implementation tracks
- Complete historical context and decision rationale
This plan documents the strategy to transform Bookhoard into a
Kindle-replacement ecosystem with full sync support for both
Kobo (native) and KOReader (via plugin) devices.
Key decisions:
- Kobo: Serial number authentication (simplest UX)
- KOReader: Bearer token via plugin (most secure)
- Plugin: Separate repository under Bookhoard org
- Implementation: Parallel tracks for faster delivery
- Add comprehensive implementation plan for universal sync system
- Update README with API reference and device setup guides
- Add KOBO_SETUP.md device configuration guide