Repository navigation
feat(sign): optionally remember the PIN for 30 minutes - #11
Merged
Merged
Conversation
The PIN form offers to remember the PIN on this computer for 30 minutes. The agent keeps it in memory only and forgets it when the time runs out (not extended by use), when the CIE leaves the reader, when a different card is on the reader, on any error opening the card, when the user picks "Use a different PIN" or types the PIN without ticking the box. Only the browser that typed it can use it, through a random key in an HttpOnly, SameSite=Strict cookie; every signature still needs a click on Sign. The page and the dashboard never see the PIN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
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. Comment |
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.
Summary
Adds an opt-in Remember the PIN on this computer for 30 minutes checkbox to the sign page. While the PIN is remembered, the page shows "Your PIN is remembered for … until HH:MM, while the CIE stays on the reader". Signing then needs only a click on Sign.
Safeguards
HttpOnly,SameSite=Strictcookie (path/api/) ties the PIN to the browser where it was typed. Other browsers, or other local users calling the API, getpin_required.POST /api/forget), typing the PIN without ticking the box, or restarting the agent all forget it.Known limit: a card swapped faster than the 2 s check still receives the remembered PIN. If it is a different CIE, that uses one of its PIN attempts. Nothing is signed, and the PIN is forgotten immediately. Closing this gap would need a card identifier read before the PIN, in every provider.
API
POST /api/sign:pinmay be omitted to use the remembered PIN. The newrememberflag asks the agent to remember the PIN. When no PIN is remembered, the response ispin_required(401)./api/statusand/api/jobreturnremembered: {signer, expires}./api/jobalso returnsrememberMinutes.Options.RememberForsets the duration (negative turns the feature off).Options.CardWatchsets the card check interval.Testing
internal/server/remember_test.go:cardGonego test -race ./internal/server/passes.--softagainst a fake dashboard: signed with the box ticked, signed two documents without a PIN, then "Use a different PIN" brought the PIN field back.internal/autostartTestInstalledParsesEntriesfails locally onmaintoo, so it is unrelated to this change.🤖 Generated with Claude Code