| | | 1 | | using System.Text.Json; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Api.Client.Resources.ExternalAuthentication.Descriptors.Models; |
| | | 4 | | |
| | | 5 | | public sealed class ExternalAuthenticationAdapterDescriptor |
| | | 6 | | { |
| | | 7 | | public string Type { get; set; } = ""; |
| | | 8 | | public string DisplayName { get; set; } = ""; |
| | | 9 | | public string Description { get; set; } = ""; |
| | | 10 | | public int SettingsVersion { get; set; } |
| | | 11 | | public ICollection<ExternalAuthenticationSettingFieldDescriptor> Fields { get; set; } = []; |
| | | 12 | | public ExternalAuthenticationAdapterCapabilities Capabilities { get; set; } = new(); |
| | | 13 | | public ExternalAuthenticationCustomEditorContract? CustomEditor { get; set; } |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | public sealed class ExternalAuthenticationPolicyDescriptor |
| | | 17 | | { |
| | 0 | 18 | | public string Type { get; set; } = ""; |
| | 0 | 19 | | public string DisplayName { get; set; } = ""; |
| | 0 | 20 | | public string Description { get; set; } = ""; |
| | 0 | 21 | | public int SettingsVersion { get; set; } |
| | 0 | 22 | | public ICollection<ExternalAuthenticationSettingFieldDescriptor> Fields { get; set; } = []; |
| | 0 | 23 | | public ExternalAuthenticationCustomEditorContract? CustomEditor { get; set; } |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | public sealed class ExternalAuthenticationPermissionGrantSourceDescriptor |
| | | 27 | | { |
| | | 28 | | public string Type { get; set; } = ""; |
| | | 29 | | public string DisplayName { get; set; } = ""; |
| | | 30 | | public string Description { get; set; } = ""; |
| | | 31 | | public int SettingsVersion { get; set; } |
| | | 32 | | public ICollection<ExternalAuthenticationSettingFieldDescriptor> Fields { get; set; } = []; |
| | | 33 | | public ExternalAuthenticationCustomEditorContract? CustomEditor { get; set; } |
| | | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// One permission resource a claim mapping may be configured to confer. |
| | | 38 | | /// </summary> |
| | | 39 | | /// <remarks> |
| | | 40 | | /// Mirrors the core catalog's descriptor, which is keyed by resource and carries the verbs that resource |
| | | 41 | | /// accepts. It replaced a single <c>Name</c> holding a whole permission string when the two-axis model |
| | | 42 | | /// landed: a mapping picks a resource and a verb, so a client needs both to offer the choice. |
| | | 43 | | /// </remarks> |
| | | 44 | | public sealed class ExternalAuthenticationPermissionDescriptor |
| | | 45 | | { |
| | | 46 | | /// <summary>The hierarchical resource path, for example <c>workflows/definitions</c>.</summary> |
| | | 47 | | public string Resource { get; set; } = ""; |
| | | 48 | | |
| | | 49 | | /// <summary>The verbs this resource accepts. The wildcard is deliberately absent: it is not a verb a user selects.< |
| | | 50 | | public ICollection<string> SupportedVerbs { get; set; } = []; |
| | | 51 | | |
| | | 52 | | public string DisplayName { get; set; } = ""; |
| | | 53 | | public string Description { get; set; } = ""; |
| | | 54 | | public string Category { get; set; } = ""; |
| | | 55 | | |
| | | 56 | | /// <summary><c>false</c> for a descriptor auto-registered because a module declared a permission that matched none. |
| | | 57 | | public bool Verified { get; set; } = true; |
| | | 58 | | } |
| | | 59 | | |
| | | 60 | | public sealed class ExternalAuthenticationSettingFieldDescriptor |
| | | 61 | | { |
| | | 62 | | public string Name { get; set; } = ""; |
| | | 63 | | public string DisplayName { get; set; } = ""; |
| | | 64 | | public string Description { get; set; } = ""; |
| | | 65 | | public string ValueType { get; set; } = ""; |
| | | 66 | | public bool IsRequired { get; set; } |
| | | 67 | | public string UiHint { get; set; } = ""; |
| | | 68 | | public JsonElement? DefaultValue { get; set; } |
| | | 69 | | public ICollection<string> AllowedValues { get; set; } = []; |
| | | 70 | | public ExternalAuthenticationSettingFieldValidation Validation { get; set; } = new(); |
| | | 71 | | public bool IsSecretBinding { get; set; } |
| | | 72 | | public bool IsUnsafe { get; set; } |
| | | 73 | | public ExternalAuthenticationSettingFieldVisibilityCondition? VisibleWhen { get; set; } |
| | | 74 | | public string? HelpText { get; set; } |
| | | 75 | | public bool IsRedacted { get; set; } |
| | | 76 | | } |
| | | 77 | | |
| | | 78 | | public sealed class ExternalAuthenticationSettingFieldValidation |
| | | 79 | | { |
| | | 80 | | public int? MinimumLength { get; set; } |
| | | 81 | | public int? MaximumLength { get; set; } |
| | | 82 | | public string? Pattern { get; set; } |
| | | 83 | | } |
| | | 84 | | |
| | | 85 | | public sealed class ExternalAuthenticationSettingFieldVisibilityCondition |
| | | 86 | | { |
| | | 87 | | public string Field { get; set; } = ""; |
| | | 88 | | public string ExpectedValue { get; set; } = ""; |
| | | 89 | | } |
| | | 90 | | |
| | | 91 | | public sealed class ExternalAuthenticationCustomEditorContract |
| | | 92 | | { |
| | | 93 | | public string Key { get; set; } = ""; |
| | | 94 | | public int ContractVersion { get; set; } |
| | | 95 | | } |
| | | 96 | | |
| | | 97 | | public sealed class ExternalAuthenticationAdapterCapabilities |
| | | 98 | | { |
| | | 99 | | public bool SupportsTest { get; set; } |
| | | 100 | | public bool SupportsPreview { get; set; } |
| | | 101 | | public bool SupportsUpstreamLogout { get; set; } |
| | | 102 | | } |