| | | 1 | | using AsiBackbone.Core.Actors; |
| | | 2 | | using AsiBackbone.Core.Serialization; |
| | | 3 | | |
| | | 4 | | namespace AsiBackbone.Core.Audit; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Defines the framework-neutral audit residue produced by an AsiBackbone operation. |
| | | 8 | | /// </summary> |
| | | 9 | | public interface IAsiBackboneAuditResidue |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Gets the stable audit event identifier. |
| | | 13 | | /// </summary> |
| | | 14 | | string EventId { get; } |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Gets the stable audit residue identifier when available. |
| | | 18 | | /// </summary> |
| | | 19 | | /// <remarks> |
| | | 20 | | /// Existing residue implementations may use <see cref="EventId" /> as the residue identifier. |
| | | 21 | | /// </remarks> |
| | 23 | 22 | | string? AuditResidueId => EventId; |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Gets the serialized schema version for the audit residue shape. |
| | | 26 | | /// </summary> |
| | 22 | 27 | | string SchemaVersion => AsiBackboneSchemaVersions.StableArtifactsV1; |
| | | 28 | | |
| | | 29 | | /// <summary> |
| | | 30 | | /// Gets the UTC timestamp when the audited event occurred. |
| | | 31 | | /// </summary> |
| | | 32 | | DateTimeOffset OccurredUtc { get; } |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// Gets the stable actor identifier associated with the event. |
| | | 36 | | /// </summary> |
| | | 37 | | string ActorId { get; } |
| | | 38 | | |
| | | 39 | | /// <summary> |
| | | 40 | | /// Gets the actor type associated with the event. |
| | | 41 | | /// </summary> |
| | | 42 | | AsiBackboneActorType ActorType { get; } |
| | | 43 | | |
| | | 44 | | /// <summary> |
| | | 45 | | /// Gets the optional display name or label associated with the actor. |
| | | 46 | | /// </summary> |
| | | 47 | | string? ActorDisplayName { get; } |
| | | 48 | | |
| | | 49 | | /// <summary> |
| | | 50 | | /// Gets the operation name associated with the audited event. |
| | | 51 | | /// </summary> |
| | | 52 | | string OperationName { get; } |
| | | 53 | | |
| | | 54 | | /// <summary> |
| | | 55 | | /// Gets the governance, constraint, or host-defined outcome associated with the event. |
| | | 56 | | /// </summary> |
| | | 57 | | string Outcome { get; } |
| | | 58 | | |
| | | 59 | | /// <summary> |
| | | 60 | | /// Gets machine-readable reason codes associated with the event. |
| | | 61 | | /// </summary> |
| | | 62 | | IReadOnlyList<string> ReasonCodes { get; } |
| | | 63 | | |
| | | 64 | | /// <summary> |
| | | 65 | | /// Gets the correlation identifier associated with the event, when supplied by the host. |
| | | 66 | | /// </summary> |
| | | 67 | | string? CorrelationId { get; } |
| | | 68 | | |
| | | 69 | | /// <summary> |
| | | 70 | | /// Gets the trace identifier associated with the event, when supplied by the host. |
| | | 71 | | /// </summary> |
| | | 72 | | string? TraceId { get; } |
| | | 73 | | |
| | | 74 | | /// <summary> |
| | | 75 | | /// Gets the span identifier associated with the event, when supplied by the host or observability adapter. |
| | | 76 | | /// </summary> |
| | 23 | 77 | | string? SpanId => null; |
| | | 78 | | |
| | | 79 | | /// <summary> |
| | | 80 | | /// Gets the parent span identifier associated with the event, when supplied by the host or observability adapter. |
| | | 81 | | /// </summary> |
| | 23 | 82 | | string? ParentSpanId => null; |
| | | 83 | | |
| | | 84 | | /// <summary> |
| | | 85 | | /// Gets the decision latency in milliseconds, when supplied by the host. |
| | | 86 | | /// </summary> |
| | 23 | 87 | | long? DecisionLatencyMs => null; |
| | | 88 | | |
| | | 89 | | /// <summary> |
| | | 90 | | /// Gets the hash of the evaluated constraint set, when supplied by the host. |
| | | 91 | | /// </summary> |
| | 23 | 92 | | string? ConstraintSetHash => null; |
| | | 93 | | |
| | | 94 | | /// <summary> |
| | | 95 | | /// Gets the number of constraints evaluated for the decision, when supplied by the host. |
| | | 96 | | /// </summary> |
| | 23 | 97 | | int? ConstraintCount => null; |
| | | 98 | | |
| | | 99 | | /// <summary> |
| | | 100 | | /// Gets the host-defined risk score associated with the decision, when supplied by the host. |
| | | 101 | | /// </summary> |
| | 23 | 102 | | double? RiskScore => null; |
| | | 103 | | |
| | | 104 | | /// <summary> |
| | | 105 | | /// Gets the policy scope associated with the decision, when supplied by the host. |
| | | 106 | | /// </summary> |
| | 23 | 107 | | string? PolicyScope => null; |
| | | 108 | | |
| | | 109 | | /// <summary> |
| | | 110 | | /// Gets the privacy-preserving tenant hash associated with the decision, when supplied by the host. |
| | | 111 | | /// </summary> |
| | 23 | 112 | | string? TenantHash => null; |
| | | 113 | | |
| | | 114 | | /// <summary> |
| | | 115 | | /// Gets the privacy-preserving organization hash associated with the decision, when supplied by the host. |
| | | 116 | | /// </summary> |
| | 23 | 117 | | string? OrganizationHash => null; |
| | | 118 | | |
| | | 119 | | /// <summary> |
| | | 120 | | /// Gets the provider-neutral emitter status, when supplied by the host or outbox provider. |
| | | 121 | | /// </summary> |
| | 23 | 122 | | string? EmitterStatus => null; |
| | | 123 | | |
| | | 124 | | /// <summary> |
| | | 125 | | /// Gets the provider-neutral emitter provider name, when supplied by the host or outbox provider. |
| | | 126 | | /// </summary> |
| | 23 | 127 | | string? EmitterProvider => null; |
| | | 128 | | |
| | | 129 | | /// <summary> |
| | | 130 | | /// Gets the outbox sequence associated with the event, when supplied by the host or outbox provider. |
| | | 131 | | /// </summary> |
| | 23 | 132 | | long? OutboxSequence => null; |
| | | 133 | | |
| | | 134 | | /// <summary> |
| | | 135 | | /// Gets the gateway execution identifier associated with the event, when supplied by the host or gateway provider. |
| | | 136 | | /// </summary> |
| | 23 | 137 | | string? GatewayExecutionId => null; |
| | | 138 | | |
| | | 139 | | /// <summary> |
| | | 140 | | /// Gets the provider-neutral decision stage associated with the event, when supplied by the host. |
| | | 141 | | /// </summary> |
| | 23 | 142 | | string? DecisionStage => null; |
| | | 143 | | |
| | | 144 | | /// <summary> |
| | | 145 | | /// Gets the policy version associated with the event, when supplied by the host. |
| | | 146 | | /// </summary> |
| | | 147 | | string? PolicyVersion { get; } |
| | | 148 | | |
| | | 149 | | /// <summary> |
| | | 150 | | /// Gets the policy hash associated with the event, when supplied by the host. |
| | | 151 | | /// </summary> |
| | | 152 | | string? PolicyHash { get; } |
| | | 153 | | |
| | | 154 | | /// <summary> |
| | | 155 | | /// Gets additional framework-neutral audit metadata supplied by the host. |
| | | 156 | | /// </summary> |
| | | 157 | | IReadOnlyDictionary<string, string> Metadata { get; } |
| | | 158 | | } |