Class LinksTokenTable
- Namespace
- Foundation.Data.Doublets.Cli
- Assembly
- Foundation.Data.Doublets.Cli.dll
The tokens a links server knows, stored as links (issue #149): the
authenticator of (auth: token) that clink --tokens uses.
public sealed class LinksTokenTable
- Inheritance
-
LinksTokenTable
- Inherited Members
Remarks
A subject s of the data has a pair (p: Token s), where
Token is the point named Token, and each of its tokens is a
link (t: p t), named sha256:<hex> after the SHA-256 of the
token, so the store never holds a token itself, and a subject may have
many (a store of unique doublets would merge equal links). The table
lives in a store of its own or in the data; any other authenticator is
a Func<T, TResult> of
Authenticate.
Constructors
LinksTokenTable(INamedTypesLinks<uint>)
public LinksTokenTable(INamedTypesLinks<uint> store)
Parameters
storeINamedTypesLinks<uint>The store of the table.
Fields
TokenName
The name of the point every token link starts from.
public const string TokenName = "Token"
Field Value
Methods
Authenticate(string)
The subject of token, or null when the table does not know it.
public uint? Authenticate(string token)
Parameters
tokenstring
Returns
- uint?
Grant(string, uint)
Lets token authenticate as subject, instead of any subject it had.
public uint Grant(string token, uint subject)
Parameters
Returns
- uint
The link of the token.
NameOf(string)
The name of the link of token.
public static string NameOf(string token)
Parameters
tokenstring
Returns
Revoke(string)
Forgets token; whether the table knew it.
public bool Revoke(string token)
Parameters
tokenstring