public static class AtcRestAssemblyTypeInitializer
Provides access to HTTP request context information including identity and correlation identifiers.
Remarks: This interface is typically used in service layers to access request-scoped information without directly depending on
Microsoft.AspNetCore.Http.HttpContext.
public interface IRequestContext
CallingIdentitySummary: Gets the identity of the current caller from the authentication principal.
CorrelationIdSummary: Gets the correlation ID that tracks a request across multiple services.
Remarks: The correlation ID is propagated across service boundaries to enable distributed tracing and tracking of a logical operation that spans multiple microservices.
OnBehalfOfIdentitySummary: Gets the identity of the original caller when the service is acting on behalf of another user or service.
Remarks: In service-to-service scenarios, this represents the end-user identity when a core service makes the request. If not acting on behalf of another identity, this returns the same value as
Atc.Rest.IRequestContext.CallingIdentity.
RequestCancellationTokenSummary: Gets the cancellation token that is triggered when the HTTP request is aborted.
Remarks: This token should be passed to asynchronous operations to allow graceful cancellation when the client disconnects or the request times out.
RequestIdSummary: Gets the unique request ID for the current HTTP request.
Remarks: This ID is used for tracking individual requests and correlating log entries.
Default implementation of Atc.Rest.IRequestContext that provides access to HTTP request context information.
Remarks: This class uses
Microsoft.AspNetCore.Http.IHttpContextAccessorto access the current HTTP context and extract identity, correlation, and request identifiers. It is registered as a transient service whenAtc.Rest.Options.RestApiOptions.UseHttpContextAccessoris enabled.
public class RequestContext : IRequestContext
CallingIdentity
CorrelationId
OnBehalfOfIdentity
RequestCancellationToken
RequestId