Skip to main content

Module tokens

Module tokens 

Source
Expand description

The Tokens tab (doc 34, section 6.5): the tokens of the server, creating, editing, cloning and revoking them. This file is the state and the keys; view.rs draws it. The secret of a new token never leaves the popup that shows it (TUI-TOK-03).

Modules§

view
The drawing of the Tokens tab: the table of tokens and the detail of the selected one.

Structs§

BadExpiry
The text typed as an expiry is not one of the forms parse_expiry reads.

Enums§

Availability
What the tab can do with this token and this server.

Constants§

MASK_AFTER_MS
After this long the secret on the screen is masked (TUI-TOK-03), in milliseconds.
MAX_PAGES
How many pages of tokens one read follows before it gives up (200 tokens each).
PERMISSIONS
The permissions a token can have, in the order the form lists them.
SOON_DAYS
A token that expires within this many days is shown in yellow (TUI-TOK-01).

Functions§

availability
editor_key
The keys of the form of a token.
gate
Why an action cannot run now, as a catalog key; None means it can (TUI-FRM-10).
on_action
parse_expiry
What a person types as an expiry: nothing, none or never (no deadline), a time from now (90m, 12h, 30d), a date (2027-01-31, the start of that day in UTC) or a full RFC 3339 instant. Ok(None) is no deadline.
refused
The server refused the form: the reason goes in the form, which stays open (TUI-TOK-02).
revoked
A token was revoked.
rfc3339
2026-10-15T12:00:00Z for a time in milliseconds since the epoch.
saved
The server answered the form: the secret of a new token, or the change of a token.
secret_file
The file s writes the secret to: in the folder the interface was opened from.
secret_key
A key in the popup of the secret (TUI-TOK-03).
secret_written
The secret was written to a file: it counts as kept.
selected
selected_index
The index of the selected token in tokens; the first one if the selection is gone.
submit
The form was filled in and the person asked to save it.
visible
The tokens shown: those whose name has the filter in it, in the chosen order.