Repository navigation
feat: add a cache challenge store - #152
Merged
Merged
Conversation
RenzoMinelli
added a commit
that referenced
this pull request
Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
marked this pull request as draft
September 25, 2026 19:04
RenzoMinelli
added a commit
that referenced
this pull request
Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
September 25, 2026 19:08
87acce5 to
05d846d
Compare
RenzoMinelli
added a commit
that referenced
this pull request
Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
September 25, 2026 19:25
05d846d to
ffe1a99
Compare
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
September 25, 2026 20:20
ffe1a99 to
404ae7c
Compare
RenzoMinelli
added a commit
that referenced
this pull request
Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
added a commit
that referenced
this pull request
Sep 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
September 25, 2026 20:34
404ae7c to
9eb1ffd
Compare
RenzoMinelli
added this pull request to stack #156
October 2, 2026 20:17
RenzoMinelli
added a commit
that referenced
this pull request
Oct 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
October 2, 2026 22:06
9eb1ffd to
6646a39
Compare
RenzoMinelli
added a commit
that referenced
this pull request
Oct 6, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
October 6, 2026 12:23
6646a39 to
f69e4d6
Compare
RenzoMinelli
added a commit
that referenced
this pull request
Oct 7, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
October 7, 2026 13:12
f69e4d6 to
8dd3657
Compare
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
October 7, 2026 21:15
8dd3657 to
424e8b8
Compare
- `ChallengeStores::Cache` finds the challenge through the credential's clientDataJSON and consumes it once. - Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…request Stores already receive the request, so callers no longer pass the credential and the store interface stays as merged in #150. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--cache-challenge-store
branch
from
October 7, 2026 21:33
424e8b8 to
df689de
Compare
RenzoMinelli
marked this pull request as ready for review
October 7, 2026 21:49
Also memoize the credential and its challenge, and simplify the spec setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This PR only adds the cache challenge store. JSON object credentials, `skip_session_storage` and the `ActionController::API` parent move to a follow-up, together with the two-factor flow that still reads the session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps keys a fixed length and keeps raw challenges out of the cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
added a commit
that referenced
this pull request
Oct 8, 2026
- Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Moved from #152, which now only adds the cache challenge store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
santiagorodriguez96
left a comment
Collaborator
There was a problem hiding this comment.
Looking great! 🔝
Just a couple of small comments!! 💪
Comment on lines
+142
to
+143
| Devise::Webauthn::ChallengeStores::Cache.cache = Rails.cache | ||
| Devise::Webauthn::ChallengeStores::Cache.expires_in = 5.minutes |
Collaborator
There was a problem hiding this comment.
I think I'd like to give more thought to this interface, but we can leave for a follow up PR 🙂
Contributor
Author
There was a problem hiding this comment.
Sounds good, let's do that in a follow-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
passkey_authentication_spec covers the controller and store contract, and cache_spec covers the Cache store without a session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
santiagorodriguez96
approved these changes
Oct 9, 2026
RenzoMinelli
added a commit
that referenced
this pull request
Oct 13, 2026
- Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Moved from #152, which now only adds the cache challenge store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
added a commit
that referenced
this pull request
Oct 13, 2026
- Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Moved from #152, which now only adds the cache challenge store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
added a commit
that referenced
this pull request
Oct 13, 2026
- Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Moved from #152, which now only adds the cache challenge store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
added a commit
that referenced
this pull request
Oct 13, 2026
- Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Moved from #152, which now only adds the cache challenge store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
added a commit
that referenced
this pull request
Oct 13, 2026
- Accept `public_key_credential` as a JSON object or string. - Respect `skip_session_storage` (`:params_auth`) in both WebAuthn strategies. - Load the options controllers under an `ActionController::API` parent. Moved from #152, which now only adds the cache challenge store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Adds
ChallengeStores::Cache(:cache), which keeps WebAuthn challenges inRails.cacheinstead of the session.Why: Clients without a cookie session cannot use the session store. Support for those API clients follows in #153.
Decisions:
clientDataJSON.MemoryStoreandFileStoreare not.How to test:
bundle exec rspec spec/devise/webauthn/challenge_stores spec/requests/devise/cache_challenge_store_spec.rb. The request spec asks for the challenge and signs in from a different session.