fix(host,gui): the Connect page's keys: never replaced, no admin, revoked by id, a quoted command, a leftover file said

Make the key asks the server first and never replaces: a live key whose copy
is missing here may be in use, so it is said in words and left alone. A
page-made key carries read, write and post, not admin (the connect command
keeps its scopes). Revoke names the key's id, so a stale row cannot end a
newer key of the same name; a revoke that leaves the token file says the key
is dead and where the file is. The copyable command is single-quoted for a
POSIX shell and PowerShell, and refused when cmd.exe would act on a part.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 10:23:11 -07:00
1 parent e34b18ec73
commit fd847701e8
8 files changed
+588 -55

No files matched your search

+12 -5
View File
@@ -190,6 +190,9 @@ pub struct Assistant {
/// A token, as listed: who may connect to a company (never its text).
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TokenRow {
/// Its id: what a revoke names, so a row of a key since replaced
/// cannot end the new one.
pub id: String,
/// The company it opens.
pub book: String,
/// Its name.
@@ -262,9 +265,11 @@ pub trait Owner: Send + Sync {
fn serve_roster(&self) -> Result<Roster, String> {
Ok(Roster::default())
}
/// End the token `name` of the company `book` (what `wanderbooks token
/// revoke` does): `Ok` says what was done, in words. Blocks.
fn serve_revoke(&self, _book: &str, _name: &str) -> Result<String, String> {
/// End the token `name`, whose id is `id`, of the company `book` (what
/// `wanderbooks token revoke` does, for that one key): `Ok` says what
/// was done, in words; a key already replaced or revoked is an `Err`
/// that says so. Blocks.
fn serve_revoke(&self, _book: &str, _name: &str, _id: &str) -> Result<String, String> {
Err("not here".into())
}
/// This program run with `words`, as a line to type in a terminal (the
@@ -274,8 +279,10 @@ pub trait Owner: Send + Sync {
Err("not here".into())
}
/// The key an assistant needs to reach the company `book` exists (made
/// now if it did not): `Ok(true)` when it was made now. What `connect`
/// does first, for an assistant set up by hand. Blocks.
/// now if it did not), able to read, draft and post but not to see the
/// access record: `Ok(true)` when it was made now. It never replaces a
/// key: one that exists with no copy here is an `Err` that says so.
/// Blocks.
fn make_key(&self, _book: &str) -> Result<bool, String> {
Err("not here".into())
}