Table of Contents

Class MetadataIdentityExtensions

Namespace
Excalibur.Dispatch
Assembly
Excalibur.Dispatch.Abstractions.dll

Extension methods for accessing identity and security metadata from Properties.

public static class MetadataIdentityExtensions
Inheritance
MetadataIdentityExtensions
Inherited Members

Remarks

These properties were moved from the IMessageMetadata interface to the Properties dictionary to keep the core interface minimal. Use these typed extension methods for convenient, type-safe access.

Methods

GetBaggage(IMessageMetadata)

Gets the baggage header for context propagation.

public static string? GetBaggage(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

string

The baggage header, or null if not set.

GetClaims(IMessageMetadata)

Gets the security claims associated with the message context.

public static IReadOnlyCollection<Claim> GetClaims(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

IReadOnlyCollection<Claim>

The collection of claims, or an empty collection if not set.

GetExternalId(IMessageMetadata)

Gets the external identifier for correlation with external systems.

public static string? GetExternalId(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

string

The external identifier, or null if not set.

GetRoles(IMessageMetadata)

Gets the roles associated with the user context.

public static IReadOnlyCollection<string> GetRoles(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

IReadOnlyCollection<string>

The collection of roles, or an empty collection if not set.

GetTenantId(IMessageMetadata)

Gets the tenant identifier for multi-tenant message routing and isolation.

public static string? GetTenantId(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

string

The tenant identifier, or null if not set.

GetTraceParent(IMessageMetadata)

Gets the W3C trace context header for distributed tracing integration.

public static string? GetTraceParent(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

string

The trace parent header, or null if not set.

GetTraceState(IMessageMetadata)

Gets the W3C trace state header for vendor-specific tracing data.

public static string? GetTraceState(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

string

The trace state header, or null if not set.

GetUserId(IMessageMetadata)

Gets the identifier of the user who initiated this message.

public static string? GetUserId(this IMessageMetadata metadata)

Parameters

metadata IMessageMetadata

The message metadata.

Returns

string

The user identifier, or null if not set.