Table of Contents

Class DefaultEventService

Namespace
Fdyay.IdentityServer.Events
Assembly
Fdyay.IdentityServer.Core.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class DefaultEventService : IEventService
Inheritance
DefaultEventService
Implements
Derived
Inherited Members

Constructors

DefaultEventService(IOptions<IdentityServerOptions>, IEventSink, TimeProvider)

An event service that raises events to sink, as options switches them on.

public DefaultEventService(IOptions<IdentityServerOptions> options, IEventSink sink, TimeProvider time)

Parameters

options IOptions<IdentityServerOptions>

The server's options; Events decides which event types are raised.

sink IEventSink

Where a raised event goes.

time TimeProvider

The clock an event's TimeStamp is read from.

Exceptions

ArgumentNullException

options is null.

Methods

CanRaiseEventType(EventTypes)

Whether an event of this type would be raised.

public bool CanRaiseEventType(EventTypes eventType)

Parameters

eventType EventTypes

Returns

bool

Remarks

For the call sites where building the event costs something — a lookup, a formatted message — so that cost is not paid to construct an object RaiseAsync(Event, CancellationToken) will drop. Asking is optional: raising an event that is switched off is always safe.

Enrich(Event)

Adds whatever the hosting layer knows and this one does not — the request's identity and addresses.

protected virtual void Enrich(Event evt)

Parameters

evt Event

Remarks

Empty here on purpose. This assembly has no notion of a request, and an event raised outside one — by a background sweep, or a test — has no context to add. The ASP.NET Core host overrides this.

RaiseAsync(Event, CancellationToken)

Raises an event, or does nothing if its type is switched off.

public Task RaiseAsync(Event evt, CancellationToken cancellationToken = default)

Parameters

evt Event
cancellationToken CancellationToken

Returns

Task