| | | 1 | | namespace Elsa.ExternalAuthentication.Models; |
| | | 2 | | |
| | | 3 | | public sealed record ConnectionValidationResult(bool IsValid, IReadOnlyCollection<ConnectionValidationError> Errors, IRe |
| | | 4 | | public sealed record ConnectionValidationError(string Field, string Code, string Message); |
| | | 5 | | public sealed record ConnectionTestResult(ConnectionObservationStatus Status, string Category, string Summary, IReadOnly |
| | | 6 | | public sealed record ExternalAuthorizationRequest(Uri NavigationUri, byte[] ProtectedAdapterState); |
| | | 7 | | public sealed record ExternalAuthenticationResult(ExternalIdentity Identity, IReadOnlyDictionary<string, IReadOnlyCollec |
| | | 8 | | public sealed record ExternalLogoutRequest(Uri NavigationUri, byte[] ProtectedAdapterState); |
| | | 9 | | public sealed record PermissionGrant(string Permission, string SourceType, string SourceReference); |
| | | 10 | | public sealed record PermissionGrantWarning(string Code, string Message); |
| | | 11 | | public sealed record PermissionGrantResult(IReadOnlyCollection<PermissionGrant> Grants, IReadOnlyCollection<PermissionGr |
| | | 12 | | public sealed record PermissionDelegationResult(bool IsAuthorized, IReadOnlyCollection<string> UnauthorizedPermissions); |
| | | 13 | | public sealed record UserCreationProposal(string UserNamePrefix, string? DisplayName = null, IReadOnlyCollection<string> |
| | | 14 | | public sealed record ExternalIdentityResolution(string UserId, bool WasProvisioned); |
| | | 15 | | public abstract record ExternalUserMatchResult |
| | | 16 | | { |
| | | 17 | | private ExternalUserMatchResult() { } |
| | | 18 | | public sealed record Match(string UserId, string AuthorizationBasis) : ExternalUserMatchResult; |
| | | 19 | | public sealed record NoMatch : ExternalUserMatchResult; |
| | | 20 | | public sealed record Ambiguous : ExternalUserMatchResult; |
| | | 21 | | } |
| | | 22 | | public sealed record ProvisioningRequest(string TenantId, string ConnectionKey, ExternalIdentity Identity, UserCreationP |
| | | 23 | | public sealed record ProvisioningResult(string UserId, ExternalIdentityLink Link, bool WasCreated, bool WasLinkCreated = |
| | | 24 | | public sealed record ExternalIdentityLinkReplaceRequest(string TenantId, string LinkId, string UserId, string Connection |
| | | 25 | | public abstract record ExternalIdentityLinkReplaceResult |
| | | 26 | | { |
| | | 27 | | private ExternalIdentityLinkReplaceResult() { } |
| | | 28 | | public sealed record Success(ExternalIdentityLink OldLink, ExternalIdentityLink NewLink) : ExternalIdentityLinkRepla |
| | | 29 | | public sealed record Conflict(ExternalIdentityLink OldLink, ExternalIdentityLink ConflictingLink) : ExternalIdentity |
| | | 30 | | public sealed record NotFound : ExternalIdentityLinkReplaceResult; |
| | | 31 | | } |
| | 24 | 32 | | public sealed record ExternalTokenResponse(string AccessToken, string TokenType, long ExpiresIn, string RefreshToken, lo |
| | | 33 | | public sealed record AdapterSettingsMigrationResult(int SettingsVersion, System.Text.Json.JsonElement Settings, bool Was |
| | | 34 | | |
| | | 35 | | public abstract record TakeResult<T> |
| | | 36 | | { |
| | | 37 | | private TakeResult() { } |
| | | 38 | | public sealed record Taken(T Value) : TakeResult<T>; |
| | | 39 | | public sealed record NotFound : TakeResult<T>; |
| | | 40 | | public sealed record Expired : TakeResult<T>; |
| | | 41 | | public sealed record AlreadyConsumed : TakeResult<T>; |
| | | 42 | | } |
| | | 43 | | |
| | | 44 | | public sealed class SensitiveString : IDisposable |
| | | 45 | | { |
| | | 46 | | private char[]? _characters; |
| | | 47 | | |
| | | 48 | | public SensitiveString(string value) => _characters = value.ToCharArray(); |
| | | 49 | | |
| | | 50 | | public string Reveal() => _characters is null ? throw new ObjectDisposedException(nameof(SensitiveString)) : new str |
| | | 51 | | |
| | | 52 | | public void Dispose() |
| | | 53 | | { |
| | | 54 | | if (_characters is null) |
| | | 55 | | return; |
| | | 56 | | |
| | | 57 | | Array.Clear(_characters); |
| | | 58 | | _characters = null; |
| | | 59 | | } |
| | | 60 | | |
| | | 61 | | public override string ToString() => "[REDACTED]"; |
| | | 62 | | } |