Table of Contents

Class ClaimsBasedNamespaceResolver

Namespace
Cratis.Chronicle
Assembly
Cratis.Chronicle.dll

Represents an implementation of IEventStoreNamespaceResolver that resolves the namespace from the current user's claims.

public class ClaimsBasedNamespaceResolver : IEventStoreNamespaceResolver
Inheritance
ClaimsBasedNamespaceResolver
Implements
Inherited Members

Remarks

This resolver accesses the current ClaimsPrincipal via Thread.CurrentPrincipal to resolve the namespace. It is useful in scenarios where you need to resolve namespaces based on user identity without requiring HTTP context.

Constructors

ClaimsBasedNamespaceResolver(string)

Represents an implementation of IEventStoreNamespaceResolver that resolves the namespace from the current user's claims.

public ClaimsBasedNamespaceResolver(string claimType = "tenant_id")

Parameters

claimType string

The claim type to use for resolving the namespace. Defaults to "tenant_id".

Remarks

This resolver accesses the current ClaimsPrincipal via Thread.CurrentPrincipal to resolve the namespace. It is useful in scenarios where you need to resolve namespaces based on user identity without requiring HTTP context.

Methods

Resolve()

Resolves the current event store namespace.

public EventStoreNamespaceName Resolve()

Returns

EventStoreNamespaceName

The EventStoreNamespaceName to use.