Repository navigation
feat(crew): approve once needs the person's click in the desktop app - #533
Open
kinqsradio wants to merge 2 commits into
Open
kinqsradio wants to merge 2 commits into
kinqsradio wants to merge 2 commits into
Conversation
The core half of local presence: the shell describes a hold and grants a one-time nonce over the parent channel, PresenceBook keeps one grant per hold for 60 seconds, and approve-once takes it instead of the account's confirmation. Nothing mints a grant until the shell dialog (next PR) exists.
| ) | ||
| .await | ||
| .unwrap() | ||
| const NONCE: &str = "0123456789abcdef0123456789abcdef"; |
| let (w, id) = held_world().await; | ||
| let hold = hold_of(&w, &id, "make deploy").await; | ||
| let first = grant_for(&w, &hold); | ||
| let second = grant_at(&w, &hold, "fedcba9876543210fedcba9876543210", unix_now()); |
| mod tests { | ||
| use super::*; | ||
|
|
||
| const NONCE: &str = "0123456789abcdef0123456789abcdef"; |
| let live = 100 + PRESENCE_LIFETIME_SECS - 1; | ||
| assert!(book.confirmed_for(&what("h-1"), Some(NONCE), live)); | ||
| assert!(!book.confirmed_for(&what("h-1"), Some(NONCE), live + 1)); | ||
| let second = "fedcba9876543210fedcba9876543210"; |
| fn password() -> String { | ||
| ["correct", "horse", "battery"].join(" ") | ||
| } | ||
| const NONCE: &str = "0123456789abcdef0123456789abcdef"; |
| let (status, body) = app.call("POST", &path, json!({}), Some(NONCE)).await; | ||
| assert_eq!((status, &body["code"]), (403, &json!("presence_required"))); | ||
| let (_, other) = app.held("b", "make ship"); | ||
| let for_other = app.grant(&other, "fedcba9876543210fedcba9876543210"); |
presence_hold strings lose newlines and invisible or bidi characters (visible marks), the command says if it was cut, stale account-flow comments go, and two approvals with one nonce have one winner.
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
CONFIRM_PREFIX, theaccount_disabledbranch and the stand-in guard are gone from it.presence_describe/presence_granton the shell channel, answeredpresence_hold/presence_ready/presence_refused; new in-memoryPresenceBook(one grant per hold, 60 s, replaced by a later grant, used once,--parent-stdinonly).403 desktop_required(no shell, or remote),403 presence_required(missing, wrong, used, expired or mismatched nonce; a refusal never burns the grant).presence_requiredordesktop_required.presence_holdtext is made plain: newlines become a visible⏎, control, invisible and bidi characters a visible�, the command is capped at 1000 characters withtruncated. PR2's dialog must render it as plain text.Refs #532
Parity rows
none
Frames built
Frames built: none
Testing
--workspace --all-targets -D warnings,orbyn-corecrew/host/account tests,orbyndunit tests,presence_stdioagainst the real binary,check_rust_arch.py.Co-authors
none
AI usage
Checklist
web/src/generatedwith any contract change;docs/architecture.mdwith any rule change