Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ KoReader sync and API keys #490

Merged
merged 42 commits into from
Nov 9, 2024
Merged

✨ KoReader sync and API keys #490

merged 42 commits into from
Nov 9, 2024

Conversation

aaronleopold
Copy link
Collaborator

@aaronleopold aaronleopold commented Oct 23, 2024

Resolves #239
Resolves #447

I'm opening this PR a bit early as a draft to get some debug builds out into the world, hopefully testing these features and finding any holes before merging to experimental.

This PR primarily implements the KoReader sync API in Stump, but I had to build out API key support to unblock a koreader-specific auth constraint. An overview is as follows:

  • KoReader sync API implementation
    • The router is enabled when ENABLE_KOREADER_SYNC is set to true
    • A user may access this router when they have the feature:koreader_sync permission
      • A user requires an API key to access these routes, as mentioned previously, which implies the feature:api_keys permission
  • Support API keys and adjust auth middlewares to understand what they are and how to validate them
    • A key can either inherit your user permissions or be granted a subset of permissions your account has
    • A key is associated with your account, sharing them is not recommended. These are effectively API-only passwords
    • Usage is loosely tracked, Stump will update a timestamp when a key is used
  • API key management suite
    • At a glance view of your keys
    • Inspector for individual keys
    • Create / delete API key
  • Add an API key scoped router for OPDS v1.2 ([FEATURE] OPDS v1.2 support for Cantook #447)
    • http(s)://your-server(:10801)(/baseUrl)/opds/(api_key)/v1.2/catalog

We are likely a few weeks out before this PR is ready for merge. Besides testing, there are some management features missing on the UI (i.e. delete) and I want to take the time to add thoughtful tests

Obligatory sneak peeks Screenshot 2024-10-22 at 7 05 33 PM Screenshot 2024-10-22 at 7 05 37 PM Screenshot 2024-10-22 at 7 05 41 PM

Copy link

codecov bot commented Oct 23, 2024

@aaronleopold
Copy link
Collaborator Author

I'm aiming to merge this in over next few days / the weekend. I'll be sure to annotate this as an experimental feature in the docs, so even when it makes its way to stable at some point people understand (hopefully) it requires more user testing and validation

@aaronleopold aaronleopold changed the title [WIP] ✨ KoReader sync and API keys ✨ KoReader sync and API keys Nov 7, 2024
@aaronleopold aaronleopold marked this pull request as ready for review November 9, 2024 16:51
@aaronleopold aaronleopold merged commit 4055495 into experimental Nov 9, 2024
8 checks passed
@aaronleopold aaronleopold deleted the al/koreader-sync branch November 9, 2024 17:03
@aaronleopold aaronleopold mentioned this pull request Dec 4, 2024
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.

[FEATURE] OPDS v1.2 support for Cantook [FEATURE] KOReader sync implementation
1 participant