Vixen
02b45cc4
csharp
public sealed class GateTokenSigner

Mints session tokens, and is the only thing that can tell a real one from a made-up one.

Read the guide page for this →

Remarks

⚠ The key is a secret and it is the whole of the security of the service plane. Anyone holding it can sign in as anybody. It belongs in whatever the deployment already uses for secrets. Sharing it with the realms' cluster key would mean a realm could mint gate sessions; they are separate keys for the same reason they are separate types.

Fields and properties (1)

  • public const int MinimumKeyBytes

    The shortest key this accepts — the hash's own output size.

Methods (4)

  • public GateTokenSigner(ReadOnlySpan<byte> signingKey)

    Holds a signing key.

  • public string Encode(GateToken token)

    Signs a session.

  • public TokenStatus TryDecode(string? text, DateTimeOffset now, out GateToken? token)

    Reads a token back, and says whether to believe it.

  • public void Dispose()

    Releases the key.

Used by (2)

  • GateServiceVixen.Live.Gate
  • GateServiceTestsVixen.Live.Gate.Tests