Skip to content

Add iOS auth functionality - #3

Merged
johnwbyrd merged 3 commits into
johnwbyrd:mainfrom
DrewGalbraith:main
May 31, 2026
Merged

Add iOS auth functionality#3
johnwbyrd merged 3 commits into
johnwbyrd:mainfrom
DrewGalbraith:main

Conversation

@DrewGalbraith

Copy link
Copy Markdown
Contributor

Summary

Paprika's login doesn't actually require the RSA-signed purchase license to issue a token. The v1 login endpoint (POST /api/v1/account/login/) accepts email + password alone, and that token works against the v2 sync endpoints. This unblocks iOS users, whose license lives in the system keychain rather than the SQLite DB — so the purchases table needed for license decryption never exists. Addresses #1.

Changes*

Auth.authenticate_password_only() — logs in with credentials only (falls back to KAPPARI_EMAIL / KAPPARI_PASSWORD)
NetworkClient.authenticate() now takes optional license_data/signature; password-only login routes through v1; shared response parsing
Config no longer requires a database to construct (license decryption still validates db_file itself)
Corrected authentication.md / crypto.md, which stated the RSA signature was mandatory; documented the password-only flow
Added a live password-only auth test

Drew Galbraith and others added 2 commits May 31, 2026 13:02
Paprika's login does not actually require the RSA-signed purchase
license to issue a token: the v1 login endpoint accepts email and
password alone, and that token works against the v2 sync endpoints.
This unblocks iOS users, whose license lives in the system keychain
rather than the local SQLite database, so the `purchases` table needed
for license decryption never exists (issue #1).

- auth: add Auth.authenticate_password_only(); credentials fall back to
  KAPPARI_EMAIL / KAPPARI_PASSWORD
- network_client: authenticate() now takes optional license_data and
  signature; password-only login goes through v1, and login response
  parsing is shared
- config: a database is no longer required to construct Config/Auth;
  license decryption still validates db_file itself
- docs: correct authentication.md and crypto.md, which stated the RSA
  signature was mandatory, and document the password-only flow
- tests: add a live password-only authentication test

Closes #1
Add password-only authentication for license-free login

@johnwbyrd johnwbyrd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, at least as a first draft. Little concerned about leaning back on the v1 API, but it's better than what I currently have.

@johnwbyrd

Copy link
Copy Markdown
Owner

Can you take a look at the ruff error and clean up please? Thanks!

This commit addresses improvements across the dependency management, development environment setup, and core library code.

Changes include:
*   **Dependency Management:** Updated `pyproject.toml` to utilize the modern `[dependency-groups]` format.
*   **Lock File:** Introduced `uv.lock` to ensure highly reproducible dependency environments.
*   **Documentation:** Updated the `README.md` to recommend `uv sync` as the primary method for installing development dependencies.
*   **Code Refactor:** Renamed `filename` to `_filename` in `kappari/network_client.py` to pass ruff check.
@johnwbyrd
johnwbyrd merged commit 86c5a55 into johnwbyrd:main May 31, 2026
1 check passed
@johnwbyrd

Copy link
Copy Markdown
Owner

nvm I took care of it! Thanks very much!

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.

2 participants