| | | 1 | | using Elsa.Mediator.Contracts; |
| | | 2 | | |
| | | 3 | | namespace Elsa.ExternalAuthentication.Notifications; |
| | | 4 | | |
| | | 5 | | public enum SecurityEventOutcome |
| | | 6 | | { |
| | | 7 | | Succeeded, |
| | | 8 | | Failed, |
| | | 9 | | Rejected |
| | | 10 | | } |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Safe context shared by External Authentication security notifications. |
| | | 14 | | /// It intentionally contains no secret, token, raw subject, or unrestricted claim value. |
| | | 15 | | /// </summary> |
| | | 16 | | public sealed record SecurityEventContext( |
| | | 17 | | string? ActorId, |
| | | 18 | | string? TenantId, |
| | | 19 | | string? ConnectionId, |
| | | 20 | | string? UserId, |
| | | 21 | | DateTimeOffset OccurredAt, |
| | | 22 | | SecurityEventOutcome Outcome, |
| | | 23 | | string CorrelationId, |
| | | 24 | | string Summary); |
| | | 25 | | |
| | 24 | 26 | | public sealed record IdentityProviderConnectionChanged(SecurityEventContext Context, string Operation, long Revision, st |
| | | 27 | | public sealed record IdentityProviderConnectionLifecycleChanged(SecurityEventContext Context, string PreviousLifecycle, |
| | | 28 | | public sealed record IdentityProviderConnectionSecretBindingChanged(SecurityEventContext Context, string FieldName, stri |
| | | 29 | | public sealed record IdentityProviderConnectionTested(SecurityEventContext Context, string TestedMaterialRevision, strin |
| | | 30 | | public sealed record IdentityProviderConnectionPreviewed(SecurityEventContext Context, string MaterialRevision) : INotif |
| | | 31 | | public sealed record ExternalIdentityLinkChanged(SecurityEventContext Context, string Operation, string LinkId) : INotif |
| | | 32 | | public sealed record ExternalIdentityLinkReplaced( |
| | | 33 | | SecurityEventContext Context, |
| | | 34 | | string OldLinkId, |
| | | 35 | | string? NewLinkId, |
| | | 36 | | string OldUserId, |
| | | 37 | | string NewUserId, |
| | | 38 | | string OldConnectionKey, |
| | | 39 | | string NewConnectionKey, |
| | | 40 | | string? ConflictingLinkId = null, |
| | | 41 | | string? ConflictingUserId = null, |
| | | 42 | | string? ConflictingConnectionKey = null) : INotification; |
| | | 43 | | public sealed record ExternalAuthenticationSessionRevoked(SecurityEventContext Context, string SessionId, string Reason) |
| | | 44 | | public sealed record ExternalAuthenticationConnectionSessionsRevoked(SecurityEventContext Context, int SessionCount, str |
| | | 45 | | public sealed record ExternalSignInCompleted(SecurityEventContext Context, string? SessionId, string? AdapterType) : INo |
| | | 46 | | /// <summary>Safe terminal broker outcome. Flow and stage are fixed internal vocabulary; no provider detail is included. |
| | | 47 | | public sealed record ExternalAuthenticationOutcomeRecorded(SecurityEventContext Context, string Flow, string Stage, stri |