SecurityEventTokenValidationContext Class
The state one token accumulates on its way through the pipeline: each step reads what earlier steps established and writes what it proved.
public sealed class SecurityEventTokenValidationContextInheritance System.Object → SecurityEventTokenValidationContext
Remarks
The context distinguishes the UNVERIFIED reading of the token from the verified one on purpose. UnverifiedHeader and UnverifiedPayload are what parsing alone yields - enough for the cheap rejections that should not cost a signature check - while Token exists only after the signature step, so a later step reaching for the trusted token cannot accidentally read the untrusted one: they are different properties, and the trusted one is null until trust exists.
Constructors
SecurityEventTokenValidationContext(string, SecurityEventTokenValidationOptions) Constructor
The state one token accumulates on its way through the pipeline: each step reads what earlier steps established and writes what it proved.
public SecurityEventTokenValidationContext(string compactToken, Abblix.SecurityEvents.Validation.SecurityEventTokenValidationOptions options);Parameters
compactToken System.String
The token as received, in compact serialization.
options SecurityEventTokenValidationOptions
What this run expects of the token.
Remarks
The context distinguishes the UNVERIFIED reading of the token from the verified one on purpose. UnverifiedHeader and UnverifiedPayload are what parsing alone yields - enough for the cheap rejections that should not cost a signature check - while Token exists only after the signature step, so a later step reaching for the trusted token cannot accidentally read the untrusted one: they are different properties, and the trusted one is null until trust exists.
Properties
SecurityEventTokenValidationContext.CompactToken Property
The token as received. Steps performing cryptography read this, never a re-serialization of parsed parts: the signature covers these exact bytes.
public string CompactToken { get; }Property Value
SecurityEventTokenValidationContext.EventPayloads Property
The typed event payloads, keyed by event identifier: set by the payload deserialization step.
public System.Collections.Generic.IReadOnlyDictionary<string,Abblix.SecurityEvents.Events.IEventPayload>? EventPayloads { get; set; }Property Value
System.Collections.Generic.IReadOnlyDictionary<System.String,IEventPayload>
SecurityEventTokenValidationContext.Options Property
What this run expects of the token.
public Abblix.SecurityEvents.Validation.SecurityEventTokenValidationOptions Options { get; }Property Value
SecurityEventTokenValidationOptions
SecurityEventTokenValidationContext.State Property
The facts established so far.
public Abblix.SecurityEvents.Validation.SecurityEventTokenValidationStates State { get; }Property Value
SecurityEventTokenValidationStates
SecurityEventTokenValidationContext.Token Property
The validated token: set by the signature step, null until then. From here the claims are the issuer's words.
public Abblix.SecurityEvents.SecurityEventToken? Token { get; set; }Property Value
SecurityEventTokenValidationContext.UnverifiedHeader Property
The token's header as parsed, before any signature check. Shape, not authorship.
public Abblix.Jwt.JsonWebTokenHeader? UnverifiedHeader { get; set; }Property Value
SecurityEventTokenValidationContext.UnverifiedPayload Property
The token's claims as parsed, before any signature check. Shape, not authorship.
public Abblix.Jwt.JsonWebTokenPayload? UnverifiedPayload { get; set; }Property Value
Methods
SecurityEventTokenValidationContext.Establish(SecurityEventTokenValidationStates) Method
Records a fact this step has established.
public void Establish(Abblix.SecurityEvents.Validation.SecurityEventTokenValidationStates state);Parameters
state SecurityEventTokenValidationStates
The flag to set.
SecurityEventTokenValidationContext.Require(SecurityEventTokenValidationStates) Method
Declares the facts this step's safety depends on, failing loudly when the pipeline was composed so that they are not yet established.
public void Require(Abblix.SecurityEvents.Validation.SecurityEventTokenValidationStates required);Parameters
required SecurityEventTokenValidationStates
The facts that must already be established.
Exceptions
System.InvalidOperationException
A required fact is not established.
Remarks
This is the ordering contract of the pipeline. A composition that, say, deserializes event payloads before the signature step - parsing attacker-controlled input with the expensive machinery - dies on its first run with the missing precondition named, instead of running for months with a check silently skipped.