feat(tui): account settings — stats, password change, and logout
The settings popup opens with an Account block: who the session is logged in as, how much it shares, the port peers reach it on, and the daemon it borrows when the window is attached to one. Two rows follow, both confirmed before they act. A password is typed twice, because the server sends no verdict on a change and a typo entered once would leave the account with a password nobody knows. Logging out closes the window and comes back to the login screen with the stored password deleted, so the next start asks rather than walking straight back in. A window attached to a daemon offers no logout: the login is the daemon's. "Change it on the server, then store it where the login lives" is one function over the session and the secret store, so the window, the command and the daemon share the rule rather than each spelling out its own idea of which process owns the password. Headless the same two acts are `account password` and `account logout`, and the daemon answers `account.password` so a routed run is not a dead end — `whoami` already reported who is logged in and what they share.
This commit is contained in:
@@ -595,6 +595,18 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PasswordParams": {
|
||||
"description": "A new password for the account the daemon is logged in as. Plain text on\nthe wire, like the token: the transport is the local socket, or TCP behind\nan SSH tunnel (see docs/daemon-protocol.md).",
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"password"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"QueryParams": {
|
||||
"properties": {
|
||||
"query": {
|
||||
@@ -2317,6 +2329,26 @@
|
||||
},
|
||||
"summary": "Everyone this session is watching."
|
||||
},
|
||||
{
|
||||
"name": "account.password",
|
||||
"paramStructure": "by-name",
|
||||
"params": [
|
||||
{
|
||||
"name": "password",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"name": "result",
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Ack"
|
||||
}
|
||||
},
|
||||
"summary": "Change the password of the account the daemon is logged in as, and store it on the daemon's host so a restart still logs in."
|
||||
},
|
||||
{
|
||||
"name": "shares.status",
|
||||
"paramStructure": "by-name",
|
||||
|
||||
Reference in New Issue
Block a user