Skip to content

fix(kobo): proxy the /v1/auth/device endpoint#511

Merged
zachyale merged 1 commit into
grimmory-tools:developfrom
imnotjames:fix/509/kobo-proxy-auth-device
Apr 15, 2026
Merged

fix(kobo): proxy the /v1/auth/device endpoint#511
zachyale merged 1 commit into
grimmory-tools:developfrom
imnotjames:fix/509/kobo-proxy-auth-device

Conversation

@imnotjames

@imnotjames imnotjames commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Description

without this it's impossible to set up a kobo device from factory reset since we won't have a userkey yet. this also helps in some situations with the forward-to-store flows for sync

Linked Issue: Fixes #509

Changes

  • add kobo proxy for /v1/auth/device when store proxy is enabled

Summary by CodeRabbit

  • New Features
    • Authentication endpoint now supports optional request forwarding to external authentication services when enabled.

without this it's impossible to set up a kobo device since we won't have
a userkey yet
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The authenticateDevice endpoint in KoboController was modified to support conditional request forwarding. When forwarding to the Kobo Store is enabled, the endpoint proxies the request through koboServerProxy; otherwise, it delegates to the standard authentication service. The return type was generalized to ResponseEntity<?> to accommodate both response types.

Changes

Cohort / File(s) Summary
Kobo Controller Authentication
booklore-api/src/main/java/org/booklore/controller/KoboController.java
Added conditional logic to authenticateDevice method to proxy requests when isForwardingToKoboStore() is enabled, otherwise use standard device authentication. Return type broadened from ResponseEntity<KoboAuthentication> to ResponseEntity<?> to support both proxy and service responses.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

backend, enhancement

Suggested reviewers

  • balazs-szucs

Poem

🐰 A furry fix for Kobo's plight,
When proxies forward left and right,
The auth device can now take flight,
Through Grimmory's tunnels, shining bright! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commit format with 'fix' prefix and clearly describes the main change of proxying the Kobo auth device endpoint.
Linked Issues check ✅ Passed The code changes implement the fix for issue #509 by adding conditional request forwarding to proxy the /v1/auth/device endpoint when store proxy is enabled.
Out of Scope Changes check ✅ Passed All changes are scoped to the KoboController's authenticateDevice method to support proxying, which directly addresses issue #509 with no out-of-scope modifications.
Description check ✅ Passed The pull request description includes all required sections from the template and provides clear context about the changes and their purpose.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zachyale zachyale merged commit 62d5ff0 into grimmory-tools:develop Apr 15, 2026
15 checks passed
@imnotjames imnotjames deleted the fix/509/kobo-proxy-auth-device branch April 15, 2026 20:04
zachyale pushed a commit to zachyale/grimmory that referenced this pull request Apr 17, 2026
without this it's impossible to set up a kobo device since we won't have
a userkey yet
zachyale pushed a commit to zachyale/grimmory that referenced this pull request Apr 17, 2026
without this it's impossible to set up a kobo device since we won't have
a userkey yet
zachyale pushed a commit that referenced this pull request Apr 17, 2026
without this it's impossible to set up a kobo device since we won't have
a userkey yet
zachyale pushed a commit that referenced this pull request Apr 22, 2026
without this it's impossible to set up a kobo device since we won't have
a userkey yet
dsmouse pushed a commit to dsmouse/grimmory that referenced this pull request May 11, 2026
without this it's impossible to set up a kobo device since we won't have
a userkey yet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kobo Device Setup cannot be completed with API endpoint

2 participants