Skip to main content

ConsoleToken

A class in TavernLib, TavernLib.Backend.RemoteConsole.

One named console token's row in console_tokens.json. Only its id and generation travel in the token, so an edit to its access applies at once.

Constructors​

MemberWhat it is
ConsoleToken()Created by TavernLib; mods don't make one.

Fields​

MemberWhat it is
const string FullPresetfull, the preset of a token that may run everything but token and repeat.

Properties​

MemberWhat it is
List<string> Access { get; set; }The command and module paths it may run. Unused for a full token.
DateTime Created { get; set; }When it was made, in UTC. Signed into the token as iat.
DateTime? Expires { get; set; }When it stops working, in UTC, or null for never.
int Generation { get; set; }Starts at 1 and goes up on each token rotate, so older text stops working.
string Id { get; set; }Its random id, also signed into the token.
bool IsFull { get; }True when its preset is full, ignoring case.
DateTime? LastUsed { get; set; }When it last logged in, in UTC.
string Name { get; set; }The name given at token create. Active tokens' names are unique, ignoring case.
string Preset { get; set; }Its preset label: full, custom or another one-word label.
DateTime? Revoked { get; set; }When it was revoked, in UTC, or null while it isn't.
1 private and internal property
MemberWhat it is
private IDictionary<string, JToken> Extra { get; set; }Holds JSON keys TavernLib doesn't model, so they are written back unchanged.

Methods​

MemberWhat it is
string Status(DateTime now)revoked, expired or active at the time given.

Used in​

Members of other types that take, return or hold a ConsoleToken: