Referencia Pública de API .NETL2 Transversal y FiabilidadEstableAOT: Parcial

EricksonLopez.Auditing

High-performance, Native AOT-ready, cryptographically verifiable, multi-tenant forensic audit trail and change-tracking ecosystem for modern .NET.

16 namespaces130 tipos676 miembrosGenerado desde XML docs y ensamblados · UTC 2026-12-01

Mostrando 130 de 130 tipos (676 miembros)

EricksonLopez.Auditing#

70
class

AesGcmAuditFieldEncryptor

Ensamblado: EricksonLopez.Auditing
public sealed class AesGcmAuditFieldEncryptor : IAuditFieldEncryptor
Implementa: IAuditFieldEncryptor

Implements authenticated AES-256-GCM field-level encryption and GDPR Art. 17 crypto-shredding using an `IAuditCryptoKeyProvider`.

Miembros (5)

  • constructorAesGcmAuditFieldEncryptor
    public AesGcmAuditFieldEncryptor(IAuditCryptoKeyProvider keyProvider)

    Initializes a new instance of the `AesGcmAuditFieldEncryptor` class.

    keyProvider: IAuditCryptoKeyProvider
    The cryptographic key provider managing per-subject AES-256 keys.

    Exceptions: ArgumentNullException: `keyProvider` is `null`

  • methodDecryptAsync
    public async ValueTask<string> DecryptAsync(string ciphertext, string subjectId, CancellationToken cancellationToken = default)

    Decrypts an `ENC:v1:` ciphertext field value using the cryptographic key associated with `subjectId`, or returns `[SHREDDED]` if the subject's key has been permanently destroyed.

    ciphertext: string
    The `ENC:v1:` ciphertext value to decrypt.
    subjectId: string
    The tenant or subject identifier whose encryption key is used.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The decrypted plaintext value, or `[SHREDDED]` if the key was destroyed.

  • methodEncryptAsync
    public async ValueTask<string> EncryptAsync(string plaintext, string subjectId, CancellationToken cancellationToken = default)

    Encrypts a plaintext field value using the cryptographic key associated with `subjectId`.

    plaintext: string
    The plaintext field value to encrypt.
    subjectId: string
    The tenant or subject identifier whose encryption key is used.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The authenticated ciphertext payload formatted with the `ENC:v1:` envelope prefix.

  • fieldEnvelopePrefix
    public const string EnvelopePrefix

    Specifies the prefix prepended to all encrypted field payloads.

  • fieldShreddedPlaceholder
    public const string ShreddedPlaceholder

    Specifies the placeholder returned when attempting to decrypt a field whose subject key has been shredded.

class

AmbientAuditTimeProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed class AmbientAuditTimeProvider : IAuditTimeProvider
Implementa: IAuditTimeProvider

Provides ambient or UTC timestamps with support for deterministic time-freezing scopes in testing and transactions.

Miembros (4)

  • methodBeginScope
    public static IDisposable BeginScope(DateTimeOffset frozenUtc)

    Begins a time scope where `GetUtcNow` returns the specified frozen timestamp until disposed.

    frozenUtc: DateTimeOffset
    The deterministic UTC timestamp to freeze.

    Retorna: A disposable scope that restores the previous ambient time upon disposal.

  • methodGetUtcNow
    public DateTimeOffset GetUtcNow()

    Gets the current deterministic audit timestamp in UTC.

    Retorna: The current UTC timestamp.

  • methodTryGetAmbientTime
    public static bool TryGetAmbientTime(out DateTimeOffset frozenUtc)

    Attempts to retrieve the active frozen ambient UTC timestamp if a deterministic time scope is currently active.

    frozenUtc: out DateTimeOffset
    When this method returns `true`, contains the active frozen UTC timestamp; otherwise, `default`.

    Retorna: `true` if an ambient time scope is currently active; otherwise, `false`.

  • propertyInstance
    public static AmbientAuditTimeProvider Instance { get; }

    Gets the singleton instance of `AmbientAuditTimeProvider`.

record

AuditAction

Ensamblado: EricksonLopez.Auditing.Abstractions
public readonly record struct AuditAction(string Code)

Represents an operation executed by an actor on a resource.

Miembros (29)

  • constructorAuditAction
    public AuditAction(string Code)

    Initializes a new instance of AuditAction.

    Code: string
    A short code identifying the action.
  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • propertyCode
    public string Code { get; init; }

    A short code identifying the action.

  • fieldAccountLockedOut
    public static readonly AuditAction AccountLockedOut

    Represents an action where an account was locked out due to security policy enforcement.

  • fieldApprove
    public static readonly AuditAction Approve

    Represents an action where a resource or request was approved.

  • fieldBreakGlassActivated
    public static readonly AuditAction BreakGlassActivated

    Represents an action where emergency break-glass access was activated.

  • fieldCancel
    public static readonly AuditAction Cancel

    Represents an action where a pending operation was cancelled.

  • fieldCreate
    public static readonly AuditAction Create

    Represents an action where a new resource was created.

  • fieldDelete
    public static readonly AuditAction Delete

    Represents an action where an existing resource was deleted or soft-deleted.

  • fieldDownload
    public static readonly AuditAction Download

    Represents an action where a file or resource was downloaded.

  • fieldExport
    public static readonly AuditAction Export

    Represents an action where data was exported outside the system boundary.

  • fieldGenesisBootstrap
    public static readonly AuditAction GenesisBootstrap

    Represents an action where root `GENESIS` system bootstrap seeding occurred.

  • fieldGrantPermission
    public static readonly AuditAction GrantPermission

    Represents an action where a permission or role was assigned.

  • fieldImpersonationEnded
    public static readonly AuditAction ImpersonationEnded

    Represents an action where a delegated support or impersonation session ended.

  • fieldImpersonationStarted
    public static readonly AuditAction ImpersonationStarted

    Represents an action where a delegated support or impersonation session started.

  • fieldLogin
    public static readonly AuditAction Login

    Represents an action where a user authenticated into the system.

  • fieldLogout
    public static readonly AuditAction Logout

    Represents an action where a user explicitly ended their session.

  • fieldMfaDisabled
    public static readonly AuditAction MfaDisabled

    Represents an action where multi-factor authentication was disabled.

  • fieldMfaEnrolled
    public static readonly AuditAction MfaEnrolled

    Represents an action where multi-factor authentication was enrolled.

  • fieldMfaVerified
    public static readonly AuditAction MfaVerified

    Represents an action where a multi-factor authentication challenge was verified.

  • fieldPlaneSwitched
    public static readonly AuditAction PlaneSwitched

    Represents an action where a principal switched active security execution planes or organizational scopes.

  • fieldRead
    public static readonly AuditAction Read

    Represents an action where a resource was accessed or read.

  • fieldReject
    public static readonly AuditAction Reject

    Represents an action where a resource or request was rejected.

  • fieldRestore
    public static readonly AuditAction Restore

    Represents an action where a resource was restored after soft-deletion.

  • fieldRevokePermission
    public static readonly AuditAction RevokePermission

    Represents an action where a permission or role was revoked.

  • fieldSecretRotated
    public static readonly AuditAction SecretRotated

    Represents an action where a cryptographic key, credential, or secret was rotated.

  • fieldSend
    public static readonly AuditAction Send

    Represents an action where a resource was sent or dispatched.

  • fieldTokenRevoked
    public static readonly AuditAction TokenRevoked

    Represents an action where an authentication token, API key, or session was revoked.

  • fieldUpdate
    public static readonly AuditAction Update

    Represents an action where an existing resource was updated.

record

AuditActor

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditActor(AuditActorType Type, string Id, string? DisplayName)

Represents the authenticated identity that performed an audited action.

Notas:

Exceptions: ArgumentException: `Id` is `null` or white-space

Miembros (6)

  • constructorAuditActor
    public AuditActor(AuditActorType Type, string Id, string? DisplayName = null)

    Initializes a new instance of AuditActor.

    Type: AuditActorType
    The classification category of the actor.
    Id: string
    The stable identifier of the actor.
    DisplayName: string?
    The optional human-readable label for the actor.

    Exceptions: ArgumentException: `Id` is `null` or white-space

  • propertyDisplayName
    public string? DisplayName { get; init; }

    The optional human-readable label for the actor.

  • propertyId
    public string Id { get; init; }

    Gets the stable identifier of the actor.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • propertyType
    public AuditActorType Type { get; init; }

    The classification category of the actor.

  • fieldAnonymous
    public static readonly AuditActor Anonymous

    Gets a predefined actor representing an anonymous or unauthenticated principal.

  • fieldSystem
    public static readonly AuditActor System

    Gets a predefined actor representing the hosting system process.

enum

AuditActorType

Ensamblado: EricksonLopez.Auditing.Abstractions
public enum AuditActorType : byte

Specifies the classification of the entity that performed an audited action.

Miembros (6)

  • fieldAnonymous
    Anonymous = 6

    Specifies an unauthenticated or unidentifiable principal.

  • fieldIntegration
    Integration = 5

    Specifies an external integration or third-party system.

  • fieldScheduledJob
    ScheduledJob = 4

    Specifies an automated scheduled job or background worker.

  • fieldService
    Service = 3

    Specifies an external service acting via service-to-service authentication.

  • fieldSystemProcess
    SystemProcess = 2

    Specifies an internal system process with no human identity.

  • fieldUser
    User = 1

    Specifies an authenticated human user.

record

AuditChange

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditChange(string Field, string? OldValue, string? NewValue, bool IsRedacted)

Represents a single field-level state change captured during an audited action.

Miembros (6)

  • constructorAuditChange
    public AuditChange(string Field, string? OldValue, string? NewValue, bool IsRedacted = false)

    Initializes a new instance of AuditChange.

    Field: string
    The name of the modified property or field.
    OldValue: string?
    The value before the change, or `null` for newly created resources.
    NewValue: string?
    The value after the change, or `null` for deleted resources.
    IsRedacted: bool
    A value indicating whether the actual values were withheld by sensitivity policies.
  • methodRedacted
    public static AuditChange Redacted(string field)

    Creates a redacted change entry for a sensitive field with suppressed values.

    field: string
    The name of the sensitive field that was modified.

    Retorna: A new `AuditChange` instance with `AuditChange.IsRedacted` set to `true`.

  • propertyField
    public string Field { get; init; }

    The name of the modified property or field.

  • propertyIsRedacted
    public bool IsRedacted { get; init; }

    A value indicating whether the actual values were withheld by sensitivity policies.

  • propertyNewValue
    public string? NewValue { get; init; }

    The value after the change, or `null` for deleted resources.

  • propertyOldValue
    public string? OldValue { get; init; }

    The value before the change, or `null` for newly created resources.

class

AuditConfiguration

Ensamblado: EricksonLopez.Auditing
public sealed class AuditConfiguration

Represents runtime configuration options for the auditing pipeline.

Miembros (13)

  • propertyBatchChannelCapacity
    public int BatchChannelCapacity { get; set; }

    Gets or sets the maximum number of records buffered in the batch channel before applying backpressure.

  • propertyBatchFlushInterval
    public TimeSpan BatchFlushInterval { get; set; }

    Gets or sets the maximum duration to wait before flushing a partially filled batch.

  • propertyBatchSize
    public int BatchSize { get; set; }

    Gets or sets the maximum number of records persisted per batch flush operation.

  • propertyCriticalActionCodes
    public HashSet<string> CriticalActionCodes { get; }

    Gets the set of action codes for which store failures must always propagate regardless of `DefaultFailureBehavior`.

  • propertyDefaultFailureBehavior
    public AuditFailureBehavior DefaultFailureBehavior { get; set; }

    Gets or sets the default failure handling behavior when the audit store fails.

    Defaults to `AuditFailureBehavior.FailClosed`.

  • propertyEnableIntegrityChain
    public bool EnableIntegrityChain { get; set; }

    Gets or sets a value indicating whether HMAC chain integrity verification is enabled globally.

  • propertyEnableSecurityAlerts
    public bool EnableSecurityAlerts { get; set; }

    Gets or sets a value indicating whether real-time security alerting via `SecurityAlertAuditStoreDecorator` is enabled.

  • propertyEncryptedFields
    public HashSet<string> EncryptedFields { get; }

    Gets the set of field names whose change values must be encrypted using authenticated AES-256-GCM via `IAuditCryptoKeyProvider` to support GDPR Art. 17 Crypto-Shredding.

  • propertyEntityActorResolution
    public EntityAuditActorResolution EntityActorResolution { get; set; }

    Gets or sets how `IEntityAuditStamper` resolves the stamped actor identifier during active delegated impersonation. Defaults to `EntityAuditActorResolution.EffectiveOperator` (`ImpersonatorId ?? ActorId`).

  • propertyFailClosedOnImpersonation
    public bool FailClosedOnImpersonation { get; set; }

    Gets or sets a value indicating whether delegated support impersonation records always enforce fail-closed persistence regardless of `DefaultFailureBehavior`. Defaults to `true`.

  • propertyGlobalFieldDenylist
    public HashSet<string> GlobalFieldDenylist { get; }

    Gets the global set of field names always excluded from change tracking records across all types.

  • propertyMaxStringLength
    public int MaxStringLength { get; set; }

    Gets or sets the maximum allowed string length for change values.

    Strings exceeding this length will be truncated to prevent Large Object Heap (LOH) allocations and database exceptions. Defaults to 4000 characters. Values are clamped to a maximum limit of 8192 characters.

  • propertySanitizeContextMetadata
    public bool SanitizeContextMetadata { get; set; }

    Gets or sets a value indicating whether sensitive secret keys inside `AuditContext.Metadata` are automatically redacted to `[REDACTED]`. Defaults to `true`.

record

AuditContext

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditContext(TenantId TenantId, string Source, string? CorrelationId, string? CausationId, string? RequestId, string? IpAddress, string? UserAgent, string? IdempotencyKey, IReadOnlyDictionary<string, string>? Metadata)

Encapsulates technical execution context metadata for an audited action.

Notas:

Exceptions: ArgumentException: `Source` is `null` or white-space

Miembros (16)

  • constructorAuditContext
    public AuditContext(TenantId TenantId, string Source, string? CorrelationId = null, string? CausationId = null, string? RequestId = null, string? IpAddress = null, string? UserAgent = null, string? IdempotencyKey = null, IReadOnlyDictionary<string, string>? Metadata = null)

    Initializes a new instance of AuditContext.

    TenantId: TenantId
    The tenant identifier scoping the audit record.
    Source: string
    The application or service component that generated the audit record.
    CorrelationId: string?
    The optional correlation identifier linking related operations across services.
    CausationId: string?
    The optional identifier of the direct causal event or command.
    RequestId: string?
    The optional transport-level request identifier.
    IpAddress: string?
    The optional network IP address of the originating client.
    UserAgent: string?
    The optional user agent string from the originating client request.
    IdempotencyKey: string?
    The optional idempotency key preventing duplicate writes during concurrent retries.
    Metadata: IReadOnlyDictionary<string, string>?
    The optional ambient key-value metadata propagated from `AuditScope` or enrichers.

    Exceptions: ArgumentException: `Source` is `null` or white-space

  • methodAnonymizeIp
    public static string? AnonymizeIp(string? ipAddress)

    Anonymizes the specified IP address for privacy compliance.

    ipAddress: string?
    The IP address string to anonymize.

    Retorna: The anonymized IP address string, or `null` if input is `null`, white-space, or invalid.

  • propertyCausationId
    public string? CausationId { get; init; }

    The optional identifier of the direct causal event or command.

  • propertyCorrelationId
    public string? CorrelationId { get; init; }

    The optional correlation identifier linking related operations across services.

  • propertyExecutionPlane
    public AuditExecutionPlane ExecutionPlane { get; init; }

    Gets the security execution plane in which the audited action occurred. Defaults to `AuditExecutionPlane.Unspecified`.

  • propertyIdempotencyKey
    public string? IdempotencyKey { get; init; }

    The optional idempotency key preventing duplicate writes during concurrent retries.

  • propertyIpAddress
    public string? IpAddress { get; init; }

    The optional network IP address of the originating client.

  • propertyMetadata
    public IReadOnlyDictionary<string, string>? Metadata { get; init; }

    The optional ambient key-value metadata propagated from `AuditScope` or enrichers.

  • propertyOrganizationId
    public string? OrganizationId { get; init; }

    Gets the optional hierarchical sub-tenant organization, company, or workspace identifier scoping the operation.

  • propertyRequestId
    public string? RequestId { get; init; }

    The optional transport-level request identifier.

  • propertySource
    public string Source { get; init; }

    Gets the application or service component that generated the audit record.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • propertyTenantId
    public TenantId TenantId { get; init; }

    The tenant identifier scoping the audit record.

  • propertyUserAgent
    public string? UserAgent { get; init; }

    The optional user agent string from the originating client request.

  • fieldBootstrapTenantId
    public static readonly TenantId BootstrapTenantId

    Gets the reserved tenant identifier for deterministic system bootstrap and root genesis initialization events.

  • fieldControlPlaneTenantId
    public static readonly TenantId ControlPlaneTenantId

    Gets the reserved tenant identifier for SaaS control-plane operations not bound to a customer tenant.

  • fieldSystemTenantId
    public static readonly TenantId SystemTenantId

    Gets the reserved tenant identifier for system-level or platform-wide events.

class

AuditCursorToken

Ensamblado: EricksonLopez.Auditing.Abstractions
public static class AuditCursorToken

Provides methods for encoding and decoding composite pagination cursor tokens.

Miembros (2)

  • methodCreate
    public static string Create(DateTimeOffset occurredAt, Guid id)

    Creates a base64-encoded continuation token containing the occurred_at timestamp and unique identifier.

    occurredAt: DateTimeOffset
    The occurrence timestamp of the record.
    id: Guid
    The unique identifier of the record.

    Retorna: A base64-encoded continuation token string.

  • methodTryParse
    public static bool TryParse(string? token, out DateTimeOffset occurredAt, out Guid id)

    Attempts to parse a base64-encoded continuation token into its timestamp and identifier components.

    token: string?
    The continuation token to parse.
    occurredAt: out DateTimeOffset
    When this method returns, contains the parsed occurrence timestamp if parsing succeeded; otherwise, the default value.
    id: out Guid
    When this method returns, contains the parsed record identifier if parsing succeeded; otherwise, an empty identifier.

    Retorna: `true` if the token was parsed successfully; otherwise, `false`.

enum

AuditExecutionPlane

Ensamblado: EricksonLopez.Auditing.Abstractions
public enum AuditExecutionPlane : byte

Specifies the isolated security execution plane in which an audited operation occurred.

Miembros (5)

  • fieldBootstrap
    Bootstrap = 4

    Specifies the deterministic system initialization, migration, or root genesis seeding plane (`BOOTSTRAP`).

  • fieldControl
    Control = 2

    Specifies the SaaS platform operator and cross-tenant administration plane (`CONTROL`).

  • fieldService
    Service = 3

    Specifies the machine-to-machine or non-human service principal execution plane (`M2M`).

  • fieldTenant
    Tenant = 1

    Specifies the customer or tenant operational execution plane (`TENANT`).

  • fieldUnspecified
    Unspecified = 0

    Specifies that no explicit execution plane classification was assigned.

class

AuditExecutionPlaneExtensions

Ensamblado: EricksonLopez.Auditing.Abstractions
public static class AuditExecutionPlaneExtensions

Provides wire-format serialization and parsing helpers for `AuditExecutionPlane`.

Miembros (2)

  • methodToWireCode
    public static string ToWireCode(this AuditExecutionPlane plane)

    Converts the specified `AuditExecutionPlane` to its canonical uppercase wire code.

    plane: this AuditExecutionPlane
    The execution plane value to convert.

    Retorna: The canonical wire code (`UNSPECIFIED`, `TENANT`, `CONTROL`, `M2M`, or `BOOTSTRAP`).

    Exceptions: ArgumentOutOfRangeException: `plane` is not a defined `AuditExecutionPlane` value.

  • methodTryParseWireCode
    public static bool TryParseWireCode(string? raw, out AuditExecutionPlane plane)

    Attempts to parse a wire code string into an `AuditExecutionPlane` value.

    raw: string?
    The raw wire code string to parse.
    plane: out AuditExecutionPlane
    When this method returns, contains the parsed `AuditExecutionPlane` if parsing succeeded; otherwise, `AuditExecutionPlane.Unspecified`.

    Retorna: `true` if `raw` was successfully parsed; otherwise, `false`.

enum

AuditFailureBehavior

Ensamblado: EricksonLopez.Auditing
public enum AuditFailureBehavior

Specifies the failure handling policy when persisting an audit record fails.

Miembros (3)

  • fieldDeferred
    Deferred = 3

    Enqueues the record for deferred processing via a resilient background mechanism.

  • fieldFailClosed
    FailClosed = 1

    Propagates the store exception to the caller, blocking the business operation.

  • fieldFailOpen
    FailOpen = 2

    Suppresses the store exception and allows the business operation to proceed.

class

AuditFieldComparer

Ensamblado: EricksonLopez.Auditing
public static class AuditFieldComparer

Provides deterministic comparison of original and current property values to detect auditable mutations.

Miembros (1)

  • methodAreDifferent
    public static bool AreDifferent(object? originalValue, object? currentValue)

    Determines whether the original and current values of an audited field differ.

    originalValue: object?
    The value prior to mutation.
    currentValue: object?
    The value after mutation.

    Retorna: `true` if the values differ and should be recorded in the audit trail; otherwise, `false`.

enum

AuditFieldSensitivity

Ensamblado: EricksonLopez.Auditing
public enum AuditFieldSensitivity

Specifies how sensitive field values are handled in change tracking records.

Notas:

`AuditSensitivityPipeline.ApplyAsync` automatically enforces the following policies: - Fields whose names match any entry in `AuditConfiguration.GlobalFieldDenylist` (case-insensitive) are completely excluded from the change list — equivalent to `Exclude`. - `AuditChange` entries with `AuditChange.IsRedacted` set to `true` (or created via `AuditChange.Redacted`) have their values suppressed — equivalent to `Redact`. `Hash` is NOT automatically applied by `AuditSensitivityPipeline.ApplyAsync`. To store a one-way hash of a sensitive value, the caller must explicitly call `AuditSensitivityPipeline.HashValue` and pass the result as the field value.

Miembros (5)

  • fieldEncrypt
    Encrypt = 4

    Encrypts the field value using authenticated AES-256-GCM with the subject or tenant key managed by `IAuditCryptoKeyProvider` to support GDPR Art. 17 Crypto-Shredding.

  • fieldExclude
    Exclude = 1

    Excludes the field entirely from change tracking records.

  • fieldHash
    Hash = 3

    Replaces the field value with its SHA-256 cryptographic digest to support equality comparison without revealing plaintext.

    This value is not automatically applied by `AuditSensitivityPipeline.ApplyAsync`. To hash a field value, call `AuditSensitivityPipeline.HashValue` explicitly and pass the resulting hex string as the change value.

  • fieldInclude
    Include = 0

    Records the field value without modification.

  • fieldRedact
    Redact = 2

    Records the field name but replaces the value with a redaction indicator.

class

AuditId

Ensamblado: EricksonLopez.Auditing
public static class AuditId

Provides factory methods for generating time-ordered unique identifiers.

Miembros (1)

  • methodNewId
    public static Guid NewId()

    Creates a new time-ordered unique identifier conforming to UUIDv7.

    Retorna: A new time-ordered `Guid` identifier.

    Embeds a millisecond-precision Unix timestamp in the most significant bits, ensuring monotonic chronological ordering within a partition when used as a primary key.

record

AuditImpersonation

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditImpersonation(string ImpersonatorId, string Justification, string? TicketReference, string? SessionId, AuditActorType ImpersonatorType, string? ImpersonatorDisplayName)

Represents non-repudiable delegated execution or support impersonation metadata attached to an `AuditRecord`.

Notas:

Exceptions: ArgumentException: `ImpersonatorId` or `Justification` is `null` or white-space, or `TicketReference` or `SessionId` is empty or white-space when provided.

Miembros (9)

  • constructorAuditImpersonation
    public AuditImpersonation(string ImpersonatorId, string Justification, string? TicketReference = null, string? SessionId = null, AuditActorType ImpersonatorType = AuditActorType.User, string? ImpersonatorDisplayName = null)

    Initializes a new instance of AuditImpersonation.

    ImpersonatorId: string
    The stable identifier of the real operator executing the action on behalf of the target `AuditActor`.
    Justification: string
    The mandatory human-readable reason justifying the delegated or impersonated access.
    TicketReference: string?
    The optional verified support ticket or change-management reference authorizing the session.
    SessionId: string?
    The optional bounded impersonation session identifier.
    ImpersonatorType: AuditActorType
    The actor classification of the impersonating operator. Defaults to `AuditActorType.User`.
    ImpersonatorDisplayName: string?
    The optional human-readable display name of the impersonating operator.

    Exceptions: ArgumentException: `ImpersonatorId` or `Justification` is `null` or white-space, or `TicketReference` or `SessionId` is empty or white-space when provided.

  • methodForSupportSession
    public static AuditImpersonation ForSupportSession(string impersonatorId, string ticketReference, string justification, string? sessionId = null, string? impersonatorDisplayName = null)

    Creates a delegated support impersonation context requiring both a verified support ticket reference and an explicit justification.

    impersonatorId: string
    The identifier of the platform support operator.
    ticketReference: string
    The verified support ticket reference authorizing access.
    justification: string
    The explicit operational justification for the session.
    sessionId: string?
    The optional bounded impersonation session identifier.
    impersonatorDisplayName: string?
    The optional display name of the support operator.

    Retorna: A validated `AuditImpersonation` instance.

    Exceptions: ArgumentException: `impersonatorId`, `ticketReference`, or `justification` is `null` or white-space.

  • methodValidateTarget
    public void ValidateTarget(AuditActor targetActor, AuditSecurityClassification targetClassification = AuditSecurityClassification.Standard)

    Validates that the impersonation context satisfies security ceiling and anti-self-impersonation invariants for the target actor.

    targetActor: AuditActor
    The impersonated target actor.
    targetClassification: AuditSecurityClassification
    The security classification of the target account or operation.

    Exceptions: ArgumentNullException: `targetActor` is `null`.; InvalidOperationException: Self-impersonation is attempted, the target is an unauthenticated/system actor, or the target holds `AuditSecurityClassification.BreakGlass` or `AuditSecurityClassification.Genesis` classification.

  • propertyImpersonatorDisplayName
    public string? ImpersonatorDisplayName { get; init; }

    The optional human-readable display name of the impersonating operator.

  • propertyImpersonatorId
    public string ImpersonatorId { get; init; }

    Gets the stable identifier of the real operator executing the action on behalf of the target actor.

    Exceptions: ArgumentException: `value` is `null` or white-space.

  • propertyImpersonatorType
    public AuditActorType ImpersonatorType { get; init; }

    The actor classification of the impersonating operator. Defaults to `AuditActorType.User`.

  • propertyJustification
    public string Justification { get; init; }

    Gets the mandatory human-readable reason justifying the delegated or impersonated access.

    Exceptions: ArgumentException: `value` is `null` or white-space.

  • propertySessionId
    public string? SessionId { get; init; }

    Gets the optional bounded impersonation session identifier.

    Exceptions: ArgumentException: `value` is empty or white-space when non-null.

  • propertyTicketReference
    public string? TicketReference { get; init; }

    Gets the optional verified support ticket or change-management reference authorizing the session.

    Exceptions: ArgumentException: `value` is empty or white-space when non-null.

record

AuditIntegrityVerificationResult

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditIntegrityVerificationResult(bool IsValid, int VerifiedCount, Guid? FirstFailedRecordId, string? FailureReason)

Represents the outcome of an audit chain cryptographic verification operation.

Miembros (5)

  • constructorAuditIntegrityVerificationResult
    public AuditIntegrityVerificationResult(bool IsValid, int VerifiedCount, Guid? FirstFailedRecordId = null, string? FailureReason = null)

    Initializes a new instance of AuditIntegrityVerificationResult.

    IsValid: bool
    A value indicating whether all audit records in the range passed integrity verification.
    VerifiedCount: int
    The total number of audit records evaluated during verification.
    FirstFailedRecordId: Guid?
    The identifier of the first record that failed verification, if any; otherwise, `null`.
    FailureReason: string?
    A description of the failure reason if verification failed; otherwise, `null`.
  • propertyFailureReason
    public string? FailureReason { get; init; }

    A description of the failure reason if verification failed; otherwise, `null`.

  • propertyFirstFailedRecordId
    public Guid? FirstFailedRecordId { get; init; }

    The identifier of the first record that failed verification, if any; otherwise, `null`.

  • propertyIsValid
    public bool IsValid { get; init; }

    A value indicating whether all audit records in the range passed integrity verification.

  • propertyVerifiedCount
    public int VerifiedCount { get; init; }

    The total number of audit records evaluated during verification.

class

AuditLogger<TCategoryName>

Ensamblado: EricksonLopez.Auditing
public sealed class AuditLogger<TCategoryName> : IAuditLogger<TCategoryName>
Implementa: IAuditLogger<TCategoryName>

Provides an implementation of `IAuditLogger<TCategoryName>` that constructs, enriches, and appends `AuditRecord` instances.

Notas:

Type parameters: TCategoryName: The category type associated with logged audit records.

Miembros (2)

  • constructorAuditLogger
    public AuditLogger(IAuditStore store, IAuditActorProvider actorProvider, IAuditContextProvider? contextProvider = null, IEnumerable<IAuditEnricher>? enrichers = null, TimeProvider? timeProvider = null)

    Initializes a new instance of the `AuditLogger<TCategoryName>` class.

    store: IAuditStore
    The store used to persist audit records.
    actorProvider: IAuditActorProvider
    The provider to resolve the current actor.
    contextProvider: IAuditContextProvider?
    The optional provider to resolve ambient context.
    enrichers: IEnumerable<IAuditEnricher>?
    The optional sequence of enrichers to augment audit records before persistence.
    timeProvider: TimeProvider?
    The optional deterministic `TimeProvider`. Defaults to `TimeProvider.System` when `null`.

    Exceptions: ArgumentNullException: `store` or `actorProvider` is `null`

  • methodLogAsync
    public async ValueTask LogAsync(AuditAction action, AuditResource resource, AuditOutcome outcome, CancellationToken cancellationToken = default)

    Logs an audit event asynchronously.

    action: AuditAction
    The operation that was executed.
    resource: AuditResource
    The target resource on which the operation was performed.
    outcome: AuditOutcome
    The observable result of the operation.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation.

class

AuditMerkleTree

Ensamblado: EricksonLopez.Auditing.Abstractions
public static class AuditMerkleTree

Provides deterministic, second-preimage-resistant binary SHA-256 Merkle tree root computation and constant-time batch integrity verification for sealed audit batches.

Miembros (2)

  • methodComputeRoot
    public static string? ComputeRoot(IReadOnlyList<string> recordHashes)

    Computes the deterministic binary SHA-256 Merkle root over an ordered sequence of audit record hashes.

    recordHashes: IReadOnlyList<string>
    The ordered sequence of non-empty record integrity hashes.

    Retorna: The lowercase 64-character hexadecimal SHA-256 Merkle root, or `null` if `recordHashes` is empty.

    Odd-numbered tree levels incorporate a positional index nonce rather than duplicating the trailing node, mitigating leaf-duplication collision vulnerabilities (CVE-2012-2459). Exceptions: ArgumentNullException: `recordHashes` is `null`.; ArgumentException: `recordHashes` contains a `null` or white-space hash entry.

  • methodVerifyRoot
    public static bool VerifyRoot(IReadOnlyList<string> recordHashes, string? expectedMerkleRoot)

    Verifies in constant time whether the recomputed Merkle root for the specified ordered hashes matches the expected sealed Merkle root.

    recordHashes: IReadOnlyList<string>
    The ordered sequence of record integrity hashes in the batch.
    expectedMerkleRoot: string?
    The expected sealed 64-character hexadecimal Merkle root.

    Retorna: `true` if the batch hashes are non-empty and match `expectedMerkleRoot`; otherwise, `false`.

    Exceptions: ArgumentNullException: `recordHashes` is `null`.

enum

AuditOutcome

Ensamblado: EricksonLopez.Auditing.Abstractions
public enum AuditOutcome : byte

Specifies the observable result of an audited action.

Miembros (5)

  • fieldCancelled
    Cancelled = 4

    Specifies that the action was cancelled before completion.

  • fieldDenied
    Denied = 3

    Specifies that the action was rejected due to insufficient permissions.

  • fieldFailure
    Failure = 2

    Specifies that the action failed due to a runtime or validation error.

  • fieldPartial
    Partial = 5

    Specifies that the action completed partially with mixed results.

  • fieldSuccess
    Success = 1

    Specifies that the action completed successfully.

record

AuditQuery

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditQuery

Represents filtering and keyset pagination parameters for querying persisted audit records.

Miembros (17)

  • propertyActionCode
    public string? ActionCode { get; init; }

    Gets the optional action code filter.

  • propertyActorId
    public string? ActorId { get; init; }

    Gets the optional actor identifier filter.

  • propertyContinuationToken
    public string? ContinuationToken { get; init; }

    Gets the optional keyset continuation cursor indicating the exact page cutoff point from the previous page.

  • propertyCorrelationId
    public string? CorrelationId { get; init; }

    Gets the optional correlation identifier filter.

  • propertyExecutionPlane
    public AuditExecutionPlane? ExecutionPlane { get; init; }

    Gets the optional security execution plane filter.

  • propertyFrom
    public DateTimeOffset? From { get; init; }

    Gets the optional earliest occurrence timestamp filter, inclusive.

  • propertyImpersonatorId
    public string? ImpersonatorId { get; init; }

    Gets the optional delegated support or impersonating operator identifier filter.

  • propertyIncludeTotalCount
    public bool IncludeTotalCount { get; init; }

    Gets a value indicating whether the query should compute and return the total count of matching records in `AuditQueryResult.TotalCount`. Defaults to `false` to preserve $O(1)$ keyset pagination performance.

  • propertyOrganizationId
    public string? OrganizationId { get; init; }

    Gets the optional sub-tenant organization or company identifier filter.

  • propertyOutcome
    public AuditOutcome? Outcome { get; init; }

    Gets the optional outcome status filter.

  • propertyPageSize
    public int PageSize { get; init; }

    Gets the maximum number of records to return in a single page.

  • propertyResourceId
    public string? ResourceId { get; init; }

    Gets the optional resource identifier filter.

  • propertyResourceType
    public string? ResourceType { get; init; }

    Gets the optional resource type filter.

  • propertySecurityClassification
    public AuditSecurityClassification? SecurityClassification { get; init; }

    Gets the optional security criticality classification filter.

  • propertySortDirection
    public AuditSortDirection SortDirection { get; init; }

    Gets the chronological sort direction for the query. Defaults to `AuditSortDirection.Ascending`.

  • propertyTenantId
    public required TenantId TenantId { get; init; }

    Gets the tenant identifier scoping the query.

  • propertyTo
    public DateTimeOffset? To { get; init; }

    Gets the optional latest occurrence timestamp filter, inclusive.

record

AuditQueryResult

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditQueryResult(IReadOnlyList<AuditRecord> Records, string? NextPageToken, bool HasMore, long? TotalCount)

Represents the paginated results of an audit record query operation.

Miembros (5)

  • constructorAuditQueryResult
    public AuditQueryResult(IReadOnlyList<AuditRecord> Records, string? NextPageToken, bool HasMore, long? TotalCount = null)

    Initializes a new instance of AuditQueryResult.

    Records: IReadOnlyList<AuditRecord>
    The collection of matching audit records returned for this page.
    NextPageToken: string?
    The continuation token to supply as `AuditQuery.ContinuationToken` for the next page, or `null` if on the final page.
    HasMore: bool
    A value indicating whether additional matching records exist beyond the current page.
    TotalCount: long?
    The optional total number of matching records across all pages when `AuditQuery.IncludeTotalCount` is `true`; otherwise `null`.
  • propertyHasMore
    public bool HasMore { get; init; }

    A value indicating whether additional matching records exist beyond the current page.

  • propertyNextPageToken
    public string? NextPageToken { get; init; }

    The continuation token to supply as `AuditQuery.ContinuationToken` for the next page, or `null` if on the final page.

  • propertyRecords
    public IReadOnlyList<AuditRecord> Records { get; init; }

    The collection of matching audit records returned for this page.

  • propertyTotalCount
    public long? TotalCount { get; init; }

    The optional total number of matching records across all pages when `AuditQuery.IncludeTotalCount` is `true`; otherwise `null`.

record

AuditRecord

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditRecord

Represents the canonical, immutable evidence record of an audited event.

Notas:

Audit records are immutable once persisted and capture the complete actor, action, resource, context, and outcome details.

Miembros (13)

  • propertyAction
    public required AuditAction Action { get; init; }

    Gets the operation that was executed.

  • propertyActor
    public required AuditActor Actor { get; init; }

    Gets the identity that performed the action.

  • propertyChanges
    public IReadOnlyList<AuditChange>? Changes { get; init; }

    Gets the optional collection of field-level changes captured during the action.

  • propertyContext
    public required AuditContext Context { get; init; }

    Gets the technical execution context at the time of the action.

  • propertyErrorCode
    public string? ErrorCode { get; init; }

    Gets the optional error category or code when the outcome is unsuccessful.

  • propertyId
    public required Guid Id { get; init; }

    Gets the unique, time-ordered identifier of this record.

  • propertyImpersonation
    public AuditImpersonation? Impersonation { get; init; }

    Gets the optional delegated execution or support impersonation metadata when an operator acts on behalf of another actor.

  • propertyIntegrityHash
    public string? IntegrityHash { get; init; }

    Gets the optional cryptographic HMAC hash computed for this record and chained to previous records.

  • propertyOccurredAt
    public required DateTimeOffset OccurredAt { get; init; }

    Gets the exact UTC timestamp when the action occurred.

  • propertyOutcome
    public required AuditOutcome Outcome { get; init; }

    Gets the observable result of the operation.

  • propertyPreviousHash
    public string? PreviousHash { get; init; }

    Gets the optional cryptographic hash of the immediately preceding record in the chain.

  • propertyResource
    public required AuditResource Resource { get; init; }

    Gets the target resource on which the operation was performed.

  • propertySecurityClassification
    public AuditSecurityClassification SecurityClassification { get; init; }

    Gets the security criticality and privilege tier of this audit record. Defaults to `AuditSecurityClassification.Standard`.

class

AuditRecordBuilder

Ensamblado: EricksonLopez.Auditing
public sealed class AuditRecordBuilder

Provides a fluent builder for constructing immutable `AuditRecord` instances.

Miembros (36)

  • methodAddChange
    public AuditRecordBuilder AddChange(string field, string? oldValue, string? newValue, bool isRedacted = false)

    Adds a property modification change.

    field: string
    The property name.
    oldValue: string?
    The original value.
    newValue: string?
    The updated value.
    isRedacted: bool
    Indicates whether the change is redacted.

    Retorna: The builder instance.

  • methodAddRedactedChange
    public AuditRecordBuilder AddRedactedChange(string field)

    Adds a redacted property change.

    field: string
    The property name.

    Retorna: The builder instance.

  • methodAsBreakGlassActivity
    public AuditRecordBuilder AsBreakGlassActivity(AuditExecutionPlane plane = AuditExecutionPlane.Control)

    Marks the audit record as emergency `BreakGlass` principal activity.

    plane: AuditExecutionPlane
    The execution plane. Defaults to `AuditExecutionPlane.Control`.

    Retorna: The builder instance.

  • methodAsGenesisActivity
    public AuditRecordBuilder AsGenesisActivity(AuditExecutionPlane plane = AuditExecutionPlane.Control)

    Marks the audit record as root `GENESIS` identity activity on the control or bootstrap plane.

    plane: AuditExecutionPlane
    The execution plane. Defaults to `AuditExecutionPlane.Control`.

    Retorna: The builder instance.

  • methodBuild
    public AuditRecord Build()

    Builds the immutable `AuditRecord` instance, propagating ambient `AuditScope.Current` values where not explicitly overridden.

    Retorna: A constructed `AuditRecord`.

  • methodBuildDefault
    public static AuditRecord BuildDefault(string tenantId = "", string actorId = "", string resourceType = "", string resourceId = "", AuditOutcome outcome = AuditOutcome.Success, string? correlationId = null)

    Creates a pre-configured `AuditRecord` instance with optional field overrides.

    tenantId: string
    The tenant identifier.
    actorId: string
    The actor identifier.
    resourceType: string
    The resource type.
    resourceId: string
    The resource identifier.
    outcome: AuditOutcome
    The outcome status.
    correlationId: string?
    The optional correlation identifier.

    Retorna: A new `AuditRecord` instance with the specified values.

  • methodCreate
    public static AuditRecordBuilder Create()

    Creates a new instance of the `AuditRecordBuilder` class.

    Retorna: A new `AuditRecordBuilder` instance.

  • methodWithAction
    public AuditRecordBuilder WithAction(AuditAction action)

    Sets the action that was performed.

    action: AuditAction
    The audit action.

    Retorna: The builder instance.

  • methodWithAction
    public AuditRecordBuilder WithAction(string code)

    Sets the action code that was performed.

    code: string
    The action code.

    Retorna: The builder instance.

  • methodWithActor
    public AuditRecordBuilder WithActor(AuditActor actor)

    Sets the actor that executed the action.

    actor: AuditActor
    The actor details.

    Retorna: The builder instance.

    Exceptions: ArgumentNullException: `actor` is `null`

  • methodWithActor
    public AuditRecordBuilder WithActor(AuditActorType type, string id, string? displayName = null)

    Sets the actor details that executed the action.

    type: AuditActorType
    The actor type classification.
    id: string
    The actor identifier.
    displayName: string?
    The optional actor display name.

    Retorna: The builder instance.

  • methodWithCausationId
    public AuditRecordBuilder WithCausationId(string? causationId)

    Sets the causation identifier.

    causationId: string?
    The causation identifier.

    Retorna: The builder instance.

  • methodWithChanges
    public AuditRecordBuilder WithChanges(IEnumerable<AuditChange>? changes)

    Sets the complete changes collection.

    changes: IEnumerable<AuditChange>?
    The changes collection.

    Retorna: The builder instance.

  • methodWithCorrelationId
    public AuditRecordBuilder WithCorrelationId(string? correlationId)

    Sets the correlation identifier.

    correlationId: string?
    The correlation identifier.

    Retorna: The builder instance.

  • methodWithErrorCode
    public AuditRecordBuilder WithErrorCode(string? errorCode)

    Sets the error code if outcome is a failure.

    errorCode: string?
    The error code.

    Retorna: The builder instance.

  • methodWithExecutionPlane
    public AuditRecordBuilder WithExecutionPlane(AuditExecutionPlane executionPlane)

    Sets the security execution plane (`CONTROL`, `TENANT`, `M2M`, or `BOOTSTRAP`).

    executionPlane: AuditExecutionPlane
    The execution plane classification.

    Retorna: The builder instance.

  • methodWithId
    public AuditRecordBuilder WithId(Guid id)

    Sets the unique identifier for the audit record.

    id: Guid
    The unique identifier.

    Retorna: The builder instance.

  • methodWithIdempotencyKey
    public AuditRecordBuilder WithIdempotencyKey(string? idempotencyKey)

    Sets the idempotency key for deduplicating retry attempts.

    idempotencyKey: string?
    The idempotency key.

    Retorna: The builder instance.

  • methodWithImpersonation
    public AuditRecordBuilder WithImpersonation(AuditImpersonation? impersonation)

    Sets the delegated execution or support impersonation metadata.

    impersonation: AuditImpersonation?
    The impersonation context, or `null` to clear.

    Retorna: The builder instance.

  • methodWithIntegrityHash
    public AuditRecordBuilder WithIntegrityHash(string? hash, string? previousHash = null)

    Sets the cryptographic integrity hash.

    hash: string?
    The HMAC hash.
    previousHash: string?
    The optional preceding hash in the chain.

    Retorna: The builder instance.

  • methodWithIpAddress
    public AuditRecordBuilder WithIpAddress(string? ipAddress)

    Sets the client IP address.

    ipAddress: string?
    The client IP address.

    Retorna: The builder instance.

  • methodWithMetadata
    public AuditRecordBuilder WithMetadata(IReadOnlyDictionary<string, string>? metadata)

    Sets the context metadata dictionary.

    metadata: IReadOnlyDictionary<string, string>?
    The metadata entries to include.

    Retorna: The builder instance.

  • methodWithMetadata
    public AuditRecordBuilder WithMetadata(string key, string value)

    Adds or updates a context metadata key-value entry.

    key: string
    The metadata key.
    value: string
    The metadata value.

    Retorna: The builder instance.

  • methodWithOccurredAt
    public AuditRecordBuilder WithOccurredAt(DateTimeOffset occurredAt)

    Sets the UTC timestamp when the action occurred.

    occurredAt: DateTimeOffset
    The occurrence timestamp.

    Retorna: The builder instance.

  • methodWithOrganizationId
    public AuditRecordBuilder WithOrganizationId(string? organizationId)

    Sets the optional hierarchical sub-tenant organization or company identifier.

    organizationId: string?
    The organization or company identifier.

    Retorna: The builder instance.

  • methodWithOutcome
    public AuditRecordBuilder WithOutcome(AuditOutcome outcome)

    Sets the outcome of the audited action.

    outcome: AuditOutcome
    The outcome classification.

    Retorna: The builder instance.

  • methodWithPreviousHash
    public AuditRecordBuilder WithPreviousHash(string? previousHash)

    Sets the cryptographic hash of the preceding record in the chain.

    previousHash: string?
    The previous record hash to set.

    Retorna: The builder instance.

  • methodWithRequestId
    public AuditRecordBuilder WithRequestId(string? requestId)

    Sets the request identifier.

    requestId: string?
    The request identifier.

    Retorna: The builder instance.

  • methodWithResource
    public AuditRecordBuilder WithResource(AuditResource resource)

    Sets the target resource.

    resource: AuditResource
    The audit resource.

    Retorna: The builder instance.

    Exceptions: ArgumentNullException: `resource` is `null`

  • methodWithResource
    public AuditRecordBuilder WithResource(string type, string id, string? aggregateType = null, string? aggregateId = null)

    Sets the target resource details.

    type: string
    The resource type.
    id: string
    The resource identifier.
    aggregateType: string?
    The optional aggregate root type.
    aggregateId: string?
    The optional aggregate root identifier.

    Retorna: The builder instance.

  • methodWithSecurityClassification
    public AuditRecordBuilder WithSecurityClassification(AuditSecurityClassification classification)

    Sets the security criticality classification of the audit record.

    classification: AuditSecurityClassification
    The security classification.

    Retorna: The builder instance.

  • methodWithSource
    public AuditRecordBuilder WithSource(string source)

    Sets the system or component source name.

    source: string
    The source identifier.

    Retorna: The builder instance.

    Exceptions: ArgumentException: `source` is `null` or empty

  • methodWithSupportImpersonation
    public AuditRecordBuilder WithSupportImpersonation(string impersonatorId, string ticketReference, string justification, string? sessionId = null, string? impersonatorDisplayName = null)

    Configures a delegated support impersonation context requiring a verified ticket reference and justification.

    impersonatorId: string
    The support operator identifier.
    ticketReference: string
    The verified support ticket reference.
    justification: string
    The mandatory justification for the support session.
    sessionId: string?
    The optional bounded session identifier.
    impersonatorDisplayName: string?
    The optional support operator display name.

    Retorna: The builder instance.

  • methodWithTenant
    public AuditRecordBuilder WithTenant(string tenantId)

    Sets the tenant identifier.

    tenantId: string
    The tenant identifier.

    Retorna: The builder instance.

    Exceptions: ArgumentException: `tenantId` is `null` or empty

  • methodWithTimeProvider
    public AuditRecordBuilder WithTimeProvider(TimeProvider timeProvider)

    Sets the UTC timestamp using the specified `TimeProvider`, honoring active `AmbientAuditTimeProvider` scopes.

    timeProvider: TimeProvider
    The deterministic time provider to sample.

    Retorna: The builder instance.

    Exceptions: ArgumentNullException: `timeProvider` is `null`.

  • methodWithUserAgent
    public AuditRecordBuilder WithUserAgent(string? userAgent)

    Sets the user agent string.

    userAgent: string?
    The client user agent string.

    Retorna: The builder instance.

record

AuditResource

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditResource(string Type, string Id, string? AggregateType, string? AggregateId)

Represents the target resource on which an audited action was performed.

Notas:

Exceptions: ArgumentException: `Type` or `Id` is `null` or white-space

Miembros (5)

  • constructorAuditResource
    public AuditResource(string Type, string Id, string? AggregateType = null, string? AggregateId = null)

    Initializes a new instance of AuditResource.

    Type: string
    The logical type or entity class of the resource.
    Id: string
    The stable identifier of the specific resource instance.
    AggregateType: string?
    The optional aggregate root entity type when the resource is a child entity.
    AggregateId: string?
    The optional identifier of the aggregate root entity.

    Exceptions: ArgumentException: `Type` or `Id` is `null` or white-space

  • propertyAggregateId
    public string? AggregateId { get; init; }

    The optional identifier of the aggregate root entity.

  • propertyAggregateType
    public string? AggregateType { get; init; }

    The optional aggregate root entity type when the resource is a child entity.

  • propertyId
    public string Id { get; init; }

    Gets the stable identifier of the specific resource instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • propertyType
    public string Type { get; init; }

    Gets the logical type or entity class of the resource.

    Exceptions: ArgumentException: `value` is `null` or white-space

class

AuditScope

Ensamblado: EricksonLopez.Auditing
public sealed class AuditScope : IDisposable
Implementa: IDisposable

Provides an ambient scope for enriching audit records with additional context.

Notas:

Disposing this scope restores the previous ambient scope, supporting nested execution contexts.

Miembros (32)

  • methodBegin
    public static AuditScope Begin(IReadOnlyDictionary<string, string>? initialMetadata = null)

    Begins a new ambient audit scope with optional initial metadata.

    initialMetadata: IReadOnlyDictionary<string, string>?
    The optional initial key-value metadata to seed into the new scope.

    Retorna: A new `AuditScope` instance. Disposing it restores the enclosing scope.

  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodWithActor
    public AuditScope WithActor(AuditActor actor)

    Sets the ambient actor for this scope.

    actor: AuditActor
    The actor to associate with this scope.

    Retorna: The current `AuditScope` instance for method chaining.

  • methodWithCausationId
    public AuditScope WithCausationId(string causationId)

    Sets the ambient causation identifier for this scope.

    causationId: string
    The causation identifier to associate with this scope.

    Retorna: The current `AuditScope` instance for method chaining.

  • methodWithCorrelationId
    public AuditScope WithCorrelationId(string correlationId)

    Sets the ambient correlation identifier for this scope.

    correlationId: string
    The correlation identifier to associate with this scope.

    Retorna: The current `AuditScope` instance for method chaining.

  • methodWithExecutionPlane
    public AuditScope WithExecutionPlane(AuditExecutionPlane executionPlane)

    Sets the ambient security execution plane (`CONTROL`, `TENANT`, `M2M`, or `BOOTSTRAP`) for this scope.

    executionPlane: AuditExecutionPlane
    The security execution plane to associate with this scope.

    Retorna: The current `AuditScope` instance for method chaining.

  • methodWithImpersonation
    public AuditScope WithImpersonation(AuditImpersonation impersonation, bool allowOverride = false)

    Sets the ambient delegated support impersonation context for this scope, enforcing the anti-nested-impersonation security invariant by default.

    impersonation: AuditImpersonation
    The delegated impersonation context.
    allowOverride: bool
    If `false` (the default), throws `InvalidOperationException` when an enclosing scope already carries a conflicting active impersonation session.

    Retorna: The current `AuditScope` instance for method chaining.

    Exceptions: ArgumentNullException: `impersonation` is `null`.; InvalidOperationException: Nested impersonation is attempted while an active impersonation session is already present.

  • methodWithMetadata
    public AuditScope WithMetadata(string key, string value)

    Adds or updates a metadata entry within this scope in a thread-safe manner.

    key: string
    The metadata key to set.
    value: string
    The metadata value to associate with the specified key.

    Retorna: The current `AuditScope` instance for method chaining.

    Exceptions: ArgumentException: `key` is `null` or empty

  • methodWithOrganizationId
    public AuditScope WithOrganizationId(string organizationId)

    Sets the ambient sub-tenant organization or company identifier for this scope.

    organizationId: string
    The non-empty organization or company identifier.

    Retorna: The current `AuditScope` instance for method chaining.

    Exceptions: ArgumentException: `organizationId` is `null` or white-space.

  • methodWithSecurityClassification
    public AuditScope WithSecurityClassification(AuditSecurityClassification classification)

    Sets the ambient security criticality classification for this scope.

    classification: AuditSecurityClassification
    The security classification to associate with this scope.

    Retorna: The current `AuditScope` instance for method chaining.

  • methodWithTenant
    public AuditScope WithTenant(string tenantId)

    Sets the ambient tenant identifier for this scope.

    tenantId: string
    The tenant identifier string to associate with this scope.

    Retorna: The current `AuditScope` instance for method chaining.

  • methodWithTenant
    public AuditScope WithTenant(TenantId tenantId)

    Sets the ambient tenant identifier for this scope.

    tenantId: TenantId
    The tenant identifier to associate with this scope.

    Retorna: The current `AuditScope` instance for method chaining.

  • propertyActor
    public AuditActor? Actor { get; }

    Gets the actor explicitly set on this scope, or `null`.

  • propertyCausationId
    public string? CausationId { get; }

    Gets the causation identifier explicitly set on this scope, or `null`.

  • propertyCorrelationId
    public string? CorrelationId { get; }

    Gets the correlation identifier explicitly set on this scope, or `null`.

  • propertyCurrent
    public static AuditScope? Current { get; }

    Gets the current ambient `AuditScope`, or `null` if none is active.

  • propertyEffectiveActor
    public AuditActor? EffectiveActor { get; }

    Gets the effective actor resolved from this scope or the nearest enclosing parent scope.

  • propertyEffectiveCausationId
    public string? EffectiveCausationId { get; }

    Gets the effective causation identifier resolved from this scope or the nearest enclosing parent scope.

  • propertyEffectiveCorrelationId
    public string? EffectiveCorrelationId { get; }

    Gets the effective correlation identifier resolved from this scope or the nearest enclosing parent scope.

  • propertyEffectiveExecutionPlane
    public AuditExecutionPlane? EffectiveExecutionPlane { get; }

    Gets the effective security execution plane resolved from this scope, scope metadata, or the nearest enclosing parent scope.

  • propertyEffectiveImpersonation
    public AuditImpersonation? EffectiveImpersonation { get; }

    Gets the effective delegated support impersonation context resolved from this scope or the nearest enclosing parent scope.

  • propertyEffectiveMetadata
    public IReadOnlyDictionary<string, string> EffectiveMetadata { get; }

    Gets the effective metadata key-value pairs merged hierarchically from all enclosing parent scopes down to this scope, with child scope entries overriding parent scope entries of the same key.

  • propertyEffectiveOrganizationId
    public string? EffectiveOrganizationId { get; }

    Gets the effective sub-tenant organization identifier resolved from this scope, scope metadata, or the nearest enclosing parent scope.

  • propertyEffectiveSecurityClassification
    public AuditSecurityClassification? EffectiveSecurityClassification { get; }

    Gets the effective security criticality classification resolved from this scope or the nearest enclosing parent scope.

  • propertyEffectiveTenantId
    public TenantId? EffectiveTenantId { get; }

    Gets the effective tenant identifier resolved from this scope or the nearest enclosing parent scope.

  • propertyExecutionPlane
    public AuditExecutionPlane? ExecutionPlane { get; }

    Gets the security execution plane explicitly set on this scope, or `null`.

  • propertyImpersonation
    public AuditImpersonation? Impersonation { get; }

    Gets the delegated support impersonation context explicitly set on this scope, or `null`.

  • propertyMetadata
    public IReadOnlyDictionary<string, string> Metadata { get; }

    Gets the metadata key-value pairs registered directly within this scope.

  • propertyOrganizationId
    public string? OrganizationId { get; }

    Gets the sub-tenant organization or company identifier explicitly set on this scope, or `null`.

  • propertyParent
    public AuditScope? Parent { get; }

    Gets the parent `AuditScope`, or `null` if this is a root scope.

  • propertySecurityClassification
    public AuditSecurityClassification? SecurityClassification { get; }

    Gets the security criticality classification explicitly set on this scope, or `null`.

  • propertyTenantId
    public TenantId? TenantId { get; }

    Gets the tenant identifier explicitly set on this scope, or `null`.

record

AuditSecurityAlert

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed record AuditSecurityAlert(Guid AlertId, AuditSecuritySeverity Severity, string AlertCode, string Summary, AuditRecord Record, DateTimeOffset EmittedAt)

Represents an immutable real-time security alert emitted when high-criticality audit records are recorded.

Notas:

Exceptions: ArgumentException: `AlertCode` or `Summary` is `null` or white-space.; ArgumentNullException: `Record` is `null`.

Miembros (7)

  • constructorAuditSecurityAlert
    public AuditSecurityAlert(Guid AlertId, AuditSecuritySeverity Severity, string AlertCode, string Summary, AuditRecord Record, DateTimeOffset EmittedAt)

    Initializes a new instance of AuditSecurityAlert.

    AlertId: Guid
    The unique monotonic identifier of the security alert.
    Severity: AuditSecuritySeverity
    The operational severity of the alert.
    AlertCode: string
    The machine-readable classification code of the alert (for example, `GENESIS_ACCOUNT_ACTIVITY`).
    Summary: string
    The human-readable summary describing why the alert was triggered without exposing sensitive secrets.
    Record: AuditRecord
    The canonical `AuditRecord` that triggered the alert.
    EmittedAt: DateTimeOffset
    The UTC timestamp when the alert was emitted.

    Exceptions: ArgumentException: `AlertCode` or `Summary` is `null` or white-space.; ArgumentNullException: `Record` is `null`.

  • propertyAlertCode
    public string AlertCode { get; init; }

    Gets the machine-readable classification code of the alert.

    Exceptions: ArgumentException: `value` is `null` or white-space.

  • propertyAlertId
    public Guid AlertId { get; init; }

    The unique monotonic identifier of the security alert.

  • propertyEmittedAt
    public DateTimeOffset EmittedAt { get; init; }

    The UTC timestamp when the alert was emitted.

  • propertyRecord
    public AuditRecord Record { get; init; }

    Gets the canonical `AuditRecord` that triggered the alert.

    Exceptions: ArgumentNullException: `value` is `null`.

  • propertySeverity
    public AuditSecuritySeverity Severity { get; init; }

    The operational severity of the alert.

  • propertySummary
    public string Summary { get; init; }

    Gets the human-readable summary describing why the alert was triggered.

    Exceptions: ArgumentException: `value` is `null` or white-space.

enum

AuditSecurityClassification

Ensamblado: EricksonLopez.Auditing.Abstractions
public enum AuditSecurityClassification : byte

Specifies the security criticality and privilege tier of an audited event or principal.

Miembros (5)

  • fieldBreakGlass
    BreakGlass = 3

    Specifies an emergency break-glass access event requiring non-droppable persistence and immediate security review.

  • fieldGenesis
    Genesis = 4

    Specifies an operation involving the root `GENESIS` identity requiring mandatory fail-closed persistence and critical security alerting.

  • fieldPrivilegedControl
    PrivilegedControl = 2

    Specifies a privileged platform control-plane or delegated support administration event.

  • fieldSecuritySensitive
    SecuritySensitive = 1

    Specifies a security-sensitive operation such as authentication, MFA, credential lifecycle, or permission change.

  • fieldStandard
    Standard = 0

    Specifies a routine operational business or data mutation event.

enum

AuditSecuritySeverity

Ensamblado: EricksonLopez.Auditing.Abstractions
public enum AuditSecuritySeverity : byte

Specifies the operational severity level of an emitted `AuditSecurityAlert`.

Miembros (4)

  • fieldCritical
    Critical = 3

    Specifies a critical security alert such as root `GENESIS` or `BreakGlass` principal activity.

  • fieldHigh
    High = 2

    Specifies a high-severity security alert such as bootstrap plane modification or emergency access.

  • fieldInformational
    Informational = 0

    Specifies an informational security notification.

  • fieldWarning
    Warning = 1

    Specifies an elevated security warning such as a denied sensitive action or delegated support session.

class

AuditSensitiveAttribute

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed class AuditSensitiveAttribute : Attribute
Hereda de: Attribute

Indicates that a property, field, or parameter contains sensitive credentials, tokens, or PII that must be redacted from audit change values and diagnostic payloads.

Miembros (2)

  • constructorAuditSensitiveAttribute
    public AuditSensitiveAttribute(string? classification = null)

    Initializes a new instance of the `AuditSensitiveAttribute` class.

    classification: string?
    An optional non-sensitive label classifying the protected datum (for example, `Credential`, `MfaSecret`, or `Pii`).
  • propertyClassification
    public string? Classification { get; }

    Gets the optional classification label describing the category of sensitive data.

class

AuditSensitivityPipeline

Ensamblado: EricksonLopez.Auditing
public sealed class AuditSensitivityPipeline : IAuditSensitivityPipeline
Implementa: IAuditSensitivityPipeline

Provides a pipeline that filters change tracking records and context metadata to suppress, redact, or hash sensitive field values according to configured policies.

Miembros (8)

  • constructorAuditSensitivityPipeline
    public AuditSensitivityPipeline(AuditConfiguration config, IAuditCryptoKeyProvider? keyProvider = null, IAuditFieldEncryptor? fieldEncryptor = null)

    Initializes a new instance of the `AuditSensitivityPipeline` class.

    config: AuditConfiguration
    The audit configuration containing sensitivity policies.
    keyProvider: IAuditCryptoKeyProvider?
    The optional crypto key provider for GDPR crypto-shredding.
    fieldEncryptor: IAuditFieldEncryptor?
    The optional field encryptor for GDPR crypto-shredding.

    Exceptions: ArgumentNullException: `config` is `null`

  • methodApplyAsync
    public async ValueTask<IReadOnlyList<AuditChange>?> ApplyAsync(IReadOnlyList<AuditChange>? changes, string tenantId, CancellationToken cancellationToken = default)

    Applies sensitivity policies to a collection of field changes, returning a sanitized collection.

    changes: IReadOnlyList<AuditChange>?
    The raw collection of field changes to process.
    tenantId: string
    The tenant ID to use for fetching encryption keys.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the sanitized collection of changes, or `null` if all changes were excluded or the input was `null`.

  • methodHashValue
    public static string HashValue(string value, string? salt = null)

    Calculates the lowercase hexadecimal SHA-256 digest of the specified string value, with optional cryptographic salt.

    value: string
    The plaintext string value to hash.
    salt: string?
    The optional salt to prevent rainbow table attacks on low-entropy values.

    Retorna: The lowercase hexadecimal SHA-256 digest of the input string.

    Exceptions: ArgumentNullException: `value` is `null`

  • methodIsSensitiveFieldName
    public bool IsSensitiveFieldName(string? fieldName)

    Determines whether the specified field or metadata key matches the configured denylist or canonical credential/secret naming patterns.

    fieldName: string?
    The property, field, or metadata key name to evaluate.

    Retorna: `true` if the key is classified as sensitive; otherwise, `false`.

  • methodSanitizeAsync
    public async ValueTask<AuditRecord> SanitizeAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Sanitizes the specified audit record by applying redaction or exclusions to sensitive fields.

    record: AuditRecord
    The audit record to sanitize.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the sanitized audit record.

  • propertyFieldEncryptor
    public IAuditFieldEncryptor? FieldEncryptor { get; }

    Gets the optional field encryptor configured for GDPR crypto-shredding.

  • propertyKeyProvider
    public IAuditCryptoKeyProvider? KeyProvider { get; }

    Gets the optional crypto key provider configured for GDPR crypto-shredding.

  • fieldRedactedLiteral
    public const string RedactedLiteral

    Gets the canonical redaction placeholder literal substituted for sensitive metadata entries.

enum

AuditSortDirection

Ensamblado: EricksonLopez.Auditing.Abstractions
public enum AuditSortDirection : byte

Specifies the chronological sorting direction for audit record queries.

Miembros (2)

  • fieldAscending
    Ascending = 1

    Sorts records chronologically ascending (oldest first).

  • fieldDescending
    Descending = 2

    Sorts records chronologically descending (newest first).

record

AuditStamp

Ensamblado: EricksonLopez.Auditing.Abstractions
public readonly record struct AuditStamp(string ActorId, DateTimeOffset Timestamp, string? ImpersonatorId, AuditExecutionPlane ExecutionPlane)

Represents an immutable point-in-time entity audit stamp resolved from deterministic time and ambient principal context.

Miembros (7)

  • constructorAuditStamp
    public AuditStamp(string ActorId, DateTimeOffset Timestamp, string? ImpersonatorId = null, AuditExecutionPlane ExecutionPlane = AuditExecutionPlane.Unspecified)

    Initializes a new instance of AuditStamp.

    ActorId: string
    The identifier of the target or subject actor.
    Timestamp: DateTimeOffset
    The deterministic UTC timestamp of the persistence operation.
    ImpersonatorId: string?
    The optional identifier of the operator performing delegated impersonation.
    ExecutionPlane: AuditExecutionPlane
    The security execution plane active at the time of stamping.
  • propertyActorId
    public string ActorId { get; init; }

    The identifier of the target or subject actor.

  • propertyEffectiveOperatorId
    public string EffectiveOperatorId { get; }

    Gets the physical operator identifier (`ImpersonatorId` when impersonated; otherwise, `ActorId`).

  • propertyExecutionPlane
    public AuditExecutionPlane ExecutionPlane { get; init; }

    The security execution plane active at the time of stamping.

  • propertyImpersonatorId
    public string? ImpersonatorId { get; init; }

    The optional identifier of the operator performing delegated impersonation.

  • propertyIsImpersonated
    public bool IsImpersonated { get; }

    Gets a value indicating whether the stamp was captured during an active delegated impersonation session.

  • propertyTimestamp
    public DateTimeOffset Timestamp { get; init; }

    The deterministic UTC timestamp of the persistence operation.

class

AuditingServiceCollectionExtensions

Ensamblado: EricksonLopez.Auditing
public static class AuditingServiceCollectionExtensions

Provides extension methods for registering core auditing services into an `IServiceCollection`.

Miembros (5)

  • methodAddAuditing
    public static IAuditBuilder AddAuditing(this IServiceCollection services, Action<AuditConfiguration>? configure = null)

    Adds core auditing services, configuration, pipeline, entity stamper, and default providers to the service collection.

    services: this IServiceCollection
    The service collection to register into.
    configure: Action<AuditConfiguration>?
    An optional action to configure auditing policies.

    Retorna: An `IAuditBuilder` instance for configuring storage and providers.

    Exceptions: ArgumentNullException: `services` is `null`

  • methodAddSecurityAlertSink<TSink>
    public static IAuditBuilder AddSecurityAlertSink<TSink>(this IAuditBuilder builder) where TSink : class, IAuditSecurityAlertSink

    Registers an `IAuditSecurityAlertSink` implementation and automatically enables real-time security alerting.

    builder: this IAuditBuilder
    The audit builder being configured.

    Retorna: The `IAuditBuilder` instance for fluent method chaining.

    Type parameters: TSink: The security alert sink implementation type. Exceptions: ArgumentNullException: `builder` is `null`.

  • methodApplyDecorators
    public static IAuditBuilder ApplyDecorators(this IAuditBuilder builder)

    Applies any pending decorators (HMAC integrity verification, security alerting, high-throughput buffering) to the registered audit store.

    builder: this IAuditBuilder
    The audit builder being configured.

    Retorna: The `IAuditBuilder` instance for fluent method chaining.

    Exceptions: ArgumentNullException: `builder` is `null`

  • methodEnableBuffering
    public static IAuditBuilder EnableBuffering(this IAuditBuilder builder, Action<BufferedAuditStoreOptions>? configure = null)

    Decorates the registered `IAuditStore` with a high-throughput asynchronous batching buffer (`BufferedAuditStoreDecorator`).

    builder: this IAuditBuilder
    The audit builder being configured.
    configure: Action<BufferedAuditStoreOptions>?
    An optional configuration delegate to customize buffer capacity, batch size, and flush interval.

    Retorna: The `IAuditBuilder` instance for fluent method chaining.

    Exceptions: ArgumentNullException: `builder` is `null`

  • methodEnableSecurityAlerts
    public static IAuditBuilder EnableSecurityAlerts(this IAuditBuilder builder)

    Enables real-time security alerting via `SecurityAlertAuditStoreDecorator` for `GENESIS`, `BreakGlass`, `BOOTSTRAP` plane, and delegated support impersonation records.

    builder: this IAuditBuilder
    The audit builder being configured.

    Retorna: The `IAuditBuilder` instance for fluent method chaining.

    Exceptions: ArgumentNullException: `builder` is `null`.

class

BufferedAuditStoreDecorator

Ensamblado: EricksonLopez.Auditing
public sealed partial class BufferedAuditStoreDecorator : IAuditStore, IAsyncDisposable, IDisposable
Implementa: IAsyncDisposable, IAuditStore, IDisposable

Provides high-throughput asynchronous batching for an `IAuditStore` using tenant-partitioned bounded channels, background drain workers, and AES-256-GCM Dead-Letter Queue support.

Miembros (9)

  • constructorBufferedAuditStoreDecorator
    public BufferedAuditStoreDecorator(IAuditStore innerStore, BufferedAuditStoreOptions? options = null, ILogger<BufferedAuditStoreDecorator>? logger = null, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `BufferedAuditStoreDecorator` class.

    innerStore: IAuditStore
    The underlying audit store where batches are persisted.
    options: BufferedAuditStoreOptions?
    Optional buffer configuration options.
    logger: ILogger<BufferedAuditStoreDecorator>?
    Optional logger for background worker diagnostics.
    sensitivityPipeline: IAuditSensitivityPipeline?
    Optional sensitivity pipeline executed before buffering records.

    Exceptions: ArgumentNullException: `innerStore` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodDecryptDeadLetterBatch
    public static List<AuditRecord> DecryptDeadLetterBatch(ReadOnlySpan<byte> encryptedPayload, ReadOnlySpan<byte> key)

    Decrypts and authenticates an AES-256-GCM Dead-Letter Queue payload back into audit records.

    encryptedPayload: ReadOnlySpan<byte>
    The encrypted byte payload (`[version:1B][nonce:12B][tag:16B][ciphertext:NB]`).
    key: ReadOnlySpan<byte>
    The 32-byte (256-bit) encryption key.

    Retorna: The deserialized list of `AuditRecord` instances.

    Exceptions: ArgumentException: `key` is not 32 bytes in length; CryptographicException: `encryptedPayload` is invalid or has an unsupported format version

  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodDisposeAsync
    public async ValueTask DisposeAsync()

    Inherits documentation from base type or interface.

  • methodEncryptDeadLetterBatch
    public static byte[] EncryptDeadLetterBatch(IReadOnlyList<AuditRecord> batch, ReadOnlySpan<byte> key)

    Encrypts a batch of audit records using authenticated AES-256-GCM (`[version:1B][nonce:12B][tag:16B][ciphertext:NB]`).

    batch: IReadOnlyList<AuditRecord>
    The batch of audit records to encrypt.
    key: ReadOnlySpan<byte>
    The 32-byte (256-bit) encryption key.

    Retorna: The authenticated encrypted payload.

    Exceptions: ArgumentNullException: `batch` is `null`; ArgumentException: `key` is not 32 bytes in length

  • methodQueryAsync
    public ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
  • propertyEffectiveDeadLetterEncryptionKey
    public ReadOnlyMemory<byte>? EffectiveDeadLetterEncryptionKey { get; }

    Gets the effective 256-bit AES-GCM encryption key for Dead-Letter Queue files when `BufferedAuditStoreOptions.EncryptDeadLetterQueue` is enabled.

class

BufferedAuditStoreOptions

Ensamblado: EricksonLopez.Auditing
public sealed class BufferedAuditStoreOptions

Represents configuration options for `BufferedAuditStoreDecorator`.

Miembros (8)

  • propertyBatchSize
    public int BatchSize { get; set; }

    Gets or sets the maximum number of audit records dispatched in a single batch to the underlying store.

    Defaults to 100. Exceptions: ArgumentOutOfRangeException: `value` is less than or equal to zero

  • propertyCapacity
    public int Capacity { get; set; }

    Gets or sets the maximum number of audit records buffered in memory before applying backpressure.

    Defaults to 10,000. Exceptions: ArgumentOutOfRangeException: `value` is less than or equal to zero

  • propertyDeadLetterDirectory
    public string? DeadLetterDirectory { get; set; }

    Gets or sets the directory path where Dead-Letter Queue (DLQ) files are written when all store retries fail. When `null`, defaults to the system temporary directory.

  • propertyDeadLetterEncryptionKey
    public byte[]? DeadLetterEncryptionKey { get; set; }

    Gets or sets the 256-bit (32-byte) AES-GCM key used to encrypt Dead-Letter Queue (DLQ) files. Setting a valid key automatically enables `EncryptDeadLetterQueue`.

    Exceptions: ArgumentException: The provided key is not 32 bytes (256 bits) in length

  • propertyEncryptDeadLetterQueue
    public bool EncryptDeadLetterQueue { get; set; }

    Gets or sets whether Dead-Letter Queue (DLQ) files are encrypted on disk using authenticated AES-256-GCM. Automatically set to `true` when `DeadLetterEncryptionKey` is configured.

  • propertyFlushInterval
    public TimeSpan FlushInterval { get; set; }

    Gets or sets the maximum duration to wait before flushing accumulated records even if `BatchSize` has not been reached.

    Defaults to 500 milliseconds. Exceptions: ArgumentOutOfRangeException: `value` is less than or equal to `TimeSpan.Zero`

  • propertyFullMode
    public BoundedChannelFullMode FullMode { get; set; }

    Gets or sets the behavior when writing to a full buffer.

    Defaults to `BoundedChannelFullMode.Wait`.

  • propertyWorkerCount
    public int WorkerCount { get; set; }

    Gets or sets the number of concurrent background workers draining the buffer.

    Defaults to 1. When greater than 1, records are partitioned by `TenantId` across workers so different tenants flush concurrently while preserving strict per-tenant FIFO causal ordering. Exceptions: ArgumentOutOfRangeException: `value` is less than or equal to zero

enum

EntityAuditActorResolution

Ensamblado: EricksonLopez.Auditing.Abstractions
public enum EntityAuditActorResolution : byte

Specifies which principal identifier is stamped onto entity audit columns (`CreatedBy`, `UpdatedBy`, `DeletedBy`) during delegated impersonation.

Miembros (2)

  • fieldEffectiveOperator
    EffectiveOperator = 0

    Stamps the real physical operator identifier (`ImpersonatorId ?? ActorId`) for non-repudiable attribution.

  • fieldSubjectActor
    SubjectActor = 1

    Stamps the subject or impersonated target principal identifier (`ActorId`).

class

EntityAuditStamper

Ensamblado: EricksonLopez.Auditing
public sealed class EntityAuditStamper : IEntityAuditStamper
Implementa: IEntityAuditStamper

Default implementation of `IEntityAuditStamper` providing decoupled, impersonation-aware entity audit stamping using `TimeProvider`.

Miembros (11)

  • constructorEntityAuditStamper
    public EntityAuditStamper(IAuditActorProvider actorProvider, TimeProvider? timeProvider = null, IAuditContextProvider? contextProvider = null, AuditConfiguration? configuration = null)

    Initializes a new instance of the `EntityAuditStamper` class.

    actorProvider: IAuditActorProvider
    The provider used to resolve the active actor when no ambient scope override is present.
    timeProvider: TimeProvider?
    The optional deterministic `TimeProvider`. Defaults to `TimeProvider.System` when `null`.
    contextProvider: IAuditContextProvider?
    The optional context provider used to resolve the active execution plane.
    configuration: AuditConfiguration?
    The optional audit configuration controlling actor attribution during impersonation.

    Exceptions: ArgumentNullException: `actorProvider` is `null`.

  • methodAuditEntityForDelete
    public AuditStamp AuditEntityForDelete(IAuditableTarget entity)

    Stamps soft-deletion metadata onto an `IAuditableTarget` entity immediately prior to SQL soft-delete execution.

    entity: IAuditableTarget
    The entity to stamp for soft-deletion.

    Retorna: The applied `AuditStamp`.

  • methodAuditEntityForDelete<TActorId>
    public AuditStamp AuditEntityForDelete<TActorId>(IAuditableTarget<TActorId> entity, Func<string, TActorId> actorParser)

    Stamps soft-deletion metadata onto a strongly-typed `IAuditableTarget<TActorId>` entity.

    entity: IAuditableTarget<TActorId>
    The entity to stamp for soft-deletion.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.

    Retorna: The applied `AuditStamp`.

    Type parameters: TActorId: The strongly-typed actor identifier.

  • methodAuditEntityForDelete<TEntity, TActorId>
    public AuditStamp AuditEntityForDelete<TEntity, TActorId>(TEntity entity, Func<string, TActorId> actorParser, Action<TEntity, TActorId, DateTimeOffset> applyStamp) where TEntity : class

    Stamps soft-deletion metadata onto an arbitrary pure-domain entity using an explicit zero-reflection callback.

    entity: TEntity
    The pure domain entity instance.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.
    applyStamp: Action<TEntity, TActorId, DateTimeOffset>
    The callback invoking the entity's soft-delete audit method (for example, `(e, uid, ts) => e.MarkDeleted(uid, ts)`).

    Retorna: The applied `AuditStamp`.

    Type parameters: TEntity: The pure domain entity type.; TActorId: The strongly-typed actor identifier type.

  • methodAuditEntityForInsert
    public AuditStamp AuditEntityForInsert(IAuditableTarget entity)

    Stamps creation metadata onto an `IAuditableTarget` entity immediately prior to SQL insert execution.

    entity: IAuditableTarget
    The entity to stamp for insertion.

    Retorna: The applied `AuditStamp`.

  • methodAuditEntityForInsert<TActorId>
    public AuditStamp AuditEntityForInsert<TActorId>(IAuditableTarget<TActorId> entity, Func<string, TActorId> actorParser)

    Stamps creation metadata onto a strongly-typed `IAuditableTarget<TActorId>` entity.

    entity: IAuditableTarget<TActorId>
    The entity to stamp for insertion.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.

    Retorna: The applied `AuditStamp`.

    Type parameters: TActorId: The strongly-typed actor identifier.

  • methodAuditEntityForInsert<TEntity, TActorId>
    public AuditStamp AuditEntityForInsert<TEntity, TActorId>(TEntity entity, Func<string, TActorId> actorParser, Action<TEntity, TActorId, DateTimeOffset> applyStamp) where TEntity : class

    Stamps creation metadata onto an arbitrary pure-domain entity using an explicit zero-reflection callback.

    entity: TEntity
    The pure domain entity instance.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.
    applyStamp: Action<TEntity, TActorId, DateTimeOffset>
    The callback invoking the entity's creation audit method (for example, `(e, uid, ts) => e.MarkCreated(uid, ts)`).

    Retorna: The applied `AuditStamp`.

    Type parameters: TEntity: The pure domain entity type.; TActorId: The strongly-typed actor identifier type.

  • methodAuditEntityForUpdate
    public AuditStamp AuditEntityForUpdate(IAuditableTarget entity)

    Stamps modification metadata onto an `IAuditableTarget` entity immediately prior to SQL update execution.

    entity: IAuditableTarget
    The entity to stamp for update.

    Retorna: The applied `AuditStamp`.

  • methodAuditEntityForUpdate<TActorId>
    public AuditStamp AuditEntityForUpdate<TActorId>(IAuditableTarget<TActorId> entity, Func<string, TActorId> actorParser)

    Stamps modification metadata onto a strongly-typed `IAuditableTarget<TActorId>` entity.

    entity: IAuditableTarget<TActorId>
    The entity to stamp for update.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.

    Retorna: The applied `AuditStamp`.

    Type parameters: TActorId: The strongly-typed actor identifier.

  • methodAuditEntityForUpdate<TEntity, TActorId>
    public AuditStamp AuditEntityForUpdate<TEntity, TActorId>(TEntity entity, Func<string, TActorId> actorParser, Action<TEntity, TActorId, DateTimeOffset> applyStamp) where TEntity : class

    Stamps modification metadata onto an arbitrary pure-domain entity using an explicit zero-reflection callback.

    entity: TEntity
    The pure domain entity instance.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.
    applyStamp: Action<TEntity, TActorId, DateTimeOffset>
    The callback invoking the entity's update audit method (for example, `(e, uid, ts) => e.MarkUpdated(uid, ts)`).

    Retorna: The applied `AuditStamp`.

    Type parameters: TEntity: The pure domain entity type.; TActorId: The strongly-typed actor identifier type.

  • methodCaptureStamp
    public AuditStamp CaptureStamp()

    Captures the current deterministic `AuditStamp` from the active `TimeProvider`, ambient scope, and actor provider.

    Retorna: An immutable `AuditStamp` representing the active actor, optional impersonator, plane, and UTC timestamp.

class

HmacAuditIntegrityService

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed class HmacAuditIntegrityService

Provides computation and verification of HMAC-SHA256 integrity hashes for cryptographic chaining of audit records.

Miembros (3)

  • constructorHmacAuditIntegrityService
    public HmacAuditIntegrityService(IAuditIntegrityProvider keyProvider, IAuditHashAlgorithm hashAlgorithm)

    Initializes a new instance of the `HmacAuditIntegrityService` class.

    keyProvider: IAuditIntegrityProvider
    The cryptographic key provider for tenant integrity keys.
    hashAlgorithm: IAuditHashAlgorithm
    The cryptographic hash algorithm used for integrity signatures.

    Exceptions: ArgumentNullException: `keyProvider` or `hashAlgorithm` is `null`

  • methodComputeHash
    public string ComputeHash(AuditRecord record, string? previousHash)

    Computes the HMAC-SHA256 hash for an audit record, incorporating the preceding record hash.

    record: AuditRecord
    The audit record to hash.
    previousHash: string?
    The hash of the preceding record in the tenant chain, or `null` for the initial record.

    Retorna: The lowercase hexadecimal HMAC-SHA256 digest string.

    Exceptions: ArgumentNullException: `record` is `null`

  • methodVerify
    public bool Verify(AuditRecord record)

    Determines whether the integrity hash of a stored audit record matches its recomputed value.

    record: AuditRecord
    The audit record whose integrity is to be verified.

    Retorna: `true` if the integrity hash is valid and matches; otherwise, `false`.

class

HmacSha256AuditHashAlgorithm

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed class HmacSha256AuditHashAlgorithm : IAuditHashAlgorithm
Implementa: IAuditHashAlgorithm

Provides an HMAC-SHA256 implementation of `IAuditHashAlgorithm` for audit record integrity.

Miembros (3)

  • methodComputeHash
    public int ComputeHash(ReadOnlySpan<byte> data, ReadOnlySpan<byte> key, Span<byte> destination)

    Computes the cryptographic hash for the given data and key, writing the result into the destination span.

    data: ReadOnlySpan<byte>
    The canonicalized payload data to hash.
    key: ReadOnlySpan<byte>
    The cryptographic key.
    destination: Span<byte>
    The destination span to receive the computed hash bytes.

    Retorna: The number of bytes written to the destination span.

  • propertyAlgorithmId
    public string AlgorithmId { get; }

    Gets the string identifier of this algorithm, such as "HMACSHA256".

  • propertyHashLengthInBytes
    public int HashLengthInBytes { get; }

    Gets the exact length in bytes of the hash produced by this algorithm.

interface

IAuditActorProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditActorProvider

Defines a provider for resolving the current authenticated actor identity.

Miembros (1)

  • methodGetCurrentActor
    AuditActor GetCurrentActor()

    Resolves the current authenticated actor identity.

    Retorna: The `AuditActor` performing the current operation, or `AuditActor.Anonymous` if unauthenticated.

interface

IAuditBuilder

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditBuilder

Defines a fluent builder for configuring auditing services and registering storage providers.

Miembros (5)

  • methodAddEnricher<TEnricher>
    IAuditBuilder AddEnricher<TEnricher>() where TEnricher : class, IAuditEnricher

    Registers an audit enricher to augment records in the logging pipeline.

    Retorna: The current `IAuditBuilder` instance for fluent chaining.

    Type parameters: TEnricher: The type of the enricher implementation.

  • methodEnableIntegrityChain
    IAuditBuilder EnableIntegrityChain()

    Enables HMAC-SHA256 cryptographic chain integrity verification for audit records.

    Retorna: The current `IAuditBuilder` instance for fluent chaining.

  • methodUseActorProvider<TProvider>
    IAuditBuilder UseActorProvider<TProvider>() where TProvider : class, IAuditActorProvider

    Registers a custom actor provider type to resolve current actor identities.

    Retorna: The current `IAuditBuilder` instance for fluent chaining.

    Type parameters: TProvider: The type of the actor provider implementation.

  • methodUseStore<TStore>
    IAuditBuilder UseStore<TStore>() where TStore : class, IAuditStore

    Registers an audit persistence store implementation.

    Retorna: The current `IAuditBuilder` instance for fluent chaining.

    Type parameters: TStore: The type of the audit store implementation.

  • propertyServices
    IServiceCollection Services { get; }

    Gets the underlying service collection being configured.

interface

IAuditChainHeadProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditChainHeadProvider

Provides direct lookup of the latest cryptographic integrity hash for a given tenant without requiring full `IAuditRecordReader.QueryAsync` support.

Miembros (1)

  • methodGetLatestIntegrityHashAsync
    ValueTask<string?> GetLatestIntegrityHashAsync(TenantId tenantId, CancellationToken cancellationToken = default)

    Retrieves the `AuditRecord.IntegrityHash` of the most recently appended audit record for `tenantId`, or `null` if no record exists yet.

    tenantId: TenantId
    The tenant identifier whose chain head is requested.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The latest integrity hash string, or `null` for a genesis record.

interface

IAuditContextProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditContextProvider

Defines a provider for resolving the current ambient execution context.

Miembros (1)

  • methodGetCurrentContext
    AuditContext GetCurrentContext()

    Resolves the current ambient execution context.

    Retorna: The current `AuditContext` instance.

interface

IAuditCryptoKeyProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditCryptoKeyProvider

Provides cryptographic key management for the Crypto-Shredding pattern (GDPR Art. 17).

Miembros (2)

  • methodGetEncryptionKeyAsync
    ValueTask<byte[]> GetEncryptionKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Retrieves or generates the encryption key associated with a specific subject (e.g., tenant or actor).

    subjectId: string
    The identifier of the subject whose data requires encryption.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation. The task result contains a 32-byte cryptographic key for AES-GCM encryption.

  • methodShredKeyAsync
    ValueTask ShredKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Permanently deletes the encryption key associated with a specific subject, rendering all their encrypted PII permanently inaccessible.

    subjectId: string
    The identifier of the subject whose key should be destroyed.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

interface

IAuditEnricher

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditEnricher

Defines a pipeline enricher capable of augmenting or transforming an `AuditRecord` before persistence.

Miembros (1)

  • methodEnrichAsync
    ValueTask<AuditRecord> EnrichAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Enriches the specified `record` with ambient, environmental, or domain-specific attributes.

    record: AuditRecord
    The audit record to enrich.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation, returning the enriched `AuditRecord`.

interface

IAuditFieldEncryptor

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditFieldEncryptor

Defines an authenticated field-level encryption and decryption service for GDPR Art. 17 Crypto-Shredding.

Miembros (2)

  • methodDecryptAsync
    ValueTask<string> DecryptAsync(string ciphertext, string subjectId, CancellationToken cancellationToken = default)

    Decrypts an `ENC:v1:` ciphertext field value using the cryptographic key associated with `subjectId`, or returns `[SHREDDED]` if the subject's key has been permanently destroyed.

    ciphertext: string
    The `ENC:v1:` ciphertext value to decrypt.
    subjectId: string
    The tenant or subject identifier whose encryption key is used.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The decrypted plaintext value, or `[SHREDDED]` if the key was destroyed.

  • methodEncryptAsync
    ValueTask<string> EncryptAsync(string plaintext, string subjectId, CancellationToken cancellationToken = default)

    Encrypts a plaintext field value using the cryptographic key associated with `subjectId`.

    plaintext: string
    The plaintext field value to encrypt.
    subjectId: string
    The tenant or subject identifier whose encryption key is used.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The authenticated ciphertext payload formatted with the `ENC:v1:` envelope prefix.

interface

IAuditHashAlgorithm

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditHashAlgorithm

Defines a cryptographic hashing algorithm used to compute the integrity signature of an audit record.

Miembros (3)

  • methodComputeHash
    int ComputeHash(ReadOnlySpan<byte> data, ReadOnlySpan<byte> key, Span<byte> destination)

    Computes the cryptographic hash for the given data and key, writing the result into the destination span.

    data: ReadOnlySpan<byte>
    The canonicalized payload data to hash.
    key: ReadOnlySpan<byte>
    The cryptographic key.
    destination: Span<byte>
    The destination span to receive the computed hash bytes.

    Retorna: The number of bytes written to the destination span.

  • propertyAlgorithmId
    string AlgorithmId { get; }

    Gets the string identifier of this algorithm, such as "HMACSHA256".

  • propertyHashLengthInBytes
    int HashLengthInBytes { get; }

    Gets the exact length in bytes of the hash produced by this algorithm.

interface

IAuditIntegrityProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditIntegrityProvider

Defines a provider for retrieving cryptographic keys used in HMAC chain integrity verification.

Miembros (1)

  • methodGetCurrentKey
    ReadOnlyMemory<byte> GetCurrentKey(TenantId tenantId)

    Retrieves the current cryptographic key bytes for the specified tenant.

    tenantId: TenantId
    The tenant identifier for which to retrieve the key.

    Retorna: A read-only memory segment containing the cryptographic key bytes.

interface

IAuditIntegrityVerifier

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditIntegrityVerifier

Defines a verifier for evaluating cryptographic chain integrity across audit records.

Miembros (1)

  • methodVerifyChainAsync
    ValueTask<AuditIntegrityVerificationResult> VerifyChainAsync(string tenantId, DateTimeOffset from, DateTimeOffset until, CancellationToken cancellationToken = default)

    Verifies the cryptographic HMAC chain for audit records within the specified time window.

    tenantId: string
    The tenant identifier whose audit chain is to be verified.
    from: DateTimeOffset
    The inclusive start timestamp of the verification window.
    until: DateTimeOffset
    The inclusive end timestamp of the verification window.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the verification outcome details.

interface

IAuditLogger

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditLogger

Provides a simplified facade for creating and persisting audit records without manually resolving actors and scopes.

Miembros (1)

  • methodLogAsync
    ValueTask LogAsync(AuditAction action, AuditResource resource, AuditOutcome outcome, CancellationToken cancellationToken = default)

    Logs an audit event asynchronously.

    action: AuditAction
    The operation that was executed.
    resource: AuditResource
    The target resource on which the operation was performed.
    outcome: AuditOutcome
    The observable result of the operation.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation.

interface

IAuditLogger<TCategoryName>

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditLogger<TCategoryName> : IAuditLogger
Implementa: IAuditLogger

Provides a strongly-typed facade for logging audit records associated with a specific category type.

Miembros (0)

Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).

interface

IAuditRecordReader

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditRecordReader

Defines the read-only persistence contract for querying and streaming immutable audit records (Interface Segregation Principle).

Miembros (2)

  • methodQueryAsync
    ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Queries persisted audit records using the specified filter and pagination parameters.

    query: AuditQuery
    The query parameters and pagination options.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the paginated query results.

  • methodStreamAsync
    async IAsyncEnumerable<AuditRecord> StreamAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Streams all persisted audit records matching the specified filter, automatically handling pagination.

    query: AuditQuery
    The query parameters. Pagination parameters are overridden internally.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: An async-enumerable sequence of matching audit records.

interface

IAuditRecordWriter

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditRecordWriter

Defines the write-only persistence contract for appending immutable audit records (Interface Segregation Principle).

Miembros (2)

  • methodAppendAsync
    ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Appends a single audit record to the persistent store.

    record: AuditRecord
    The audit record to persist.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation.

  • methodAppendBatchAsync
    ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Appends a collection of audit records to the persistent store in a single batch operation.

    records: IReadOnlyList<AuditRecord>
    The collection of audit records to persist.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation.

interface

IAuditSecurityAlertSink

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditSecurityAlertSink

Defines an asynchronous sink for dispatching real-time security alerts (such as `GENESIS`, `BreakGlass`, or delegated support impersonation activity) to SIEM, SOC, or incident-response channels.

Miembros (1)

  • methodEmitAlertAsync
    ValueTask EmitAlertAsync(AuditSecurityAlert alert, CancellationToken cancellationToken = default)

    Emits a structured security alert asynchronously.

    alert: AuditSecurityAlert
    The immutable security alert payload.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous alert dispatch operation.

interface

IAuditSensitivityPipeline

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditSensitivityPipeline

Defines a contract for sanitizing audit records and field changes before persistence.

Miembros (2)

  • methodApplyAsync
    ValueTask<IReadOnlyList<AuditChange>?> ApplyAsync(IReadOnlyList<AuditChange>? changes, string tenantId, CancellationToken cancellationToken = default)

    Applies sensitivity policies to a collection of field changes, returning a sanitized collection.

    changes: IReadOnlyList<AuditChange>?
    The raw collection of field changes to process.
    tenantId: string
    The tenant ID to use for fetching encryption keys.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the sanitized collection of changes, or `null` if all changes were excluded or the input was `null`.

  • methodSanitizeAsync
    ValueTask<AuditRecord> SanitizeAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Sanitizes the specified audit record by applying redaction or exclusions to sensitive fields.

    record: AuditRecord
    The audit record to sanitize.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the sanitized audit record.

interface

IAuditStore

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditStore : IAuditRecordWriter, IAuditRecordReader
Implementa: IAuditRecordReader, IAuditRecordWriter

Defines the persistence store contract for appending and querying immutable audit records.

Miembros (0)

Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).

interface

IAuditTimeProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditTimeProvider

Defines an abstraction for obtaining the current deterministic audit timestamp.

Miembros (1)

  • methodGetUtcNow
    DateTimeOffset GetUtcNow()

    Gets the current deterministic audit timestamp in UTC.

    Retorna: The current UTC timestamp.

interface

IAuditableTarget

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditableTarget

Defines a decoupled persistence contract for domain entities that accept centralized creation, modification, and soft-deletion audit stamps.

Miembros (3)

  • methodMarkCreated
    void MarkCreated(string actorId, DateTimeOffset timestamp)

    Applies creation audit metadata prior to insert execution.

    actorId: string
    The resolved creator identifier.
    timestamp: DateTimeOffset
    The deterministic UTC creation timestamp.
  • methodMarkDeleted
    void MarkDeleted(string actorId, DateTimeOffset timestamp)

    Applies soft-deletion audit metadata prior to soft-delete execution.

    actorId: string
    The resolved deleter identifier.
    timestamp: DateTimeOffset
    The deterministic UTC soft-deletion timestamp.
  • methodMarkUpdated
    void MarkUpdated(string actorId, DateTimeOffset timestamp)

    Applies modification audit metadata prior to update execution.

    actorId: string
    The resolved modifier identifier.
    timestamp: DateTimeOffset
    The deterministic UTC modification timestamp.
interface

IAuditableTarget<TActorId>

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IAuditableTarget<TActorId>

Defines a strongly-typed decoupled persistence contract for domain entities that accept centralized creation, modification, and soft-deletion audit stamps without boxing or string allocations.

Notas:

Type parameters: TActorId: The strongly-typed actor identifier type (for example, `UserId` or `Guid`).

Miembros (3)

  • methodMarkCreated
    void MarkCreated(TActorId actorId, DateTimeOffset timestamp)

    Applies creation audit metadata prior to insert execution.

    actorId: TActorId
    The resolved strongly-typed creator identifier.
    timestamp: DateTimeOffset
    The deterministic UTC creation timestamp.
  • methodMarkDeleted
    void MarkDeleted(TActorId actorId, DateTimeOffset timestamp)

    Applies soft-deletion audit metadata prior to soft-delete execution.

    actorId: TActorId
    The resolved strongly-typed deleter identifier.
    timestamp: DateTimeOffset
    The deterministic UTC soft-deletion timestamp.
  • methodMarkUpdated
    void MarkUpdated(TActorId actorId, DateTimeOffset timestamp)

    Applies modification audit metadata prior to update execution.

    actorId: TActorId
    The resolved strongly-typed modifier identifier.
    timestamp: DateTimeOffset
    The deterministic UTC modification timestamp.
interface

IEntityAuditStamper

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface IEntityAuditStamper

Provides centralized, decoupled entity audit stamping (`AuditEntityForInsert`, `AuditEntityForUpdate`, `AuditEntityForDelete`) driven by `TimeProvider` and impersonation-aware actor resolution for Unit of Work and Dapper repositories.

Miembros (10)

  • methodAuditEntityForDelete
    AuditStamp AuditEntityForDelete(IAuditableTarget entity)

    Stamps soft-deletion metadata onto an `IAuditableTarget` entity immediately prior to SQL soft-delete execution.

    entity: IAuditableTarget
    The entity to stamp for soft-deletion.

    Retorna: The applied `AuditStamp`.

  • methodAuditEntityForDelete<TActorId>
    AuditStamp AuditEntityForDelete<TActorId>(IAuditableTarget<TActorId> entity, Func<string, TActorId> actorParser)

    Stamps soft-deletion metadata onto a strongly-typed `IAuditableTarget<TActorId>` entity.

    entity: IAuditableTarget<TActorId>
    The entity to stamp for soft-deletion.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.

    Retorna: The applied `AuditStamp`.

    Type parameters: TActorId: The strongly-typed actor identifier.

  • methodAuditEntityForDelete<TEntity, TActorId>
    AuditStamp AuditEntityForDelete<TEntity, TActorId>(TEntity entity, Func<string, TActorId> actorParser, Action<TEntity, TActorId, DateTimeOffset> applyStamp) where TEntity : class

    Stamps soft-deletion metadata onto an arbitrary pure-domain entity using an explicit zero-reflection callback.

    entity: TEntity
    The pure domain entity instance.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.
    applyStamp: Action<TEntity, TActorId, DateTimeOffset>
    The callback invoking the entity's soft-delete audit method (for example, `(e, uid, ts) => e.MarkDeleted(uid, ts)`).

    Retorna: The applied `AuditStamp`.

    Type parameters: TEntity: The pure domain entity type.; TActorId: The strongly-typed actor identifier type.

  • methodAuditEntityForInsert
    AuditStamp AuditEntityForInsert(IAuditableTarget entity)

    Stamps creation metadata onto an `IAuditableTarget` entity immediately prior to SQL insert execution.

    entity: IAuditableTarget
    The entity to stamp for insertion.

    Retorna: The applied `AuditStamp`.

  • methodAuditEntityForInsert<TActorId>
    AuditStamp AuditEntityForInsert<TActorId>(IAuditableTarget<TActorId> entity, Func<string, TActorId> actorParser)

    Stamps creation metadata onto a strongly-typed `IAuditableTarget<TActorId>` entity.

    entity: IAuditableTarget<TActorId>
    The entity to stamp for insertion.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.

    Retorna: The applied `AuditStamp`.

    Type parameters: TActorId: The strongly-typed actor identifier.

  • methodAuditEntityForInsert<TEntity, TActorId>
    AuditStamp AuditEntityForInsert<TEntity, TActorId>(TEntity entity, Func<string, TActorId> actorParser, Action<TEntity, TActorId, DateTimeOffset> applyStamp) where TEntity : class

    Stamps creation metadata onto an arbitrary pure-domain entity using an explicit zero-reflection callback.

    entity: TEntity
    The pure domain entity instance.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.
    applyStamp: Action<TEntity, TActorId, DateTimeOffset>
    The callback invoking the entity's creation audit method (for example, `(e, uid, ts) => e.MarkCreated(uid, ts)`).

    Retorna: The applied `AuditStamp`.

    Type parameters: TEntity: The pure domain entity type.; TActorId: The strongly-typed actor identifier type.

  • methodAuditEntityForUpdate
    AuditStamp AuditEntityForUpdate(IAuditableTarget entity)

    Stamps modification metadata onto an `IAuditableTarget` entity immediately prior to SQL update execution.

    entity: IAuditableTarget
    The entity to stamp for update.

    Retorna: The applied `AuditStamp`.

  • methodAuditEntityForUpdate<TActorId>
    AuditStamp AuditEntityForUpdate<TActorId>(IAuditableTarget<TActorId> entity, Func<string, TActorId> actorParser)

    Stamps modification metadata onto a strongly-typed `IAuditableTarget<TActorId>` entity.

    entity: IAuditableTarget<TActorId>
    The entity to stamp for update.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.

    Retorna: The applied `AuditStamp`.

    Type parameters: TActorId: The strongly-typed actor identifier.

  • methodAuditEntityForUpdate<TEntity, TActorId>
    AuditStamp AuditEntityForUpdate<TEntity, TActorId>(TEntity entity, Func<string, TActorId> actorParser, Action<TEntity, TActorId, DateTimeOffset> applyStamp) where TEntity : class

    Stamps modification metadata onto an arbitrary pure-domain entity using an explicit zero-reflection callback.

    entity: TEntity
    The pure domain entity instance.
    actorParser: Func<string, TActorId>
    A deterministic conversion function mapping the resolved actor string to `TActorId`.
    applyStamp: Action<TEntity, TActorId, DateTimeOffset>
    The callback invoking the entity's update audit method (for example, `(e, uid, ts) => e.MarkUpdated(uid, ts)`).

    Retorna: The applied `AuditStamp`.

    Type parameters: TEntity: The pure domain entity type.; TActorId: The strongly-typed actor identifier type.

  • methodCaptureStamp
    AuditStamp CaptureStamp()

    Captures the current deterministic `AuditStamp` from the active `TimeProvider`, ambient scope, and actor provider.

    Retorna: An immutable `AuditStamp` representing the active actor, optional impersonator, plane, and UTC timestamp.

interface

ITransactionalAuditStore

Ensamblado: EricksonLopez.Auditing.Abstractions
public interface ITransactionalAuditStore : IAuditStore
Implementa: IAuditStore

Extends `IAuditStore` with explicit ADO.NET connection and transaction enlistment so forensic security audit records commit or roll back atomically within an active Unit of Work transaction.

Miembros (2)

  • methodAppendAsync
    ValueTask AppendAsync(AuditRecord record, IDbConnection connection, IDbTransaction? transaction = null, CancellationToken cancellationToken = default)

    Appends a single immutable audit record using the caller-owned database connection and optional active transaction.

    record: AuditRecord
    The immutable audit record to persist.
    connection: IDbConnection
    The caller-managed database connection.
    transaction: IDbTransaction?
    The optional active database transaction to enlist into.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous operation.

  • methodAppendBatchAsync
    ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, IDbConnection connection, IDbTransaction? transaction = null, CancellationToken cancellationToken = default)

    Appends an ordered batch of immutable audit records using the caller-owned database connection and optional active transaction.

    records: IReadOnlyList<AuditRecord>
    The ordered collection of audit records to persist.
    connection: IDbConnection
    The caller-managed database connection.
    transaction: IDbTransaction?
    The optional active database transaction to enlist into.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous operation.

class

InMemoryCryptoKeyProvider

Ensamblado: EricksonLopez.Auditing
public sealed class InMemoryCryptoKeyProvider : IAuditCryptoKeyProvider
Implementa: IAuditCryptoKeyProvider

Provides an in-memory implementation of `IAuditCryptoKeyProvider` supporting per-subject AES-256 key generation and irreversible cryptographic key destruction (GDPR Art. 17 Crypto-Shredding).

Miembros (3)

  • methodGetEncryptionKeyAsync
    public ValueTask<byte[]> GetEncryptionKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Retrieves or generates the encryption key associated with a specific subject (e.g., tenant or actor).

    subjectId: string
    The identifier of the subject whose data requires encryption.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation. The task result contains a 32-byte cryptographic key for AES-GCM encryption.

  • methodIsKeyShredded
    public bool IsKeyShredded(string subjectId)

    Determines whether the cryptographic key for the specified subject has been permanently shredded.

    subjectId: string
    The subject identifier to check.

    Retorna: `true` if the subject's key has been shredded; otherwise, `false`.

  • methodShredKeyAsync
    public ValueTask ShredKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Permanently deletes the encryption key associated with a specific subject, rendering all their encrypted PII permanently inaccessible.

    subjectId: string
    The identifier of the subject whose key should be destroyed.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

class

IntegrityAuditStoreDecorator

Ensamblado: EricksonLopez.Auditing
public sealed class IntegrityAuditStoreDecorator : IAuditStore, IAsyncDisposable, IDisposable
Implementa: IAsyncDisposable, IAuditStore, IDisposable

Provides cryptographic HMAC-SHA256 integrity chaining for an `IAuditStore` before records are persisted to the underlying store.

Miembros (6)

  • constructorIntegrityAuditStoreDecorator
    public IntegrityAuditStoreDecorator(IAuditStore innerStore, HmacAuditIntegrityService integrityService, KeyedSemaphoreSlim? keyedLocks = null, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `IntegrityAuditStoreDecorator` class.

    innerStore: IAuditStore
    The underlying audit store where records are persisted.
    integrityService: HmacAuditIntegrityService
    The service used to compute HMAC integrity hashes.
    keyedLocks: KeyedSemaphoreSlim?
    Optional keyed concurrency lock primitive for per-tenant serialization.
    sensitivityPipeline: IAuditSensitivityPipeline?
    Optional sensitivity pipeline executed prior to HMAC calculation.

    Exceptions: ArgumentNullException: `innerStore` or `integrityService` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodDisposeAsync
    public async ValueTask DisposeAsync()

    Inherits documentation from base type or interface.

  • methodQueryAsync
    public ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

ResilientAuditStoreDecorator

Ensamblado: EricksonLopez.Auditing
public sealed partial class ResilientAuditStoreDecorator : IAuditStore
Implementa: IAuditStore

Provides failure resilience policies (`AuditFailureBehavior`) and critical action protection for an underlying `IAuditStore`.

Miembros (4)

  • constructorResilientAuditStoreDecorator
    public ResilientAuditStoreDecorator(IAuditStore innerStore, AuditConfiguration configuration, ILogger<ResilientAuditStoreDecorator>? logger = null)

    Initializes a new instance of the `ResilientAuditStoreDecorator` class.

    innerStore: IAuditStore
    The underlying audit store to decorate.
    configuration: AuditConfiguration
    The audit configuration defining failure behaviors.
    logger: ILogger<ResilientAuditStoreDecorator>?
    Optional logger for diagnostic warnings when operating in FailOpen mode.

    Exceptions: ArgumentNullException: `innerStore` or `configuration` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

SecurityAlertAuditStoreDecorator

Ensamblado: EricksonLopez.Auditing
public sealed partial class SecurityAlertAuditStoreDecorator : IAuditStore, IAsyncDisposable, IDisposable
Implementa: IAsyncDisposable, IAuditStore, IDisposable

Decorates an `IAuditStore` to evaluate high-criticality security audit events (including root `GENESIS` identity operations, `BreakGlass` emergency access, `BOOTSTRAP` plane mutations, delegated support impersonation, and denied security-sensitive actions) and emit structured alerts to `IAuditSecurityAlertSink` subscribers and diagnostic loggers.

Miembros (12)

  • constructorSecurityAlertAuditStoreDecorator
    public SecurityAlertAuditStoreDecorator(IAuditStore innerStore, IEnumerable<IAuditSecurityAlertSink>? alertSinks = null, TimeProvider? timeProvider = null, ILogger<SecurityAlertAuditStoreDecorator>? logger = null)

    Initializes a new instance of the `SecurityAlertAuditStoreDecorator` class.

    innerStore: IAuditStore
    The underlying audit store to decorate.
    alertSinks: IEnumerable<IAuditSecurityAlertSink>?
    The optional sequence of registered security alert sinks.
    timeProvider: TimeProvider?
    The optional deterministic `TimeProvider`.
    logger: ILogger<SecurityAlertAuditStoreDecorator>?
    The optional structured logger.

    Exceptions: ArgumentNullException: `innerStore` is `null`.

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodDisposeAsync
    public async ValueTask DisposeAsync()

    Inherits documentation from base type or interface.

  • methodQueryAsync
    public ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
  • methodTryBuildAlert
    public bool TryBuildAlert(AuditRecord record, out AuditSecurityAlert? alert)

    Evaluates whether the specified `AuditRecord` warrants a real-time `AuditSecurityAlert`.

    record: AuditRecord
    The audit record to inspect.
    alert: out AuditSecurityAlert?
    When this method returns `true`, contains the constructed `AuditSecurityAlert`; otherwise, `null`.

    Retorna: `true` if an alert was generated; otherwise, `false`.

  • fieldBootstrapPlaneAlertCode
    public const string BootstrapPlaneAlertCode

    Alert code emitted when an operation is executed on `AuditExecutionPlane.Bootstrap`.

  • fieldBreakGlassAlertCode
    public const string BreakGlassAlertCode

    Alert code emitted when an operation is executed under `AuditSecurityClassification.BreakGlass`.

  • fieldGenesisAlertCode
    public const string GenesisAlertCode

    Alert code emitted when an operation is executed under `AuditSecurityClassification.Genesis`.

  • fieldImpersonationAlertCode
    public const string ImpersonationAlertCode

    Alert code emitted when an operation is executed under active delegated support impersonation.

  • fieldSecurityAccessDeniedAlertCode
    public const string SecurityAccessDeniedAlertCode

    Alert code emitted when a security-classified operation is rejected (`AuditOutcome.Denied`).

class

SensitivityAuditStoreDecorator

Ensamblado: EricksonLopez.Auditing
public sealed class SensitivityAuditStoreDecorator : IAuditStore, IAsyncDisposable, IDisposable
Implementa: IAsyncDisposable, IAuditStore, IDisposable

Provides pre-persistence sensitivity sanitization (denylist stripping, redaction, truncation, and field encryption) for an `IAuditStore` so that downstream decorators (such as HMAC integrity signing and channel buffering) operate exclusively on sanitized records.

Miembros (6)

  • constructorSensitivityAuditStoreDecorator
    public SensitivityAuditStoreDecorator(IAuditStore innerStore, IAuditSensitivityPipeline sensitivityPipeline)

    Initializes a new instance of the `SensitivityAuditStoreDecorator` class.

    innerStore: IAuditStore
    The inner audit store to receive sanitized records.
    sensitivityPipeline: IAuditSensitivityPipeline
    The sensitivity pipeline used to sanitize records before persistence.

    Exceptions: ArgumentNullException: `innerStore` or `sensitivityPipeline` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodDisposeAsync
    public async ValueTask DisposeAsync()

    Inherits documentation from base type or interface.

  • methodQueryAsync
    public ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

SystemAuditActorProvider

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed class SystemAuditActorProvider : IAuditActorProvider
Implementa: IAuditActorProvider

Provides a default actor provider that returns `AuditActor.System` for background operations.

Miembros (2)

  • methodGetCurrentActor
    public AuditActor GetCurrentActor()

    Resolves the current authenticated actor identity.

    Retorna: The `AuditActor` performing the current operation, or `AuditActor.Anonymous` if unauthenticated.

  • fieldInstance
    public static readonly SystemAuditActorProvider Instance

    Gets the singleton instance of `SystemAuditActorProvider`.

class

SystemTimeProviderAuditAdapter

Ensamblado: EricksonLopez.Auditing.Abstractions
public sealed class SystemTimeProviderAuditAdapter : IAuditTimeProvider
Implementa: IAuditTimeProvider

Adapts the .NET BCL `TimeProvider` to `IAuditTimeProvider` while honoring active `AmbientAuditTimeProvider` deterministic scopes.

Miembros (2)

  • constructorSystemTimeProviderAuditAdapter
    public SystemTimeProviderAuditAdapter(TimeProvider? timeProvider = null)

    Initializes a new instance of the `SystemTimeProviderAuditAdapter` class.

    timeProvider: TimeProvider?
    The optional BCL `TimeProvider`. Defaults to `TimeProvider.System` when `null`.
  • methodGetUtcNow
    public DateTimeOffset GetUtcNow()

    Gets the current deterministic audit timestamp in UTC.

    Retorna: The current UTC timestamp.

record

TenantId

Ensamblado: EricksonLopez.Auditing.Abstractions
public readonly record struct TenantId

Represents a strongly-typed, immutable tenant identifier for auditing boundaries.

Miembros (5)

  • constructorTenantId
    public TenantId(string value)

    Initializes a new instance of the `TenantId` struct.

    value: string
    The non-empty string value of the tenant.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodimplicit operator TenantId
    public static implicit operator TenantId(string value)

    Converts a `string` to a `TenantId`.

    value: string
    The string value to convert.

    Retorna: A new `TenantId` instance initialized with the specified value.

  • methodimplicit operator string
    public static implicit operator string(TenantId tenantId)

    Converts a `TenantId` to a `string`.

    tenantId: TenantId
    The tenant identifier to convert.

    Retorna: The string representation of the tenant identifier.

  • propertyValue
    public string Value { get; }

    Gets the raw string value of the tenant identifier.

EricksonLopez.Auditing.Analyzers#

2
class

AuditScopeUsageAnalyzer

Ensamblado: EricksonLopez.Auditing.Analyzers
public sealed class AuditScopeUsageAnalyzer : DiagnosticAnalyzer
Hereda de: DiagnosticAnalyzer

Provides diagnostic analysis to ensure that `AuditScope` instances are captured in using statements.

Miembros (3)

  • methodInitialize
    public override void Initialize(AnalysisContext context)

    Inherits documentation from base type or interface.

    context: AnalysisContext
  • propertySupportedDiagnostics
    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }

    Inherits documentation from base type or interface.

  • fieldDiagnosticId
    public const string DiagnosticId

    Gets the diagnostic rule identifier for uncaptured audit scopes.

class

SyncOverAsyncAnalyzer

Ensamblado: EricksonLopez.Auditing.Analyzers
public sealed class SyncOverAsyncAnalyzer : DiagnosticAnalyzer
Hereda de: DiagnosticAnalyzer

Provides diagnostic analysis to detect synchronous blocking (sync-over-async) calls on asynchronous auditing operations.

Miembros (3)

  • methodInitialize
    public override void Initialize(AnalysisContext context)

    Inherits documentation from base type or interface.

    context: AnalysisContext
  • propertySupportedDiagnostics
    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }

    Inherits documentation from base type or interface.

  • fieldDiagnosticId
    public const string DiagnosticId

    Gets the diagnostic rule identifier for sync-over-async blocking on auditing operations.

EricksonLopez.Auditing.AzureKeyVault#

2
class

AzureKeyVaultCryptoKeyProvider

Ensamblado: EricksonLopez.Auditing.AzureKeyVault
public sealed class AzureKeyVaultCryptoKeyProvider : IAuditCryptoKeyProvider
Implementa: IAuditCryptoKeyProvider

Provides asynchronous per-subject cryptographic key management and GDPR Art. 17 crypto-shredding backed by Azure Key Vault.

Miembros (4)

  • constructorAzureKeyVaultCryptoKeyProvider
    public AzureKeyVaultCryptoKeyProvider(SecretClient secretClient)

    Initializes a new instance of the `AzureKeyVaultCryptoKeyProvider` class with a custom `SecretClient`.

    secretClient: SecretClient
    The Azure Key Vault secret client.

    Exceptions: ArgumentNullException: `secretClient` is `null`

  • constructorAzureKeyVaultCryptoKeyProvider
    public AzureKeyVaultCryptoKeyProvider(Uri keyVaultUri)

    Initializes a new instance of the `AzureKeyVaultCryptoKeyProvider` class using `DefaultAzureCredential`.

    keyVaultUri: Uri
    The URI to the Azure Key Vault.

    Exceptions: ArgumentNullException: `keyVaultUri` is `null`

  • methodGetEncryptionKeyAsync
    public async ValueTask<byte[]> GetEncryptionKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Retrieves or generates the encryption key associated with a specific subject (e.g., tenant or actor).

    subjectId: string
    The identifier of the subject whose data requires encryption.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation. The task result contains a 32-byte cryptographic key for AES-GCM encryption.

  • methodShredKeyAsync
    public async ValueTask ShredKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Permanently deletes the encryption key associated with a specific subject, rendering all their encrypted PII permanently inaccessible.

    subjectId: string
    The identifier of the subject whose key should be destroyed.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

class

AzureKeyVaultIntegrityProvider

Ensamblado: EricksonLopez.Auditing.AzureKeyVault
public sealed class AzureKeyVaultIntegrityProvider : IAuditIntegrityProvider
Implementa: IAuditIntegrityProvider

Provides cryptographic integrity keys fetched dynamically from Azure Key Vault.

Miembros (5)

  • constructorAzureKeyVaultIntegrityProvider
    public AzureKeyVaultIntegrityProvider(SecretClient secretClient)

    Initializes a new instance of the `AzureKeyVaultIntegrityProvider` class with a custom `SecretClient`.

    secretClient: SecretClient
    The secret client.

    Exceptions: ArgumentNullException: `secretClient` is `null`

  • constructorAzureKeyVaultIntegrityProvider
    public AzureKeyVaultIntegrityProvider(Uri keyVaultUri)

    Initializes a new instance of the `AzureKeyVaultIntegrityProvider` class.

    keyVaultUri: Uri
    The URI to the Azure Key Vault.

    Exceptions: ArgumentNullException: `keyVaultUri` is `null`

  • methodGetCurrentKey
    public ReadOnlyMemory<byte> GetCurrentKey(TenantId tenantId)

    Retrieves the current cryptographic key bytes for the specified tenant.

    tenantId: TenantId
    The tenant identifier for which to retrieve the key.

    Retorna: A read-only memory segment containing the cryptographic key bytes.

  • methodGetCurrentKeyAsync
    public async ValueTask<ReadOnlyMemory<byte>> GetCurrentKeyAsync(TenantId tenantId, CancellationToken cancellationToken = default)

    Asynchronously retrieves and caches the current cryptographic key bytes for the specified tenant from Azure Key Vault without blocking threads.

    tenantId: TenantId
    The tenant identifier for which to retrieve the key.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A read-only memory segment containing the cryptographic key bytes.

  • methodPreloadKeyAsync
    public async ValueTask PreloadKeyAsync(TenantId tenantId, CancellationToken cancellationToken = default)

    Preloads the cryptographic key for the specified tenant into the in-memory cache asynchronously.

    tenantId: TenantId
    The tenant identifier whose key should be preloaded.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous preload operation.

EricksonLopez.Auditing.Dapper#

3
class

DapperAuditExtensions

Ensamblado: EricksonLopez.Auditing.Dapper
public static class DapperAuditExtensions

Provides extension methods for registering Dapper-based audit persistence services.

Miembros (1)

  • methodUseDapper
    public static IAuditBuilder UseDapper(this IAuditBuilder builder, Action<DapperAuditStoreOptions> configure)

    Registers `DapperAuditStore` as the audit storage provider in the service collection.

    builder: this IAuditBuilder
    The audit builder instance being configured.
    configure: Action<DapperAuditStoreOptions>
    A delegate to configure the Dapper audit store options.

    Retorna: The `IAuditBuilder` instance for fluent chaining.

    Exceptions: ArgumentNullException: `builder` or `configure` is `null`; InvalidOperationException: `DapperAuditStoreOptions.ConnectionFactory` was not configured Example:

    services.AddAuditing()
            .UseDapper(options =>
            {
                options.ConnectionFactory = () => new SqlConnection(connectionString);
            });
class

DapperAuditStore

Ensamblado: EricksonLopez.Auditing.Dapper
public sealed class DapperAuditStore : ITransactionalAuditStore
Implementa: ITransactionalAuditStore

Provides a database-agnostic audit store implementation using Dapper and standard ANSI SQL with transactional Unit of Work enlistment support.

Miembros (7)

  • constructorDapperAuditStore
    public DapperAuditStore(DapperAuditStoreOptions options)

    Initializes a new instance of the `DapperAuditStore` class.

    options: DapperAuditStoreOptions
    The configuration options for the Dapper audit store.

    Exceptions: ArgumentNullException: `options` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, IDbConnection connection, IDbTransaction? transaction = null, CancellationToken cancellationToken = default)

    Appends a single immutable audit record using the caller-owned database connection and optional active transaction.

    record: AuditRecord
    The immutable audit record to persist.
    connection: IDbConnection
    The caller-managed database connection.
    transaction: IDbTransaction?
    The optional active database transaction to enlist into.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous operation.

  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, IDbConnection connection, IDbTransaction? transaction = null, CancellationToken cancellationToken = default)

    Appends an ordered batch of immutable audit records using the caller-owned database connection and optional active transaction.

    records: IReadOnlyList<AuditRecord>
    The ordered collection of audit records to persist.
    connection: IDbConnection
    The caller-managed database connection.
    transaction: IDbTransaction?
    The optional active database transaction to enlist into.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous operation.

  • methodGetByIdAsync
    public async ValueTask<AuditRecord?> GetByIdAsync(Guid id, string tenantId, CancellationToken cancellationToken = default)

    Retrieves a single audit record by its unique identifier and tenant scope.

    id: Guid
    The unique identifier of the audit record to retrieve.
    tenantId: string
    The tenant identifier scoping the lookup.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous operation. The task result contains the matching `AuditRecord`, or `null` if not found.

    Exceptions: ArgumentException: `tenantId` is `null` or empty

  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

DapperAuditStoreOptions

Ensamblado: EricksonLopez.Auditing.Dapper
public sealed partial class DapperAuditStoreOptions

Represents configuration options for `DapperAuditStore`.

Miembros (3)

  • propertyConnectionFactory
    public Func<IDbConnection> ConnectionFactory { get; set; }

    Gets or sets the factory function that creates open database connections for executing audit commands.

  • propertyIncludeExtendedSecurityColumns
    public bool IncludeExtendedSecurityColumns { get; set; }

    Gets or sets a value indicating whether extended multi-plane, organization, security classification, impersonation, and metadata columns are persisted and projected. Defaults to `false` for backward compatibility with baseline tables.

  • propertyTable
    public string Table { get; set; }

    Gets or sets the database table name where audit records are stored.

    Exceptions: ArgumentException: `value` is not a valid SQL identifier

EricksonLopez.Auditing.EntityFrameworkCore#

5
class

AuditDbContext

Ensamblado: EricksonLopez.Auditing.EntityFrameworkCore
public class AuditDbContext : DbContext
Hereda de: DbContext

Represents the Entity Framework Core database context for persisting and querying audit records.

Miembros (2)

  • constructorAuditDbContext
    public AuditDbContext(DbContextOptions<AuditDbContext> options)

    Initializes a new instance of the `AuditDbContext` class with strongly-typed options.

    options: DbContextOptions<AuditDbContext>
    The options to be used by this `DbContext`.
  • propertyAuditRecords
    public DbSet<AuditRecordEntity> AuditRecords { get; }

    Gets the entity set of persisted audit records.

class

AuditDbContextModelBuilderExtensions

Ensamblado: EricksonLopez.Auditing.EntityFrameworkCore
public static class AuditDbContextModelBuilderExtensions

Provides extension methods for configuring audit record entity mappings on `ModelBuilder`.

Miembros (1)

  • methodApplyAuditRecordConfiguration
    public static ModelBuilder ApplyAuditRecordConfiguration(this ModelBuilder modelBuilder, string tableName = "")

    Configures the entity mapping, indexes, and column constraints for `AuditRecordEntity`.

    modelBuilder: this ModelBuilder
    The model builder being configured.
    tableName: string
    The database table name for audit records.

    Retorna: The same `ModelBuilder` instance for fluent chaining.

class

AuditRecordEntity

Ensamblado: EricksonLopez.Auditing.EntityFrameworkCore
public sealed class AuditRecordEntity

Represents a persisted audit record entity in an Entity Framework Core data store.

Miembros (23)

  • propertyActionCode
    public string ActionCode { get; set; }

    Gets or sets the action code identifying the executed operation.

  • propertyActorId
    public string ActorId { get; set; }

    Gets or sets the stable identifier of the actor.

  • propertyActorName
    public string? ActorName { get; set; }

    Gets or sets the optional display name of the actor.

  • propertyActorType
    public byte ActorType { get; set; }

    Gets or sets the classification code of the actor.

  • propertyAggregateId
    public string? AggregateId { get; set; }

    Gets or sets the optional aggregate root identifier.

  • propertyAggregateType
    public string? AggregateType { get; set; }

    Gets or sets the optional aggregate root entity type.

  • propertyCausationId
    public string? CausationId { get; set; }

    Gets or sets the optional identifier of the direct causal event.

  • propertyChangesJson
    public string? ChangesJson { get; set; }

    Gets or sets the serialized JSON payload representing field-level changes.

  • propertyCorrelationId
    public string? CorrelationId { get; set; }

    Gets or sets the optional correlation identifier linking related operations.

  • propertyErrorCode
    public string? ErrorCode { get; set; }

    Gets or sets the optional error code for unsuccessful outcomes.

  • propertyId
    public Guid Id { get; set; }

    Gets or sets the unique, time-ordered identifier of the audit record.

  • propertyIdempotencyKey
    public string? IdempotencyKey { get; set; }

    Gets or sets the optional idempotency key preventing duplicate writes during concurrent retries.

  • propertyIntegrityHash
    public string? IntegrityHash { get; set; }

    Gets or sets the cryptographic HMAC hash for chain integrity verification.

  • propertyIpAddress
    public string? IpAddress { get; set; }

    Gets or sets the optional client network IP address.

  • propertyOccurredAt
    public DateTimeOffset OccurredAt { get; set; }

    Gets or sets the timestamp when the action occurred in UTC.

  • propertyOutcome
    public byte Outcome { get; set; }

    Gets or sets the outcome classification code of the operation.

  • propertyPreviousHash
    public string? PreviousHash { get; set; }

    Gets or sets the cryptographic HMAC hash of the preceding record in the chain.

  • propertyRequestId
    public string? RequestId { get; set; }

    Gets or sets the optional transport-level request identifier.

  • propertyResourceId
    public string ResourceId { get; set; }

    Gets or sets the stable identifier of the target resource.

  • propertyResourceType
    public string ResourceType { get; set; }

    Gets or sets the logical type of the target resource.

  • propertySource
    public string Source { get; set; }

    Gets or sets the originating system source component.

  • propertyTenantId
    public string TenantId { get; set; }

    Gets or sets the tenant identifier scoping the audit record.

  • propertyUserAgent
    public string? UserAgent { get; set; }

    Gets or sets the optional client user agent string.

class

AuditingEfCoreExtensions

Ensamblado: EricksonLopez.Auditing.EntityFrameworkCore
public static class AuditingEfCoreExtensions

Provides extension methods for registering Entity Framework Core audit persistence services.

Miembros (1)

  • methodAddEntityFrameworkCoreAuditStore
    public static IServiceCollection AddEntityFrameworkCoreAuditStore(this IServiceCollection services, Action<DbContextOptionsBuilder> configureDbContext)

    Registers `EfCoreAuditStore` as the audit storage provider in the service collection.

    services: this IServiceCollection
    The service collection to configure.
    configureDbContext: Action<DbContextOptionsBuilder>
    A delegate to configure the `DbContextOptionsBuilder` for the audit database context.

    Retorna: The configured `IServiceCollection` instance.

    Exceptions: ArgumentNullException: `services` or `configureDbContext` is `null`

class

EfCoreAuditStore

Ensamblado: EricksonLopez.Auditing.EntityFrameworkCore
public sealed class EfCoreAuditStore : IAuditStore
Implementa: IAuditStore

Provides an Entity Framework Core persistence store for immutable audit records.

Miembros (4)

  • constructorEfCoreAuditStore
    public EfCoreAuditStore(IDbContextFactory<AuditDbContext> contextFactory, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `EfCoreAuditStore` class.

    contextFactory: IDbContextFactory<AuditDbContext>
    The database context factory used to create `AuditDbContext` instances.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `contextFactory` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken

EricksonLopez.Auditing.MongoDb#

5
class

AuditingMongoDbExtensions

Ensamblado: EricksonLopez.Auditing.MongoDb
public static class AuditingMongoDbExtensions

Provides extension methods for registering MongoDB audit persistence services.

Miembros (1)

  • methodAddMongoDbAuditStore
    public static IServiceCollection AddMongoDbAuditStore(this IServiceCollection services, Func<IServiceProvider, IMongoDatabase> databaseFactory, Action<MongoAuditStoreOptions>? configure = null)

    Registers `MongoAuditStore` as the audit storage provider in the service collection.

    services: this IServiceCollection
    The service collection to configure.
    databaseFactory: Func<IServiceProvider, IMongoDatabase>
    A factory function that resolves the target `IMongoDatabase` instance.
    configure: Action<MongoAuditStoreOptions>?
    An optional delegate to configure MongoDB audit store options.

    Retorna: The configured `IServiceCollection` instance.

    Exceptions: ArgumentNullException: `services` or `databaseFactory` is `null`

class

MongoAuditChangeDocument

Ensamblado: EricksonLopez.Auditing.MongoDb
public sealed class MongoAuditChangeDocument

Represents a single field-level change sub-document in MongoDB.

Miembros (4)

  • propertyField
    public string Field { get; set; }

    Gets or sets the name of the modified field or property.

  • propertyIsRedacted
    public bool IsRedacted { get; set; }

    Gets or sets a value indicating whether the actual values were withheld by sensitivity policies.

  • propertyNewValue
    public string? NewValue { get; set; }

    Gets or sets the value after the change.

  • propertyOldValue
    public string? OldValue { get; set; }

    Gets or sets the value before the change.

class

MongoAuditRecordDocument

Ensamblado: EricksonLopez.Auditing.MongoDb
public sealed class MongoAuditRecordDocument

Represents a persisted audit record document in MongoDB.

Miembros (23)

  • propertyActionCode
    public string ActionCode { get; set; }

    Gets or sets the action code identifying the executed operation.

  • propertyActorId
    public string ActorId { get; set; }

    Gets or sets the stable identifier of the actor.

  • propertyActorName
    public string? ActorName { get; set; }

    Gets or sets the optional display name of the actor.

  • propertyActorType
    public byte ActorType { get; set; }

    Gets or sets the classification code of the actor.

  • propertyAggregateId
    public string? AggregateId { get; set; }

    Gets or sets the optional aggregate root identifier.

  • propertyAggregateType
    public string? AggregateType { get; set; }

    Gets or sets the optional aggregate root entity type.

  • propertyCausationId
    public string? CausationId { get; set; }

    Gets or sets the optional identifier of the direct causal event.

  • propertyChanges
    public List<MongoAuditChangeDocument>? Changes { get; set; }

    Gets or sets the collection of field-level changes captured in the record.

  • propertyCorrelationId
    public string? CorrelationId { get; set; }

    Gets or sets the optional correlation identifier linking related operations.

  • propertyErrorCode
    public string? ErrorCode { get; set; }

    Gets or sets the optional error code for unsuccessful outcomes.

  • propertyId
    public Guid Id { get; set; }

    Gets or sets the unique, time-ordered identifier of the audit record.

  • propertyIdempotencyKey
    public string? IdempotencyKey { get; set; }

    Gets or sets the optional idempotency key.

  • propertyIntegrityHash
    public string? IntegrityHash { get; set; }

    Gets or sets the cryptographic HMAC hash for chain integrity verification.

  • propertyIpAddress
    public string? IpAddress { get; set; }

    Gets or sets the optional client network IP address.

  • propertyOccurredAt
    public DateTime OccurredAt { get; set; }

    Gets or sets the timestamp when the action occurred in UTC.

  • propertyOutcome
    public byte Outcome { get; set; }

    Gets or sets the outcome classification code of the operation.

  • propertyPreviousHash
    public string? PreviousHash { get; set; }

    Gets or sets the cryptographic HMAC hash of the preceding record in the chain.

  • propertyRequestId
    public string? RequestId { get; set; }

    Gets or sets the optional transport-level request identifier.

  • propertyResourceId
    public string ResourceId { get; set; }

    Gets or sets the stable identifier of the target resource.

  • propertyResourceType
    public string ResourceType { get; set; }

    Gets or sets the logical type of the target resource.

  • propertySource
    public string Source { get; set; }

    Gets or sets the originating system source component.

  • propertyTenantId
    public string TenantId { get; set; }

    Gets or sets the tenant identifier scoping the audit record.

  • propertyUserAgent
    public string? UserAgent { get; set; }

    Gets or sets the optional client user agent string.

class

MongoAuditStore

Ensamblado: EricksonLopez.Auditing.MongoDb
public sealed class MongoAuditStore : IAuditStore
Implementa: IAuditStore

Provides a MongoDB persistence store for immutable audit records.

Miembros (5)

  • constructorMongoAuditStore
    public MongoAuditStore(IMongoCollection<MongoAuditRecordDocument> collection, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `MongoAuditStore` class with a MongoDB collection.

    collection: IMongoCollection<MongoAuditRecordDocument>
    The MongoDB collection used to persist audit records.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `collection` is `null`

  • constructorMongoAuditStore
    public MongoAuditStore(IMongoDatabase database, MongoAuditStoreOptions options, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `MongoAuditStore` class with a database and configuration options.

    database: IMongoDatabase
    The MongoDB database hosting the audit collection.
    options: MongoAuditStoreOptions
    The configuration options for the MongoDB audit store.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `database` or `options` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

MongoAuditStoreOptions

Ensamblado: EricksonLopez.Auditing.MongoDb
public sealed class MongoAuditStoreOptions

Represents configuration options for `MongoAuditStore`.

Miembros (2)

  • propertyCollectionName
    public string CollectionName { get; set; }

    Gets or sets the MongoDB collection name for storing audit records.

  • propertyDatabaseName
    public string DatabaseName { get; set; }

    Gets or sets the MongoDB database name hosting the audit records collection.

EricksonLopez.Auditing.MySql#

4
class

MySqlAuditExtensions

Ensamblado: EricksonLopez.Auditing.MySql
public static class MySqlAuditExtensions

Provides extension methods for registering MySQL and MariaDB audit persistence services.

Miembros (1)

  • methodUseMySql
    public static IAuditBuilder UseMySql(this IAuditBuilder builder, Action<MySqlAuditStoreOptions> configure)

    Registers `MySqlAuditStore` as the audit storage provider in the service collection.

    builder: this IAuditBuilder
    The audit builder instance being configured.
    configure: Action<MySqlAuditStoreOptions>
    A delegate to configure MySQL audit store options.

    Retorna: The `IAuditBuilder` instance for fluent chaining.

    Exceptions: ArgumentNullException: `builder` or `configure` is `null` Example:

    services.AddAuditing()
            .UseMySql(options =>
            {
                options.ConnectionFactory = () => new MySqlConnection(connectionString);
            });
class

MySqlAuditIntegrityVerifier

Ensamblado: EricksonLopez.Auditing.MySql
public sealed class MySqlAuditIntegrityVerifier : IAuditIntegrityVerifier
Implementa: IAuditIntegrityVerifier

Provides cryptographic HMAC chain verification for audit records stored in MySQL or MariaDB.

Miembros (2)

  • constructorMySqlAuditIntegrityVerifier
    public MySqlAuditIntegrityVerifier(MySqlAuditStoreOptions options, HmacAuditIntegrityService hmac)

    Initializes a new instance of the `MySqlAuditIntegrityVerifier` class.

    options: MySqlAuditStoreOptions
    The MySQL audit store configuration options.
    hmac: HmacAuditIntegrityService
    The HMAC integrity service used to evaluate record hashes.

    Exceptions: ArgumentNullException: `options` or `hmac` is `null`

  • methodVerifyChainAsync
    public async ValueTask<AuditIntegrityVerificationResult> VerifyChainAsync(string tenantId, DateTimeOffset from, DateTimeOffset until, CancellationToken cancellationToken = default)

    Verifies the cryptographic HMAC chain for audit records within the specified time window.

    tenantId: string
    The tenant identifier whose audit chain is to be verified.
    from: DateTimeOffset
    The inclusive start timestamp of the verification window.
    until: DateTimeOffset
    The inclusive end timestamp of the verification window.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the verification outcome details.

    Exceptions: ArgumentException: `tenantId` is `null` or empty

class

MySqlAuditStore

Ensamblado: EricksonLopez.Auditing.MySql
public sealed class MySqlAuditStore : IAuditStore
Implementa: IAuditStore

Provides a MySQL and MariaDB persistence store for immutable audit records using Dapper.

Miembros (4)

  • constructorMySqlAuditStore
    public MySqlAuditStore(MySqlAuditStoreOptions options, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `MySqlAuditStore` class.

    options: MySqlAuditStoreOptions
    The MySQL audit store configuration options.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `options` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

MySqlAuditStoreOptions

Ensamblado: EricksonLopez.Auditing.MySql
public sealed partial class MySqlAuditStoreOptions

Represents configuration options for `MySqlAuditStore`.

Miembros (2)

  • propertyConnectionFactory
    public Func<IDbConnection> ConnectionFactory { get; set; }

    Gets or sets the factory function that creates open database connections for executing audit commands.

  • propertyTable
    public string Table { get; set; }

    Gets or sets the table name where audit records are stored.

    Exceptions: ArgumentException: `value` is `null`, empty, white space, or not a valid SQL identifier

EricksonLopez.Auditing.OpenTelemetry#

6
class

AuditActivitySource

Ensamblado: EricksonLopez.Auditing.OpenTelemetry
public static class AuditActivitySource

Provides the OpenTelemetry activity source and semantic tag conventions for auditing operations.

Miembros (2)

  • fieldActivitySourceName
    public const string ActivitySourceName

    Gets the canonical activity source name for auditing telemetry.

  • fieldSource
    public static readonly ActivitySource Source

    Gets the `ActivitySource` instance for creating audit telemetry spans.

class

AuditActivitySource.Tags

Ensamblado: EricksonLopez.Auditing.OpenTelemetry
public static class Tags

Defines semantic attribute names following OpenTelemetry conventions for audit spans.

Miembros (14)

  • fieldActionCode
    public const string ActionCode

    Specifies the semantic attribute name for action codes.

  • fieldActorId
    public const string ActorId

    Specifies the semantic attribute name for actor identifiers.

  • fieldActorType
    public const string ActorType

    Specifies the semantic attribute name for actor type classifications.

  • fieldExecutionPlane
    public const string ExecutionPlane

    Specifies the semantic attribute name for security execution planes (`CONTROL`, `TENANT`, `M2M`, `BOOTSTRAP`).

  • fieldImpersonationSessionId
    public const string ImpersonationSessionId

    Specifies the semantic attribute name for bounded impersonation session identifiers.

  • fieldImpersonationTicket
    public const string ImpersonationTicket

    Specifies the semantic attribute name for verified support ticket references during impersonation.

  • fieldImpersonatorId
    public const string ImpersonatorId

    Specifies the semantic attribute name for delegated support or impersonating operator identifiers.

  • fieldOrganizationId
    public const string OrganizationId

    Specifies the semantic attribute name for sub-tenant organization or company identifiers.

  • fieldOutcome
    public const string Outcome

    Specifies the semantic attribute name for audit outcome statuses.

  • fieldRecordId
    public const string RecordId

    Specifies the semantic attribute name for unique audit record identifiers.

  • fieldResourceId
    public const string ResourceId

    Specifies the semantic attribute name for resource identifiers.

  • fieldResourceType
    public const string ResourceType

    Specifies the semantic attribute name for resource types.

  • fieldSecurityClassification
    public const string SecurityClassification

    Specifies the semantic attribute name for security criticality classifications (`Genesis`, `BreakGlass`, etc.).

  • fieldTenantId
    public const string TenantId

    Specifies the semantic attribute name for tenant identifiers.

class

AuditMetrics

Ensamblado: EricksonLopez.Auditing.OpenTelemetry
public static class AuditMetrics

Provides OpenTelemetry metrics instruments for measuring auditing operations.

Miembros (8)

  • fieldAppendDuration
    public static readonly Histogram<double> AppendDuration

    Gets the histogram instrument tracking append duration in milliseconds.

  • fieldIntegrityVerifications
    public static readonly Counter<long> IntegrityVerifications

    Gets the counter instrument tracking cryptographic audit chain integrity verifications.

  • fieldMeterName
    public const string MeterName

    Gets the canonical meter name for auditing metrics.

  • fieldPrivilegedSecurityRecords
    public static readonly Counter<long> PrivilegedSecurityRecords

    Gets the counter instrument tracking privileged, delegated impersonation, `BreakGlass`, and `Genesis` security audit records.

  • fieldQueriesExecuted
    public static readonly Counter<long> QueriesExecuted

    Gets the counter instrument tracking executed audit record queries.

  • fieldQueryDuration
    public static readonly Histogram<double> QueryDuration

    Gets the histogram instrument tracking query duration in milliseconds.

  • fieldRecordsAppended
    public static readonly Counter<long> RecordsAppended

    Gets the counter instrument tracking successfully persisted audit records.

  • fieldRecordsFailed
    public static readonly Counter<long> RecordsFailed

    Gets the counter instrument tracking failed audit record persist operations.

class

AuditingOpenTelemetryExtensions

Ensamblado: EricksonLopez.Auditing.OpenTelemetry
public static class AuditingOpenTelemetryExtensions

Provides extension methods for enriching OpenTelemetry activities with audit metadata.

Miembros (2)

  • methodAddOpenTelemetryInstrumentation
    public static IAuditBuilder AddOpenTelemetryInstrumentation(this IAuditBuilder builder)

    Adds OpenTelemetry metrics and tracing instrumentation decorators for registered audit store and integrity verifier services.

    builder: this IAuditBuilder
    The audit builder being configured.

    Retorna: The audit builder instance for method chaining.

    Exceptions: ArgumentNullException: `builder` is `null`

  • methodEnrichCurrentActivity
    public static void EnrichCurrentActivity(this AuditRecord record)

    Enriches the current ambient `Activity` with semantic tags from the specified audit record.

    record: this AuditRecord
    The audit record containing context to populate onto the active activity.
class

OpenTelemetryAuditIntegrityVerifierDecorator

Ensamblado: EricksonLopez.Auditing.OpenTelemetry
public sealed class OpenTelemetryAuditIntegrityVerifierDecorator : IAuditIntegrityVerifier
Implementa: IAuditIntegrityVerifier

Provides OpenTelemetry metrics and tracing instrumentation for an underlying `IAuditIntegrityVerifier`.

Miembros (2)

  • constructorOpenTelemetryAuditIntegrityVerifierDecorator
    public OpenTelemetryAuditIntegrityVerifierDecorator(IAuditIntegrityVerifier innerVerifier)

    Initializes a new instance of the `OpenTelemetryAuditIntegrityVerifierDecorator` class.

    innerVerifier: IAuditIntegrityVerifier
    The underlying verifier to decorate.

    Exceptions: ArgumentNullException: `innerVerifier` is `null`

  • methodVerifyChainAsync
    public async ValueTask<AuditIntegrityVerificationResult> VerifyChainAsync(string tenantId, DateTimeOffset from, DateTimeOffset until, CancellationToken cancellationToken = default)

    Verifies the cryptographic HMAC chain for audit records within the specified time window.

    tenantId: string
    The tenant identifier whose audit chain is to be verified.
    from: DateTimeOffset
    The inclusive start timestamp of the verification window.
    until: DateTimeOffset
    The inclusive end timestamp of the verification window.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the verification outcome details.

class

OpenTelemetryAuditStoreDecorator

Ensamblado: EricksonLopez.Auditing.OpenTelemetry
public sealed class OpenTelemetryAuditStoreDecorator : IAuditStore
Implementa: IAuditStore

Provides OpenTelemetry distributed tracing spans and metrics instrumentation for an underlying `IAuditStore`.

Miembros (4)

  • constructorOpenTelemetryAuditStoreDecorator
    public OpenTelemetryAuditStoreDecorator(IAuditStore innerStore)

    Initializes a new instance of the `OpenTelemetryAuditStoreDecorator` class.

    innerStore: IAuditStore
    The underlying store to decorate with telemetry.

    Exceptions: ArgumentNullException: `innerStore` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken

EricksonLopez.Auditing.Oracle#

4
class

OracleAuditExtensions

Ensamblado: EricksonLopez.Auditing.Oracle
public static class OracleAuditExtensions

Provides extension methods for registering Oracle Database audit persistence services.

Miembros (1)

  • methodUseOracle
    public static IAuditBuilder UseOracle(this IAuditBuilder builder, Action<OracleAuditStoreOptions> configure)

    Registers `OracleAuditStore` as the audit storage provider in the service collection.

    builder: this IAuditBuilder
    The audit builder instance being configured.
    configure: Action<OracleAuditStoreOptions>
    A delegate to configure Oracle audit store options.

    Retorna: The `IAuditBuilder` instance for fluent chaining.

    Exceptions: ArgumentNullException: `builder` or `configure` is `null` Example:

    services.AddAuditing()
            .UseOracle(options =>
            {
                options.ConnectionFactory = () => new OracleConnection(connectionString);
            });
class

OracleAuditIntegrityVerifier

Ensamblado: EricksonLopez.Auditing.Oracle
public sealed class OracleAuditIntegrityVerifier : IAuditIntegrityVerifier
Implementa: IAuditIntegrityVerifier

Provides cryptographic HMAC chain verification for audit records stored in Oracle Database.

Miembros (2)

  • constructorOracleAuditIntegrityVerifier
    public OracleAuditIntegrityVerifier(OracleAuditStoreOptions options, HmacAuditIntegrityService hmac)

    Initializes a new instance of the `OracleAuditIntegrityVerifier` class.

    options: OracleAuditStoreOptions
    The Oracle audit store configuration options.
    hmac: HmacAuditIntegrityService
    The HMAC integrity service used to evaluate record hashes.

    Exceptions: ArgumentNullException: `options` or `hmac` is `null`

  • methodVerifyChainAsync
    public async ValueTask<AuditIntegrityVerificationResult> VerifyChainAsync(string tenantId, DateTimeOffset from, DateTimeOffset until, CancellationToken cancellationToken = default)

    Verifies the cryptographic HMAC chain for audit records within the specified time window.

    tenantId: string
    The tenant identifier whose audit chain is to be verified.
    from: DateTimeOffset
    The inclusive start timestamp of the verification window.
    until: DateTimeOffset
    The inclusive end timestamp of the verification window.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the verification outcome details.

    Exceptions: ArgumentException: `tenantId` is `null` or empty

class

OracleAuditStore

Ensamblado: EricksonLopez.Auditing.Oracle
public sealed class OracleAuditStore : IAuditStore
Implementa: IAuditStore

Provides an Oracle Database persistence store for immutable audit records using Dapper.

Miembros (4)

  • constructorOracleAuditStore
    public OracleAuditStore(OracleAuditStoreOptions options, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `OracleAuditStore` class.

    options: OracleAuditStoreOptions
    The Oracle audit store configuration options.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `options` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

OracleAuditStoreOptions

Ensamblado: EricksonLopez.Auditing.Oracle
public sealed partial class OracleAuditStoreOptions

Represents configuration options for `OracleAuditStore`.

Miembros (3)

  • propertyConnectionFactory
    public Func<IDbConnection> ConnectionFactory { get; set; }

    Gets or sets the factory function that creates open database connections for executing audit commands.

  • propertySchema
    public string Schema { get; set; }

    Gets or sets the database schema or owner containing the audit table.

    Exceptions: ArgumentException: `value` is not a valid SQL identifier

  • propertyTable
    public string Table { get; set; }

    Gets or sets the table name where audit records are stored.

    Exceptions: ArgumentException: `value` is `null`, empty, white space, or not a valid SQL identifier

EricksonLopez.Auditing.Outbox#

7
interface

IOutboxMessageService

Ensamblado: EricksonLopez.Auditing.Outbox
public interface IOutboxMessageService

Defines a contract for appending messages to a transactional outbox.

Miembros (1)

  • methodAppendMessageAsync
    ValueTask AppendMessageAsync(string eventType, string payload, CancellationToken cancellationToken = default)

    Appends an outbox message to the same transaction as the current unit of work.

    eventType: string
    The type or name of the event represented by the message.
    payload: string
    The serialized message payload content.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation.

interface

IOutboxMessageStore

Ensamblado: EricksonLopez.Auditing.Outbox
public interface IOutboxMessageStore : IOutboxMessageService
Implementa: IOutboxMessageService

Defines a contract for storing, dequeuing, and acknowledging transactional outbox audit messages.

Miembros (3)

  • methodFetchPendingAsync
    ValueTask<IReadOnlyList<OutboxAuditMessage>> FetchPendingAsync(int batchSize, CancellationToken cancellationToken = default)

    Fetches up to `batchSize` pending outbox messages ordered chronologically.

    batchSize: int
    The maximum number of pending messages to fetch.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A read-only list of pending `OutboxAuditMessage` items.

  • methodMarkFailedAsync
    ValueTask MarkFailedAsync(Guid messageId, string errorMessage, CancellationToken cancellationToken = default)

    Records a failed delivery attempt for the specified outbox message.

    messageId: Guid
    The identifier of the failed outbox message.
    errorMessage: string
    The error message describing the failure.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

  • methodMarkProcessedAsync
    ValueTask MarkProcessedAsync(Guid messageId, CancellationToken cancellationToken = default)

    Marks the specified outbox message as successfully dispatched and processed.

    messageId: Guid
    The identifier of the processed outbox message.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

class

InMemoryOutboxMessageStore

Ensamblado: EricksonLopez.Auditing.Outbox
public sealed class InMemoryOutboxMessageStore : IOutboxMessageStore
Implementa: IOutboxMessageStore

Provides a thread-safe in-memory implementation of `IOutboxMessageStore`.

Miembros (6)

  • methodAppendMessageAsync
    public ValueTask AppendMessageAsync(string eventType, string payload, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    eventType: string
    payload: string
    cancellationToken: CancellationToken
  • methodFetchPendingAsync
    public ValueTask<IReadOnlyList<OutboxAuditMessage>> FetchPendingAsync(int batchSize, CancellationToken cancellationToken = default)

    Fetches up to `batchSize` pending outbox messages ordered chronologically.

    batchSize: int
    The maximum number of pending messages to fetch.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A read-only list of pending `OutboxAuditMessage` items.

  • methodMarkFailedAsync
    public ValueTask MarkFailedAsync(Guid messageId, string errorMessage, CancellationToken cancellationToken = default)

    Records a failed delivery attempt for the specified outbox message.

    messageId: Guid
    The identifier of the failed outbox message.
    errorMessage: string
    The error message describing the failure.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

  • methodMarkProcessedAsync
    public ValueTask MarkProcessedAsync(Guid messageId, CancellationToken cancellationToken = default)

    Marks the specified outbox message as successfully dispatched and processed.

    messageId: Guid
    The identifier of the processed outbox message.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

  • propertyPendingCount
    public int PendingCount { get; }

    Gets the count of pending outbox messages awaiting relay.

  • propertyProcessedCount
    public int ProcessedCount { get; }

    Gets the count of successfully processed outbox messages.

class

OutboxAuditExtensions

Ensamblado: EricksonLopez.Auditing.Outbox
public static class OutboxAuditExtensions

Provides extension methods for registering the Outbox audit store with `IAuditBuilder`.

Miembros (1)

  • methodUseOutbox
    public static IAuditBuilder UseOutbox(this IAuditBuilder builder)

    Configures the audit pipeline to use the transactional outbox pattern.

    builder: this IAuditBuilder
    The audit builder being configured.

    Retorna: The `IAuditBuilder` for method chaining.

    Exceptions: ArgumentNullException: `builder` is `null`

record

OutboxAuditMessage

Ensamblado: EricksonLopez.Auditing.Outbox
public sealed record OutboxAuditMessage(Guid Id, string EventType, string Payload, DateTimeOffset CreatedAt, int RetryCount, string? LastError)

Represents a staged transactional outbox audit message awaiting asynchronous relay.

Miembros (7)

  • constructorOutboxAuditMessage
    public OutboxAuditMessage(Guid Id, string EventType, string Payload, DateTimeOffset CreatedAt, int RetryCount = 0, string? LastError = null)

    Initializes a new instance of OutboxAuditMessage.

    Id: Guid
    The unique outbox message identifier.
    EventType: string
    The event type (`AuditRecordCreated` or `AuditRecordBatchCreated`).
    Payload: string
    The serialized JSON payload.
    CreatedAt: DateTimeOffset
    The UTC timestamp when the message was staged.
    RetryCount: int
    The number of failed delivery attempts.
    LastError: string?
    The optional error description from the last failed delivery attempt.
  • propertyCreatedAt
    public DateTimeOffset CreatedAt { get; init; }

    The UTC timestamp when the message was staged.

  • propertyEventType
    public string EventType { get; init; }

    The event type (`AuditRecordCreated` or `AuditRecordBatchCreated`).

  • propertyId
    public Guid Id { get; init; }

    The unique outbox message identifier.

  • propertyLastError
    public string? LastError { get; init; }

    The optional error description from the last failed delivery attempt.

  • propertyPayload
    public string Payload { get; init; }

    The serialized JSON payload.

  • propertyRetryCount
    public int RetryCount { get; init; }

    The number of failed delivery attempts.

class

OutboxAuditStore

Ensamblado: EricksonLopez.Auditing.Outbox
public sealed class OutboxAuditStore : IAuditStore, IAuditChainHeadProvider
Implementa: IAuditChainHeadProvider, IAuditStore

Provides an audit store decorator that writes audit records to a transactional outbox rather than directly to the audit tables, ensuring atomic commits alongside business data while supporting `IAuditChainHeadProvider` for HMAC chain continuity.

Miembros (5)

  • constructorOutboxAuditStore
    public OutboxAuditStore(IOutboxMessageService outbox, IAuditRecordReader? reader = null)

    Initializes a new instance of the `OutboxAuditStore` class.

    outbox: IOutboxMessageService
    The outbox message service.
    reader: IAuditRecordReader?
    The optional read store used to serve `QueryAsync` requests and initial chain head lookups.

    Exceptions: ArgumentNullException: `outbox` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodGetLatestIntegrityHashAsync
    public async ValueTask<string?> GetLatestIntegrityHashAsync(TenantId tenantId, CancellationToken cancellationToken = default)

    Retrieves the `AuditRecord.IntegrityHash` of the most recently appended audit record for `tenantId`, or `null` if no record exists yet.

    tenantId: TenantId
    The tenant identifier whose chain head is requested.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The latest integrity hash string, or `null` for a genesis record.

  • methodQueryAsync
    public ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken

    Exceptions: NotSupportedException: Querying the audit store is not supported through the outbox decorator when no `IAuditRecordReader` is configured

class

OutboxBackgroundProcessor

Ensamblado: EricksonLopez.Auditing.Outbox
public sealed class OutboxBackgroundProcessor : IAsyncDisposable, IDisposable
Implementa: IAsyncDisposable, IDisposable

Background processor that polls an `IOutboxMessageStore`, deserializes staged audit records, and dispatches them to a target `IAuditRecordWriter` / `IAuditStore`.

Miembros (6)

  • constructorOutboxBackgroundProcessor
    public OutboxBackgroundProcessor(IOutboxMessageStore outboxStore, IAuditRecordWriter targetWriter, int batchSize = 100, TimeSpan? pollInterval = null)

    Initializes a new instance of the `OutboxBackgroundProcessor` class.

    outboxStore: IOutboxMessageStore
    The outbox store containing pending audit messages.
    targetWriter: IAuditRecordWriter
    The target audit store writer to receive deserialized audit records.
    batchSize: int
    The maximum number of outbox messages processed per polling cycle.
    pollInterval: TimeSpan?
    The interval between polling cycles when the outbox is idle.
  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodDisposeAsync
    public async ValueTask DisposeAsync()

    Inherits documentation from base type or interface.

  • methodProcessPendingBatchAsync
    public async ValueTask<int> ProcessPendingBatchAsync(CancellationToken cancellationToken = default)

    Processes a single batch of pending outbox messages immediately.

    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The number of outbox messages successfully processed.

  • methodStart
    public void Start()

    Starts the background polling loop.

  • methodStopAsync
    public async ValueTask StopAsync(CancellationToken cancellationToken = default)

    Stops the background polling loop and waits for any in-flight batch to finish.

    cancellationToken: CancellationToken
    A token to cancel waiting for shutdown.

    Retorna: A value task representing the asynchronous shutdown operation.

EricksonLopez.Auditing.PostgreSql#

8
interface

IKmsEnvelopeKeyProtector

Ensamblado: EricksonLopez.Auditing.PostgreSql
public interface IKmsEnvelopeKeyProtector

Wraps and unwraps 256-bit per-subject Data Encryption Keys (DEKs) using a Key Encryption Key (KEK) managed by KMS or local AEAD.

Miembros (2)

  • methodUnwrapKeyAsync
    ValueTask<byte[]> UnwrapKeyAsync(ReadOnlyMemory<byte> wrappedDek, ReadOnlyMemory<byte> associatedData, CancellationToken ct = default)

    Unwraps a wrapped DEK ciphertext bound to `associatedData`.

    wrappedDek: ReadOnlyMemory<byte>
    The wrapped ciphertext envelope bytes.
    associatedData: ReadOnlyMemory<byte>
    Mandatory contextual AAD binding the DEK to its subject identifier.
    ct: CancellationToken
    A cancellation token.

    Retorna: The unwrapped 32-byte DEK.

  • methodWrapKeyAsync
    ValueTask<byte[]> WrapKeyAsync(ReadOnlyMemory<byte> plaintextDek, ReadOnlyMemory<byte> associatedData, CancellationToken ct = default)

    Wraps a plaintext 32-byte DEK bound to `associatedData`.

    plaintextDek: ReadOnlyMemory<byte>
    The 32-byte DEK to wrap.
    associatedData: ReadOnlyMemory<byte>
    Mandatory contextual AAD binding the DEK to its subject identifier.
    ct: CancellationToken
    A cancellation token.

    Retorna: The wrapped ciphertext envelope bytes.

class

LocalAesGcmEnvelopeKeyProtector

Ensamblado: EricksonLopez.Auditing.PostgreSql
public sealed class LocalAesGcmEnvelopeKeyProtector : IKmsEnvelopeKeyProtector, IDisposable
Implementa: IDisposable, IKmsEnvelopeKeyProtector

Local AES-256-GCM implementation of `IKmsEnvelopeKeyProtector` enforcing mandatory contextual AAD and deterministic key scrubbing.

Miembros (4)

  • constructorLocalAesGcmEnvelopeKeyProtector
    public LocalAesGcmEnvelopeKeyProtector(ReadOnlySpan<byte> keyEncryptionKey)

    Initializes a new instance of the `LocalAesGcmEnvelopeKeyProtector` class.

    keyEncryptionKey: ReadOnlySpan<byte>
    A 32-byte (256-bit) Key Encryption Key.
  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodUnwrapKeyAsync
    public ValueTask<byte[]> UnwrapKeyAsync(ReadOnlyMemory<byte> wrappedDek, ReadOnlyMemory<byte> associatedData, CancellationToken ct = default)

    Unwraps a wrapped DEK ciphertext bound to `associatedData`.

    wrappedDek: ReadOnlyMemory<byte>
    The wrapped ciphertext envelope bytes.
    associatedData: ReadOnlyMemory<byte>
    Mandatory contextual AAD binding the DEK to its subject identifier.
    ct: CancellationToken
    A cancellation token.

    Retorna: The unwrapped 32-byte DEK.

  • methodWrapKeyAsync
    public ValueTask<byte[]> WrapKeyAsync(ReadOnlyMemory<byte> plaintextDek, ReadOnlyMemory<byte> associatedData, CancellationToken ct = default)

    Wraps a plaintext 32-byte DEK bound to `associatedData`.

    plaintextDek: ReadOnlyMemory<byte>
    The 32-byte DEK to wrap.
    associatedData: ReadOnlyMemory<byte>
    Mandatory contextual AAD binding the DEK to its subject identifier.
    ct: CancellationToken
    A cancellation token.

    Retorna: The wrapped ciphertext envelope bytes.

class

PostgreSqlAuditExtensions

Ensamblado: EricksonLopez.Auditing.PostgreSql
public static class PostgreSqlAuditExtensions

Provides extension methods for registering PostgreSQL audit persistence services.

Miembros (1)

  • methodUsePostgreSql
    public static IAuditBuilder UsePostgreSql(this IAuditBuilder builder, Action<PostgreSqlAuditStoreOptions> configure)

    Registers `PostgreSqlAuditStore` as the audit storage provider in the service collection.

    builder: this IAuditBuilder
    The audit builder instance being configured.
    configure: Action<PostgreSqlAuditStoreOptions>
    A delegate to configure PostgreSQL audit store options.

    Retorna: The `IAuditBuilder` instance for fluent chaining.

    Exceptions: ArgumentNullException: `builder` or `configure` is `null` Example:

    services.AddAuditing()
            .UsePostgreSql(options =>
            {
                options.ConnectionFactory = () => new NpgsqlConnection(connectionString);
            });
class

PostgreSqlAuditIntegrityVerifier

Ensamblado: EricksonLopez.Auditing.PostgreSql
public sealed class PostgreSqlAuditIntegrityVerifier : IAuditIntegrityVerifier
Implementa: IAuditIntegrityVerifier

Provides cryptographic HMAC chain verification for audit records stored in PostgreSQL.

Miembros (2)

  • constructorPostgreSqlAuditIntegrityVerifier
    public PostgreSqlAuditIntegrityVerifier(PostgreSqlAuditStoreOptions options, HmacAuditIntegrityService hmac)

    Initializes a new instance of the `PostgreSqlAuditIntegrityVerifier` class.

    options: PostgreSqlAuditStoreOptions
    The PostgreSQL audit store configuration options.
    hmac: HmacAuditIntegrityService
    The HMAC integrity service used to evaluate record hashes.

    Exceptions: ArgumentNullException: `options` or `hmac` is `null`

  • methodVerifyChainAsync
    public async ValueTask<AuditIntegrityVerificationResult> VerifyChainAsync(string tenantId, DateTimeOffset from, DateTimeOffset until, CancellationToken cancellationToken = default)

    Verifies the cryptographic HMAC chain for audit records within the specified time window.

    tenantId: string
    The tenant identifier whose audit chain is to be verified.
    from: DateTimeOffset
    The inclusive start timestamp of the verification window.
    until: DateTimeOffset
    The inclusive end timestamp of the verification window.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the verification outcome details.

    Exceptions: ArgumentException: `tenantId` is `null` or empty

class

PostgreSqlAuditStore

Ensamblado: EricksonLopez.Auditing.PostgreSql
public sealed class PostgreSqlAuditStore : ITransactionalAuditStore
Implementa: ITransactionalAuditStore

Provides a PostgreSQL persistence store for immutable audit records using Dapper, transaction-scoped RLS isolation, and Unit of Work enlistment.

Miembros (6)

  • constructorPostgreSqlAuditStore
    public PostgreSqlAuditStore(PostgreSqlAuditStoreOptions options, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `PostgreSqlAuditStore` class.

    options: PostgreSqlAuditStoreOptions
    The PostgreSQL audit store configuration options.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `options` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, IDbConnection connection, IDbTransaction? transaction = null, CancellationToken cancellationToken = default)

    Appends a single immutable audit record using the caller-owned database connection and optional active transaction.

    record: AuditRecord
    The immutable audit record to persist.
    connection: IDbConnection
    The caller-managed database connection.
    transaction: IDbTransaction?
    The optional active database transaction to enlist into.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous operation.

  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, IDbConnection connection, IDbTransaction? transaction = null, CancellationToken cancellationToken = default)

    Appends an ordered batch of immutable audit records using the caller-owned database connection and optional active transaction.

    records: IReadOnlyList<AuditRecord>
    The ordered collection of audit records to persist.
    connection: IDbConnection
    The caller-managed database connection.
    transaction: IDbTransaction?
    The optional active database transaction to enlist into.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous operation.

  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

PostgreSqlAuditStoreOptions

Ensamblado: EricksonLopez.Auditing.PostgreSql
public sealed partial class PostgreSqlAuditStoreOptions

Represents configuration options for `PostgreSqlAuditStore`.

Miembros (4)

  • propertyConnectionFactory
    public Func<IDbConnection> ConnectionFactory { get; set; }

    Gets or sets the factory function that creates open database connections for executing audit commands.

  • propertyIncludeExtendedSecurityColumns
    public bool IncludeExtendedSecurityColumns { get; set; }

    Gets or sets a value indicating whether extended multi-plane (`execution_plane`), organization (`organization_id`), security classification (`security_classification`), delegated impersonation, and `metadata` JSONB columns and session GUCs are persisted and queried. Defaults to `false` for backward compatibility with baseline tables.

  • propertySchema
    public string Schema { get; set; }

    Gets or sets the PostgreSQL schema containing the audit table.

    Exceptions: ArgumentException: `value` is `null`, empty, white space, or not a valid SQL identifier

  • propertyTable
    public string Table { get; set; }

    Gets or sets the table name where audit records are stored.

    Exceptions: ArgumentException: `value` is `null`, empty, white space, or not a valid SQL identifier

class

PostgreSqlKmsAuditKeyOptions

Ensamblado: EricksonLopez.Auditing.PostgreSql
public sealed partial class PostgreSqlKmsAuditKeyOptions

Configures PostgreSQL KMS-wrapped subject DEK persistence and HMAC integrity derivation for `PostgreSqlKmsAuditKeyProvider`.

Miembros (6)

  • propertyApplyControlPlaneRlsGucs
    public bool ApplyControlPlaneRlsGucs { get; set; }

    Gets or sets a value indicating whether `app.current_plane = 'CONTROL'` transaction-scoped GUCs are applied before reading/writing the key table. Defaults to `true`.

  • propertyConnectionString
    public string? ConnectionString { get; set; }

    Gets or sets the optional PostgreSQL connection string. When null or empty, keys are wrapped via `IKmsEnvelopeKeyProtector` in-process.

  • propertyIntegrityMasterKey
    public byte[] IntegrityMasterKey { get; set; }

    Gets or sets the 32-byte master secret used to derive per-tenant HMAC-SHA256 audit chain integrity keys via HKDF.

  • propertyKmsKeyUri
    public string KmsKeyUri { get; set; }

    Gets or sets the logical KMS KEK identifier URI recorded alongside wrapped DEKs.

  • propertySchema
    public string Schema { get; set; }

    Gets or sets the PostgreSQL schema hosting the encryption keys table. Defaults to `"audit"`.

  • propertyTable
    public string Table { get; set; }

    Gets or sets the PostgreSQL table hosting per-subject wrapped DEKs. Defaults to `"subject_encryption_keys"`.

class

PostgreSqlKmsAuditKeyProvider

Ensamblado: EricksonLopez.Auditing.PostgreSql
public sealed class PostgreSqlKmsAuditKeyProvider : IAuditCryptoKeyProvider, IAuditIntegrityProvider, IDisposable
Implementa: IAuditCryptoKeyProvider, IAuditIntegrityProvider, IDisposable

Durable PostgreSQL + KMS-envelope per-subject AES-256 Data Encryption Key (DEK) provider supporting concurrency-safe `ON CONFLICT DO NOTHING` provisioning, HKDF tenant integrity keys, and GDPR / Law 172-13 irreversible crypto-shredding.

Miembros (7)

  • constructorPostgreSqlKmsAuditKeyProvider
    public PostgreSqlKmsAuditKeyProvider(PostgreSqlKmsAuditKeyOptions options, IKmsEnvelopeKeyProtector envelopeProtector, TimeProvider? timeProvider = null)

    Initializes a new instance of the `PostgreSqlKmsAuditKeyProvider` class.

    options: PostgreSqlKmsAuditKeyOptions
    Key store configuration options.
    envelopeProtector: IKmsEnvelopeKeyProtector
    The KMS or local AES-GCM envelope KEK protector.
    timeProvider: TimeProvider?
    Optional time provider.
  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodGenerateEncryptionKeysDdl
    public static string GenerateEncryptionKeysDdl(string schema = "", string table = "")

    Generates idempotent PostgreSQL DDL for the KMS-wrapped subject encryption keys table.

    schema: string
    Target PostgreSQL schema name.
    table: string
    Target PostgreSQL table name.

    Retorna: Parameterized-safe DDL script creating the subject encryption keys table.

  • methodGetCurrentKey
    public ReadOnlyMemory<byte> GetCurrentKey(TenantId tenantId)

    Retrieves the current cryptographic key bytes for the specified tenant.

    tenantId: TenantId
    The tenant identifier for which to retrieve the key.

    Retorna: A read-only memory segment containing the cryptographic key bytes.

  • methodGetEncryptionKeyAsync
    public async ValueTask<byte[]> GetEncryptionKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Retrieves or generates the encryption key associated with a specific subject (e.g., tenant or actor).

    subjectId: string
    The identifier of the subject whose data requires encryption.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation. The task result contains a 32-byte cryptographic key for AES-GCM encryption.

  • methodShredKeyAsync
    public ValueTask ShredKeyAsync(string subjectId, CancellationToken cancellationToken = default)

    Permanently deletes the encryption key associated with a specific subject, rendering all their encrypted PII permanently inaccessible.

    subjectId: string
    The identifier of the subject whose key should be destroyed.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: A task representing the asynchronous operation.

  • methodShredSubjectKeyAsync
    public async ValueTask ShredSubjectKeyAsync(string subjectId, Guid? shreddedByUserId = null, string? reason = null, CancellationToken ct = default)

    Irreversibly destroys the subject's DEK in memory (`ZeroMemory`) and marks it shredded (`wrapped_dek = NULL, is_shredded = TRUE`) in PostgreSQL.

    subjectId: string
    The subject identifier whose PII key must be destroyed.
    shreddedByUserId: Guid?
    Optional actor user ID executing the erasure.
    reason: string?
    Audit reason recorded on the tombstone.
    ct: CancellationToken
    A cancellation token.

    Retorna: A value task representing the asynchronous operation.

EricksonLopez.Auditing.Serilog#

1
class

SensitiveDataDestructuringPolicy

Ensamblado: EricksonLopez.Auditing.Serilog
public sealed class SensitiveDataDestructuringPolicy : IDestructuringPolicy
Implementa: IDestructuringPolicy

Serilog `IDestructuringPolicy` that automatically redacts properties marked with `AuditSensitiveAttribute`, `[SensitiveData]`, `[NotLogged]`, `[NotAudited]`, or `[Pii]`, as well as canonical credential field names.

Miembros (2)

  • constructorSensitiveDataDestructuringPolicy
    public SensitiveDataDestructuringPolicy(AuditConfiguration? configuration = null)

    Initializes a new instance of the `SensitiveDataDestructuringPolicy` class.

    configuration: AuditConfiguration?
    Optional audit sensitivity configuration.
  • methodTryDestructure
    public bool TryDestructure(object value, ILogEventPropertyValueFactory propertyValueFactory, out LogEventPropertyValue? result)

    Inherits documentation from base type or interface.

    value: object
    propertyValueFactory: ILogEventPropertyValueFactory
    result: out LogEventPropertyValue?

EricksonLopez.Auditing.SqlServer#

4
class

SqlServerAuditExtensions

Ensamblado: EricksonLopez.Auditing.SqlServer
public static class SqlServerAuditExtensions

Provides extension methods for registering Microsoft SQL Server audit persistence services.

Miembros (1)

  • methodUseSqlServer
    public static IAuditBuilder UseSqlServer(this IAuditBuilder builder, Action<SqlServerAuditStoreOptions> configure)

    Registers `SqlServerAuditStore` as the audit storage provider in the service collection.

    builder: this IAuditBuilder
    The audit builder instance being configured.
    configure: Action<SqlServerAuditStoreOptions>
    A delegate to configure SQL Server audit store options.

    Retorna: The `IAuditBuilder` instance for fluent chaining.

    Exceptions: ArgumentNullException: `builder` or `configure` is `null` Example:

    services.AddAuditing()
            .UseSqlServer(options =>
            {
                options.ConnectionFactory = () => new SqlConnection(connectionString);
            });
class

SqlServerAuditIntegrityVerifier

Ensamblado: EricksonLopez.Auditing.SqlServer
public sealed class SqlServerAuditIntegrityVerifier : IAuditIntegrityVerifier
Implementa: IAuditIntegrityVerifier

Provides cryptographic HMAC chain verification for audit records stored in SQL Server.

Miembros (2)

  • constructorSqlServerAuditIntegrityVerifier
    public SqlServerAuditIntegrityVerifier(SqlServerAuditStoreOptions options, HmacAuditIntegrityService hmac)

    Initializes a new instance of the `SqlServerAuditIntegrityVerifier` class.

    options: SqlServerAuditStoreOptions
    The SQL Server audit store configuration options.
    hmac: HmacAuditIntegrityService
    The HMAC integrity service used to evaluate record hashes.

    Exceptions: ArgumentNullException: `options` or `hmac` is `null`

  • methodVerifyChainAsync
    public async ValueTask<AuditIntegrityVerificationResult> VerifyChainAsync(string tenantId, DateTimeOffset from, DateTimeOffset until, CancellationToken cancellationToken = default)

    Verifies the cryptographic HMAC chain for audit records within the specified time window.

    tenantId: string
    The tenant identifier whose audit chain is to be verified.
    from: DateTimeOffset
    The inclusive start timestamp of the verification window.
    until: DateTimeOffset
    The inclusive end timestamp of the verification window.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the verification outcome details.

    Exceptions: ArgumentException: `tenantId` is `null` or empty

class

SqlServerAuditStore

Ensamblado: EricksonLopez.Auditing.SqlServer
public sealed class SqlServerAuditStore : IAuditStore
Implementa: IAuditStore

Provides a Microsoft SQL Server persistence store for immutable audit records using Dapper.

Miembros (4)

  • constructorSqlServerAuditStore
    public SqlServerAuditStore(SqlServerAuditStoreOptions options, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `SqlServerAuditStore` class.

    options: SqlServerAuditStoreOptions
    The SQL Server audit store configuration options.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `options` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

SqlServerAuditStoreOptions

Ensamblado: EricksonLopez.Auditing.SqlServer
public sealed partial class SqlServerAuditStoreOptions

Represents configuration options for `SqlServerAuditStore`.

Miembros (3)

  • propertyConnectionFactory
    public Func<IDbConnection> ConnectionFactory { get; set; }

    Gets or sets the factory function that creates open database connections for executing audit commands.

  • propertySchema
    public string Schema { get; set; }

    Gets or sets the database schema containing the audit table.

    Exceptions: ArgumentException: `value` is `null`, empty, white space, or not a valid SQL identifier

  • propertyTable
    public string Table { get; set; }

    Gets or sets the table name where audit records are stored.

    Exceptions: ArgumentException: `value` is `null`, empty, white space, or not a valid SQL identifier

EricksonLopez.Auditing.Sqlite#

4
class

SqliteAuditExtensions

Ensamblado: EricksonLopez.Auditing.Sqlite
public static class SqliteAuditExtensions

Provides extension methods for registering SQLite audit persistence services.

Miembros (1)

  • methodUseSqlite
    public static IAuditBuilder UseSqlite(this IAuditBuilder builder, Action<SqliteAuditStoreOptions> configure)

    Registers `SqliteAuditStore` as the audit storage provider in the service collection.

    builder: this IAuditBuilder
    The audit builder instance being configured.
    configure: Action<SqliteAuditStoreOptions>
    A delegate to configure SQLite audit store options.

    Retorna: The `IAuditBuilder` instance for fluent chaining.

    Exceptions: ArgumentNullException: `builder` or `configure` is `null` Example:

    services.AddAuditing()
            .UseSqlite(options =>
            {
                options.ConnectionFactory = () => new SqliteConnection("Data Source=audit.db");
            });
class

SqliteAuditIntegrityVerifier

Ensamblado: EricksonLopez.Auditing.Sqlite
public sealed class SqliteAuditIntegrityVerifier : IAuditIntegrityVerifier
Implementa: IAuditIntegrityVerifier

Provides cryptographic HMAC chain verification for audit records stored in SQLite.

Miembros (2)

  • constructorSqliteAuditIntegrityVerifier
    public SqliteAuditIntegrityVerifier(SqliteAuditStoreOptions options, HmacAuditIntegrityService hmac)

    Initializes a new instance of the `SqliteAuditIntegrityVerifier` class.

    options: SqliteAuditStoreOptions
    The SQLite audit store configuration options.
    hmac: HmacAuditIntegrityService
    The HMAC integrity service used to evaluate record hashes.

    Exceptions: ArgumentNullException: `options` or `hmac` is `null`

  • methodVerifyChainAsync
    public async ValueTask<AuditIntegrityVerificationResult> VerifyChainAsync(string tenantId, DateTimeOffset from, DateTimeOffset until, CancellationToken cancellationToken = default)

    Verifies the cryptographic HMAC chain for audit records within the specified time window.

    tenantId: string
    The tenant identifier whose audit chain is to be verified.
    from: DateTimeOffset
    The inclusive start timestamp of the verification window.
    until: DateTimeOffset
    The inclusive end timestamp of the verification window.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A task representing the asynchronous operation. The task result contains the verification outcome details.

    Exceptions: ArgumentException: `tenantId` is `null` or empty

class

SqliteAuditStore

Ensamblado: EricksonLopez.Auditing.Sqlite
public sealed class SqliteAuditStore : IAuditStore
Implementa: IAuditStore

Provides a SQLite persistence store for immutable audit records using Dapper.

Miembros (4)

  • constructorSqliteAuditStore
    public SqliteAuditStore(SqliteAuditStoreOptions options, IAuditSensitivityPipeline? sensitivityPipeline = null)

    Initializes a new instance of the `SqliteAuditStore` class.

    options: SqliteAuditStoreOptions
    The SQLite audit store configuration options.
    sensitivityPipeline: IAuditSensitivityPipeline?
    The optional sensitivity pipeline to sanitize records before persistence.

    Exceptions: ArgumentNullException: `options` is `null`

  • methodAppendAsync
    public async ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public async ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodQueryAsync
    public async ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
class

SqliteAuditStoreOptions

Ensamblado: EricksonLopez.Auditing.Sqlite
public sealed partial class SqliteAuditStoreOptions

Represents configuration options for `SqliteAuditStore`.

Miembros (2)

  • propertyConnectionFactory
    public Func<IDbConnection> ConnectionFactory { get; set; }

    Gets or sets the factory function that creates open database connections for executing audit commands.

  • propertyTable
    public string Table { get; set; }

    Gets or sets the table name where audit records are stored.

    Exceptions: ArgumentException: `value` is `null`, empty, white space, or not a valid SQL identifier

EricksonLopez.Auditing.Testing#

4
class

AuditRecordBuilder

Ensamblado: EricksonLopez.Auditing.Testing
public sealed class AuditRecordBuilder

Provides a fluent builder for constructing `AuditRecord` test instances with customizable defaults.

Miembros (30)

  • methodAddChange
    public AuditRecordBuilder AddChange(string field, string? oldValue, string? newValue, bool isRedacted = false)

    Adds a single field-level change to the record.

    field: string
    The modified field name.
    oldValue: string?
    The value before the change.
    newValue: string?
    The value after the change.
    isRedacted: bool
    A value indicating whether the field value was redacted.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodAddRedactedChange
    public AuditRecordBuilder AddRedactedChange(string field)

    Adds a redacted field change to the record.

    field: string
    The redacted field name.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodBuild
    public AuditRecord Build()

    Creates the immutable `AuditRecord` instance configured by this builder.

    Retorna: A new immutable `AuditRecord` instance.

  • methodBuildDefault
    public static AuditRecord BuildDefault(string tenantId = "", string actorId = "", string resourceType = "", string resourceId = "", AuditOutcome outcome = AuditOutcome.Success, string? correlationId = null)

    Creates a pre-configured `AuditRecord` instance with optional field overrides.

    tenantId: string
    The tenant identifier.
    actorId: string
    The actor identifier.
    resourceType: string
    The resource type.
    resourceId: string
    The resource identifier.
    outcome: AuditOutcome
    The outcome status.
    correlationId: string?
    The optional correlation identifier.

    Retorna: A new `AuditRecord` instance with the specified values.

  • methodCreate
    public static AuditRecordBuilder Create()

    Creates a new instance of the `AuditRecordBuilder` class with default values.

    Retorna: A new `AuditRecordBuilder` instance.

  • methodWithAction
    public AuditRecordBuilder WithAction(AuditAction action)

    Sets the operation executed on the resource.

    action: AuditAction
    The action to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithAction
    public AuditRecordBuilder WithAction(string actionCode)

    Sets the operation executed on the resource by code.

    actionCode: string
    The action code string to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithActor
    public AuditRecordBuilder WithActor(AuditActor actor)

    Sets the actor performing the action.

    actor: AuditActor
    The actor to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

    Exceptions: ArgumentNullException: `actor` is `null`

  • methodWithActor
    public AuditRecordBuilder WithActor(AuditActorType type, string id, string? displayName = null)

    Sets the actor performing the action using individual properties.

    type: AuditActorType
    The actor type classification.
    id: string
    The actor identifier.
    displayName: string?
    The optional actor display name.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithCausationId
    public AuditRecordBuilder WithCausationId(string? causationId)

    Sets the optional causation identifier.

    causationId: string?
    The causation identifier to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithChanges
    public AuditRecordBuilder WithChanges(IReadOnlyList<AuditChange>? changes)

    Sets the complete collection of field-level changes.

    changes: IReadOnlyList<AuditChange>?
    The collection of changes to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithCorrelationId
    public AuditRecordBuilder WithCorrelationId(string? correlationId)

    Sets the optional correlation identifier.

    correlationId: string?
    The correlation identifier to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithErrorCode
    public AuditRecordBuilder WithErrorCode(string? errorCode)

    Sets the optional error code for unsuccessful outcomes.

    errorCode: string?
    The error code to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithExecutionPlane
    public AuditRecordBuilder WithExecutionPlane(AuditExecutionPlane executionPlane)

    Sets the security execution plane for the test record.

    executionPlane: AuditExecutionPlane
    The security execution plane.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithId
    public AuditRecordBuilder WithId(Guid id)

    Sets the unique record identifier.

    id: Guid
    The unique identifier to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithImpersonation
    public AuditRecordBuilder WithImpersonation(AuditImpersonation? impersonation)

    Sets the delegated impersonation metadata for the test record.

    impersonation: AuditImpersonation?
    The impersonation metadata.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithIntegrityHash
    public AuditRecordBuilder WithIntegrityHash(string? hash)

    Sets the HMAC cryptographic integrity hash.

    hash: string?
    The integrity hash to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithIpAddress
    public AuditRecordBuilder WithIpAddress(string? ipAddress)

    Sets the optional client network IP address.

    ipAddress: string?
    The IP address to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithMetadata
    public AuditRecordBuilder WithMetadata(string key, string value)

    Adds or updates a context metadata entry on the test record.

    key: string
    The metadata key.
    value: string
    The metadata value.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithOccurredAt
    public AuditRecordBuilder WithOccurredAt(DateTimeOffset occurredAt)

    Sets the timestamp when the action occurred.

    occurredAt: DateTimeOffset
    The timestamp to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithOrganizationId
    public AuditRecordBuilder WithOrganizationId(string? organizationId)

    Sets the sub-tenant organization or company identifier for the test record.

    organizationId: string?
    The organization identifier.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithOutcome
    public AuditRecordBuilder WithOutcome(AuditOutcome outcome)

    Sets the outcome status of the audited action.

    outcome: AuditOutcome
    The outcome status to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithPreviousHash
    public AuditRecordBuilder WithPreviousHash(string? previousHash)

    Sets the cryptographic hash of the preceding record in the chain.

    previousHash: string?
    The previous record hash to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithRequestId
    public AuditRecordBuilder WithRequestId(string? requestId)

    Sets the optional request identifier.

    requestId: string?
    The request identifier to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithResource
    public AuditRecordBuilder WithResource(AuditResource resource)

    Sets the target resource of the operation.

    resource: AuditResource
    The target resource to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

    Exceptions: ArgumentNullException: `resource` is `null`

  • methodWithResource
    public AuditRecordBuilder WithResource(string type, string id, string? aggregateType = null, string? aggregateId = null)

    Sets the target resource of the operation using individual properties.

    type: string
    The logical resource type.
    id: string
    The resource identifier.
    aggregateType: string?
    The optional aggregate root type.
    aggregateId: string?
    The optional aggregate root identifier.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithSecurityClassification
    public AuditRecordBuilder WithSecurityClassification(AuditSecurityClassification classification)

    Sets the security classification for the test record.

    classification: AuditSecurityClassification
    The security classification.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

  • methodWithSource
    public AuditRecordBuilder WithSource(string source)

    Sets the originating application or service component.

    source: string
    The source component name to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

    Exceptions: ArgumentNullException: `source` is `null`

  • methodWithTenant
    public AuditRecordBuilder WithTenant(string tenantId)

    Sets the tenant identifier scoping the record.

    tenantId: string
    The tenant identifier to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

    Exceptions: ArgumentNullException: `tenantId` is `null`

  • methodWithUserAgent
    public AuditRecordBuilder WithUserAgent(string? userAgent)

    Sets the optional client user agent string.

    userAgent: string?
    The user agent string to set.

    Retorna: The current `AuditRecordBuilder` instance for method chaining.

class

InMemoryAuditSecurityAlertSink

Ensamblado: EricksonLopez.Auditing.Testing
public sealed class InMemoryAuditSecurityAlertSink : IAuditSecurityAlertSink
Implementa: IAuditSecurityAlertSink

Provides a thread-safe in-memory test double for `IAuditSecurityAlertSink` to verify `GENESIS`, `BreakGlass`, `BOOTSTRAP` plane, and delegated support impersonation alerts in automated test suites.

Miembros (6)

  • methodClear
    public void Clear()

    Clears all captured alerts from this sink.

  • methodEmitAlertAsync
    public ValueTask EmitAlertAsync(AuditSecurityAlert alert, CancellationToken cancellationToken = default)

    Emits a structured security alert asynchronously.

    alert: AuditSecurityAlert
    The immutable security alert payload.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Retorna: A value task representing the asynchronous alert dispatch operation.

  • methodForCode
    public IReadOnlyList<AuditSecurityAlert> ForCode(string alertCode)

    Retrieves all emitted alerts matching the specified alert code.

    alertCode: string
    The alert code to filter by.

    Retorna: A read-only list of matching alerts in emission order.

  • methodForSeverity
    public IReadOnlyList<AuditSecurityAlert> ForSeverity(AuditSecuritySeverity severity)

    Retrieves all emitted alerts matching the specified severity level.

    severity: AuditSecuritySeverity
    The alert severity to filter by.

    Retorna: A read-only list of matching alerts in emission order.

  • propertyAlerts
    public IReadOnlyList<AuditSecurityAlert> Alerts { get; }

    Gets a snapshot of all emitted security alerts in emission order.

  • propertyCount
    public int Count { get; }

    Gets the total count of emitted security alerts.

class

InMemoryAuditStore

Ensamblado: EricksonLopez.Auditing.Testing
public sealed class InMemoryAuditStore : IAuditStore, IAuditChainHeadProvider
Implementa: IAuditChainHeadProvider, IAuditStore

Provides an in-memory, thread-safe persistence store for testing audit operations.

Notas:

This store is intended for test environments only and does not persist data across process restarts.

Miembros (11)

  • methodAppendAsync
    public ValueTask AppendAsync(AuditRecord record, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    record: AuditRecord
    cancellationToken: CancellationToken
  • methodAppendBatchAsync
    public ValueTask AppendBatchAsync(IReadOnlyList<AuditRecord> records, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    records: IReadOnlyList<AuditRecord>
    cancellationToken: CancellationToken
  • methodClear
    public void Clear()

    Removes all persisted audit records from the store.

  • methodForActor
    public IReadOnlyList<AuditRecord> ForActor(string actorId)

    Retrieves all persisted audit records associated with the specified actor.

    actorId: string
    The actor identifier to filter by.

    Retorna: A read-only list of matching audit records in insertion order.

  • methodForImpersonator
    public IReadOnlyList<AuditRecord> ForImpersonator(string impersonatorId)

    Retrieves all persisted audit records executed under delegated impersonation by the specified operator.

    impersonatorId: string
    The impersonating operator identifier to filter by.

    Retorna: A read-only list of matching audit records in insertion order.

  • methodForPlane
    public IReadOnlyList<AuditRecord> ForPlane(AuditExecutionPlane plane)

    Retrieves all persisted audit records executed within the specified security execution plane.

    plane: AuditExecutionPlane
    The security execution plane to filter by.

    Retorna: A read-only list of matching audit records in insertion order.

  • methodForTenant
    public IReadOnlyList<AuditRecord> ForTenant(string tenantId)

    Retrieves all persisted audit records belonging to the specified tenant.

    tenantId: string
    The tenant identifier to filter by.

    Retorna: A read-only list of matching audit records in insertion order.

  • methodGetLatestIntegrityHashAsync
    public ValueTask<string?> GetLatestIntegrityHashAsync(TenantId tenantId, CancellationToken cancellationToken = default)

    Retrieves the `AuditRecord.IntegrityHash` of the most recently appended audit record for `tenantId`, or `null` if no record exists yet.

    tenantId: TenantId
    The tenant identifier whose chain head is requested.
    cancellationToken: CancellationToken
    A token to monitor for cancellation requests.

    Retorna: The latest integrity hash string, or `null` for a genesis record.

  • methodQueryAsync
    public ValueTask<AuditQueryResult> QueryAsync(AuditQuery query, CancellationToken cancellationToken = default)

    Inherits documentation from base type or interface.

    query: AuditQuery
    cancellationToken: CancellationToken
  • propertyCount
    public int Count { get; }

    Gets the total count of persisted audit records.

  • propertyRecords
    public IReadOnlyList<AuditRecord> Records { get; }

    Gets a snapshot of all audit records persisted in this store, in insertion order.

class

TestAuditIntegrityProvider

Ensamblado: EricksonLopez.Auditing.Testing
public sealed class TestAuditIntegrityProvider : IAuditIntegrityProvider
Implementa: IAuditIntegrityProvider

Provides an in-memory, configurable cryptographic key provider for testing HMAC integrity verification.

Miembros (5)

  • constructorTestAuditIntegrityProvider
    public TestAuditIntegrityProvider()

    Initializes a new instance of the `TestAuditIntegrityProvider` class with the default key.

  • constructorTestAuditIntegrityProvider
    public TestAuditIntegrityProvider(byte[] defaultKey)

    Initializes a new instance of the `TestAuditIntegrityProvider` class with a custom default key.

    defaultKey: byte[]
    The default key byte array.

    Exceptions: ArgumentNullException: `defaultKey` is `null`

  • methodGetCurrentKey
    public ReadOnlyMemory<byte> GetCurrentKey(TenantId tenantId)

    Retrieves the current cryptographic key bytes for the specified tenant.

    tenantId: TenantId
    The tenant identifier for which to retrieve the key.

    Retorna: A read-only memory segment containing the cryptographic key bytes.

  • methodSetTenantKey
    public TestAuditIntegrityProvider SetTenantKey(string tenantId, byte[] key)

    Configures a specific cryptographic key for the specified tenant.

    tenantId: string
    The tenant identifier to configure.
    key: byte[]
    The cryptographic key byte array.

    Retorna: The current `TestAuditIntegrityProvider` instance for method chaining.

    Exceptions: ArgumentException: `tenantId` is `null` or empty; ArgumentNullException: `key` is `null`

  • fieldDefaultKey
    public static readonly byte[] DefaultKey

    Gets the default 256-bit symmetric test key bytes.

EricksonLopez.Auditing.Threading#

1
class

KeyedSemaphoreSlim

Ensamblado: EricksonLopez.Auditing
public sealed class KeyedSemaphoreSlim : IDisposable
Implementa: IDisposable

Provides keyed mutual exclusion locks based on `SemaphoreSlim`, ensuring that operations for the same key are serialized while operations with different keys execute concurrently.

Miembros (3)

  • methodDispose
    public void Dispose()

    Inherits documentation from base type or interface.

  • methodLockAsync
    public async ValueTask<IDisposable> LockAsync(string key, CancellationToken cancellationToken = default)

    Asynchronously acquires a lock for the specified key. The returned disposable must be disposed to release the lock.

    key: string
    The key identifying the critical section boundary (e.g. TenantId).
    cancellationToken: CancellationToken
    A token to observe for cancellation while waiting for the lock.

    Retorna: An `IDisposable` handle that releases the keyed semaphore when disposed.

    Exceptions: ArgumentNullException: `key` is `null`

  • propertyActiveLockCount
    public int ActiveLockCount { get; }

    Gets the number of active keyed locks currently held or waiting.

Buscar en el Ecosistema EricksonLopez.*

Escribe el nombre de una librería, ID de paquete NuGet, tipo .NET o concepto arquitectónico para buscar en el portal.