mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
[EC-826] Merge license sync feature branch to master (#2587)
* [EC-634] Extract GenerateLicenseAsync to a query (#2373) * [EC-637] Add license sync to server (#2453) * [EC-1036] Show correct license sync date (#2626) * Update method name per new pattern
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
namespace Bit.Core.Models.Api.OrganizationLicenses;
|
||||
|
||||
public class SelfHostedOrganizationLicenseRequestModel
|
||||
{
|
||||
public string LicenseKey { get; set; }
|
||||
public string BillingSyncKey { get; set; }
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.OrganizationConnectionConfigs;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationConnections;
|
||||
|
||||
public class OrganizationConnectionData<T> where T : new()
|
||||
public class OrganizationConnectionData<T> where T : IConnectionConfig
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public OrganizationConnectionType Type { get; set; }
|
||||
|
@ -1,7 +1,20 @@
|
||||
namespace Bit.Core.Models.OrganizationConnectionConfigs;
|
||||
|
||||
public class BillingSyncConfig
|
||||
public class BillingSyncConfig : IConnectionConfig
|
||||
{
|
||||
public string BillingSyncKey { get; set; }
|
||||
public Guid CloudOrganizationId { get; set; }
|
||||
public DateTime? LastLicenseSync { get; set; }
|
||||
|
||||
public bool Validate(out string exception)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(BillingSyncKey))
|
||||
{
|
||||
exception = "Failed to get Billing Sync Key";
|
||||
return false;
|
||||
}
|
||||
|
||||
exception = "";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
namespace Bit.Core.Models.OrganizationConnectionConfigs;
|
||||
|
||||
public interface IConnectionConfig
|
||||
{
|
||||
bool Validate(out string exception);
|
||||
}
|
@ -3,9 +3,21 @@ using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.OrganizationConnectionConfigs;
|
||||
|
||||
public class ScimConfig
|
||||
public class ScimConfig : IConnectionConfig
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public ScimProviderType? ScimProvider { get; set; }
|
||||
|
||||
public bool Validate(out string exception)
|
||||
{
|
||||
if (!Enabled)
|
||||
{
|
||||
exception = "Scim Config is disabled";
|
||||
return false;
|
||||
}
|
||||
|
||||
exception = "";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user