Skip to content

feat(opds): HTTP Basic auth and credential management - #149

Closed
phildenhoff wants to merge 2 commits into
mainfrom
opds-5-auth
Closed

phildenhoff wants to merge 2 commits into
mainfrom
opds-5-auth

Conversation

@phildenhoff

@phildenhoff phildenhoff commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Sharing your whole book library onto the LAN needs at least a door latch, and Basic auth is what readers like KOReader actually speak. The failure modes are well known — plaintext compares, world-readable credential files, wall-clock leaks that reveal whether a username exists — so this layer does the boring version right.

What changed

  • Argon2id verifiers only; plaintext passwords are never persisted, and the credential file is written 0600.
  • Rejection cache keyed on an HMAC of the Authorization header — no raw header bytes retained — and padded to a fixed duration, so unknown users and cached rejections are indistinguishable from a real verify by timing.
  • Generate / configure / clear credential commands, surfaced to the layer above.

Honest limitation: it's still Basic auth over plain HTTP, so credentials cross the wire base64-visible. Fine as a home-LAN latch; TLS is a separate conversation.

Validation

Covered by auth and credential-store tests in the diff (challenge behavior, cache opacity and boundedness, padding of unknown-user and cached rejections); full workspace suite (348 tests) green at the stack tip, including 62 citadel-opds tests.

Part of the OPDS v1 stack (above #146 → #147 → #148; #150 → #151 → #152 → #153 → #154 → #155 build on top).

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 79.96%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 79.96%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 79.96%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 80.16%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 80.16%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 80.16%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 80.16%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 80.16%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 80.16%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@phildenhoff

Copy link
Copy Markdown
Member Author

Superseded: auth was rebuilt in #161 (Basic auth as the all-networks gate) and #163 (backoff), and credentials are now stored reversibly (#165, ADR 0005). Branch kept because the rest of the stack is based on it.

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