-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathCreateOrganizationInviteLinkRequestModel.cs
More file actions
37 lines (32 loc) · 1.21 KB
/
CreateOrganizationInviteLinkRequestModel.cs
File metadata and controls
37 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.ComponentModel.DataAnnotations;
using Bit.Core.AdminConsole.OrganizationFeatures.InviteLinks;
using Bit.Core.Utilities;
namespace Bit.Api.AdminConsole.Models.Request.Organizations;
public class CreateOrganizationInviteLinkRequestModel
{
/// <summary>
/// Email domains permitted to accept the invite link (e.g. <c>["acme.com"]</c>).
/// </summary>
[Required]
[MinLength(1)]
[ValidateSequence<DomainNameValidatorAttribute>]
public required IEnumerable<string> AllowedDomains { get; set; }
/// <summary>
/// The invite key encrypted with the organization key.
/// </summary>
[Required]
[EncryptedString]
public required string EncryptedInviteKey { get; set; }
/// <summary>
/// The organization key encrypted for the invite link. Currently unused; will be populated in a future stage.
/// </summary>
[EncryptedString]
public string? EncryptedOrgKey { get; set; }
public CreateOrganizationInviteLinkRequest ToCommandRequest(Guid organizationId) => new()
{
OrganizationId = organizationId,
AllowedDomains = AllowedDomains,
EncryptedInviteKey = EncryptedInviteKey,
EncryptedOrgKey = EncryptedOrgKey,
};
}