/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/openiddict/openiddict-core for more information concerning
* the license and the contributors participating to this project.
*/
using System.ComponentModel;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Extensions.Logging;
namespace OpenIddict.Server;
///
/// Represents the context associated with an OpenID Connect server request.
///
[EditorBrowsable(EditorBrowsableState.Advanced)]
public sealed class OpenIddictServerTransaction
{
///
/// Gets or sets the cancellation token that will be
/// used to determine if the operation was aborted.
///
///
/// Note: for security reasons, this property shouldn't be used by event
/// handlers to abort security-sensitive operations. As such, it is
/// recommended to use this property only for user-dependent operations.
///
public CancellationToken CancellationToken { get; set; }
///
/// Gets or sets the X.509 client certificate used by the remote peer, if available.
///
public X509Certificate2? RemoteCertificate { get; set; }
///
/// Gets or sets the type of the endpoint processing the current request.
///
public OpenIddictServerEndpointType EndpointType { get; set; }
///
/// Gets or sets the request of the current transaction, if available.
///
public Uri? RequestUri { get; set; }
///
/// Gets or sets the base of the host, if available.
///
public Uri? BaseUri { get; set; }
///
/// Gets or sets the logger associated with the current request.
///
public ILogger Logger { get; set; } = default!;
///
/// Gets or sets the options associated with the current request.
///
public OpenIddictServerOptions Options { get; set; } = default!;
///
/// Gets the additional properties associated with the current request.
///
public Dictionary Properties { get; } = new(StringComparer.OrdinalIgnoreCase);
///
/// Gets or sets the current OpenID Connect request.
///
public OpenIddictRequest? Request { get; set; }
///
/// Gets or sets the current OpenID Connect response being returned.
///
public OpenIddictResponse? Response { get; set; }
}