1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-24 12:35:25 +01:00

Resolve AC Warnings (#4644)

* Resolve AC Warnings

* Remove Unneeded Changes

* Add Back RequiredAttribute

* Format
This commit is contained in:
Justin Baur 2024-11-22 16:05:15 -05:00 committed by GitHub
parent f4dd794cba
commit dac8f66a59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 6 deletions

View File

@ -143,7 +143,7 @@ public class OrganizationEditModel : OrganizationViewModel
[Display(Name = "SCIM")]
public bool UseScim { get; set; }
[Display(Name = "Secrets Manager")]
public bool UseSecretsManager { get; set; }
public new bool UseSecretsManager { get; set; }
[Display(Name = "Self Host")]
public bool SelfHost { get; set; }
[Display(Name = "Users Get Premium")]

View File

@ -1,8 +1,11 @@
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
#nullable enable
namespace Bit.Api.AdminConsole.Public.Models;
public abstract class MemberBaseModel
@ -25,6 +28,7 @@ public abstract class MemberBaseModel
}
}
[SetsRequiredMembers]
public MemberBaseModel(OrganizationUserUserDetails user)
{
if (user == null)
@ -46,14 +50,13 @@ public abstract class MemberBaseModel
/// </summary>
[Required]
[EnumDataType(typeof(OrganizationUserType))]
public OrganizationUserType? Type { get; set; }
public required OrganizationUserType? Type { get; set; }
/// <summary>
/// External identifier for reference or linking this member to another system, such as a user directory.
/// </summary>
/// <example>external_id_123456</example>
[StringLength(300)]
public string ExternalId { get; set; }
public string? ExternalId { get; set; }
/// <summary>
/// The member's custom permissions if the member has a Custom role. If not supplied, all custom permissions will
/// default to false.

View File

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using Bit.Api.Models.Public.Response;
using Bit.Core.Entities;
@ -16,6 +17,7 @@ public class MemberResponseModel : MemberBaseModel, IResponseModel
[JsonConstructor]
public MemberResponseModel() { }
[SetsRequiredMembers]
public MemberResponseModel(OrganizationUser user, IEnumerable<CollectionAccessSelection> collections) : base(user)
{
if (user == null)
@ -31,6 +33,7 @@ public class MemberResponseModel : MemberBaseModel, IResponseModel
ResetPasswordEnrolled = user.ResetPasswordKey != null;
}
[SetsRequiredMembers]
public MemberResponseModel(OrganizationUserUserDetails user, bool twoFactorEnabled,
IEnumerable<CollectionAccessSelection> collections) : base(user)
{

View File

@ -8,10 +8,8 @@ public class ProviderInitiateDeleteModel : BaseMailModel
Token,
ProviderNameUrlEncoded);
public string WebVaultUrl { get; set; }
public string Token { get; set; }
public Guid ProviderId { get; set; }
public string SiteName { get; set; }
public string ProviderName { get; set; }
public string ProviderNameUrlEncoded { get; set; }
public string ProviderBillingEmail { get; set; }