mirror of
https://github.com/bitwarden/server.git
synced 2025-07-05 10:02:47 -05:00
Revert filescoped (#2227)
* Revert "Add git blame entry (#2226)" This reverts commit239286737d
. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a
.
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class AttachmentResponseData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public CipherAttachment.MetaData Data { get; set; }
|
||||
public Cipher Cipher { get; set; }
|
||||
public string Url { get; set; }
|
||||
public class AttachmentResponseData
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public CipherAttachment.MetaData Data { get; set; }
|
||||
public Cipher Cipher { get; set; }
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,36 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CipherAttachment
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public string AttachmentId { get; set; }
|
||||
public string AttachmentData { get; set; }
|
||||
|
||||
public class MetaData
|
||||
public class CipherAttachment
|
||||
{
|
||||
private long _size;
|
||||
|
||||
// We serialize Size as a string since JSON (or Javascript) doesn't support full precision for long numbers
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
||||
public long Size
|
||||
{
|
||||
get { return _size; }
|
||||
set { _size = value; }
|
||||
}
|
||||
|
||||
public string FileName { get; set; }
|
||||
public string Key { get; set; }
|
||||
|
||||
public string ContainerName { get; set; } = "attachments";
|
||||
public bool Validated { get; set; } = true;
|
||||
|
||||
// This is stored alongside metadata as an identifier. It does not need repeating in serialization
|
||||
[JsonIgnore]
|
||||
public Guid Id { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public string AttachmentId { get; set; }
|
||||
public string AttachmentData { get; set; }
|
||||
|
||||
public class MetaData
|
||||
{
|
||||
private long _size;
|
||||
|
||||
// We serialize Size as a string since JSON (or Javascript) doesn't support full precision for long numbers
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
||||
public long Size
|
||||
{
|
||||
get { return _size; }
|
||||
set { _size = value; }
|
||||
}
|
||||
|
||||
public string FileName { get; set; }
|
||||
public string Key { get; set; }
|
||||
|
||||
public string ContainerName { get; set; } = "attachments";
|
||||
public bool Validated { get; set; } = true;
|
||||
|
||||
// This is stored alongside metadata as an identifier. It does not need repeating in serialization
|
||||
[JsonIgnore]
|
||||
public string AttachmentId { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CipherCardData : CipherData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public CipherCardData() { }
|
||||
public class CipherCardData : CipherData
|
||||
{
|
||||
public CipherCardData() { }
|
||||
|
||||
public string CardholderName { get; set; }
|
||||
public string Brand { get; set; }
|
||||
public string Number { get; set; }
|
||||
public string ExpMonth { get; set; }
|
||||
public string ExpYear { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string CardholderName { get; set; }
|
||||
public string Brand { get; set; }
|
||||
public string Number { get; set; }
|
||||
public string ExpMonth { get; set; }
|
||||
public string ExpYear { get; set; }
|
||||
public string Code { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public abstract class CipherData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public CipherData() { }
|
||||
public abstract class CipherData
|
||||
{
|
||||
public CipherData() { }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public IEnumerable<CipherFieldData> Fields { get; set; }
|
||||
public IEnumerable<CipherPasswordHistoryData> PasswordHistory { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public IEnumerable<CipherFieldData> Fields { get; set; }
|
||||
public IEnumerable<CipherPasswordHistoryData> PasswordHistory { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
namespace Core.Models.Data;
|
||||
|
||||
public class CipherDetails : CipherOrganizationDetails
|
||||
namespace Core.Models.Data
|
||||
{
|
||||
public Guid? FolderId { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public bool Edit { get; set; }
|
||||
public bool ViewPassword { get; set; }
|
||||
public class CipherDetails : CipherOrganizationDetails
|
||||
{
|
||||
public Guid? FolderId { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public bool Edit { get; set; }
|
||||
public bool ViewPassword { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CipherFieldData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public CipherFieldData() { }
|
||||
public class CipherFieldData
|
||||
{
|
||||
public CipherFieldData() { }
|
||||
|
||||
public FieldType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
public int? LinkedId { get; set; }
|
||||
public FieldType Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
public int? LinkedId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +1,26 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CipherIdentityData : CipherData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public CipherIdentityData() { }
|
||||
public class CipherIdentityData : CipherData
|
||||
{
|
||||
public CipherIdentityData() { }
|
||||
|
||||
public string Title { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string MiddleName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Address1 { get; set; }
|
||||
public string Address2 { get; set; }
|
||||
public string Address3 { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string Company { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public string SSN { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string PassportNumber { get; set; }
|
||||
public string LicenseNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string MiddleName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Address1 { get; set; }
|
||||
public string Address2 { get; set; }
|
||||
public string Address3 { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string Company { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public string SSN { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string PassportNumber { get; set; }
|
||||
public string LicenseNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +1,31 @@
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CipherLoginData : CipherData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
private string _uri;
|
||||
|
||||
public CipherLoginData() { }
|
||||
|
||||
public string Uri
|
||||
public class CipherLoginData : CipherData
|
||||
{
|
||||
get => Uris?.FirstOrDefault()?.Uri ?? _uri;
|
||||
set { _uri = value; }
|
||||
}
|
||||
public IEnumerable<CipherLoginUriData> Uris { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public DateTime? PasswordRevisionDate { get; set; }
|
||||
public string Totp { get; set; }
|
||||
public bool? AutofillOnPageLoad { get; set; }
|
||||
private string _uri;
|
||||
|
||||
public class CipherLoginUriData
|
||||
{
|
||||
public CipherLoginUriData() { }
|
||||
public CipherLoginData() { }
|
||||
|
||||
public string Uri { get; set; }
|
||||
public UriMatchType? Match { get; set; } = null;
|
||||
public string Uri
|
||||
{
|
||||
get => Uris?.FirstOrDefault()?.Uri ?? _uri;
|
||||
set { _uri = value; }
|
||||
}
|
||||
public IEnumerable<CipherLoginUriData> Uris { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public DateTime? PasswordRevisionDate { get; set; }
|
||||
public string Totp { get; set; }
|
||||
public bool? AutofillOnPageLoad { get; set; }
|
||||
|
||||
public class CipherLoginUriData
|
||||
{
|
||||
public CipherLoginUriData() { }
|
||||
|
||||
public string Uri { get; set; }
|
||||
public UriMatchType? Match { get; set; } = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Core.Models.Data;
|
||||
|
||||
public class CipherOrganizationDetails : Cipher
|
||||
namespace Core.Models.Data
|
||||
{
|
||||
public bool OrganizationUseTotp { get; set; }
|
||||
public class CipherOrganizationDetails : Cipher
|
||||
{
|
||||
public bool OrganizationUseTotp { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CipherPasswordHistoryData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public CipherPasswordHistoryData() { }
|
||||
public class CipherPasswordHistoryData
|
||||
{
|
||||
public CipherPasswordHistoryData() { }
|
||||
|
||||
public string Password { get; set; }
|
||||
public DateTime LastUsedDate { get; set; }
|
||||
public string Password { get; set; }
|
||||
public DateTime LastUsedDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CipherSecureNoteData : CipherData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public CipherSecureNoteData() { }
|
||||
public class CipherSecureNoteData : CipherData
|
||||
{
|
||||
public CipherSecureNoteData() { }
|
||||
|
||||
public SecureNoteType Type { get; set; }
|
||||
public SecureNoteType Type { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class CollectionDetails : Collection
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
public class CollectionDetails : Collection
|
||||
{
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,134 +1,135 @@
|
||||
using System.Collections;
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class DictionaryEntity : TableEntity, IDictionary<string, EntityProperty>
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
private IDictionary<string, EntityProperty> _properties = new Dictionary<string, EntityProperty>();
|
||||
|
||||
public ICollection<EntityProperty> Values => _properties.Values;
|
||||
|
||||
public EntityProperty this[string key]
|
||||
public class DictionaryEntity : TableEntity, IDictionary<string, EntityProperty>
|
||||
{
|
||||
get => _properties[key];
|
||||
set => _properties[key] = value;
|
||||
}
|
||||
private IDictionary<string, EntityProperty> _properties = new Dictionary<string, EntityProperty>();
|
||||
|
||||
public int Count => _properties.Count;
|
||||
public ICollection<EntityProperty> Values => _properties.Values;
|
||||
|
||||
public bool IsReadOnly => _properties.IsReadOnly;
|
||||
public EntityProperty this[string key]
|
||||
{
|
||||
get => _properties[key];
|
||||
set => _properties[key] = value;
|
||||
}
|
||||
|
||||
public ICollection<string> Keys => _properties.Keys;
|
||||
public int Count => _properties.Count;
|
||||
|
||||
public override void ReadEntity(IDictionary<string, EntityProperty> properties,
|
||||
OperationContext operationContext)
|
||||
{
|
||||
_properties = properties;
|
||||
}
|
||||
public bool IsReadOnly => _properties.IsReadOnly;
|
||||
|
||||
public override IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext)
|
||||
{
|
||||
return _properties;
|
||||
}
|
||||
public ICollection<string> Keys => _properties.Keys;
|
||||
|
||||
public void Add(string key, EntityProperty value)
|
||||
{
|
||||
_properties.Add(key, value);
|
||||
}
|
||||
public override void ReadEntity(IDictionary<string, EntityProperty> properties,
|
||||
OperationContext operationContext)
|
||||
{
|
||||
_properties = properties;
|
||||
}
|
||||
|
||||
public void Add(string key, bool value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public override IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext)
|
||||
{
|
||||
return _properties;
|
||||
}
|
||||
|
||||
public void Add(string key, byte[] value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, EntityProperty value)
|
||||
{
|
||||
_properties.Add(key, value);
|
||||
}
|
||||
|
||||
public void Add(string key, DateTime? value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, bool value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public void Add(string key, DateTimeOffset? value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, byte[] value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public void Add(string key, double value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, DateTime? value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public void Add(string key, Guid value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, DateTimeOffset? value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public void Add(string key, int value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, double value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public void Add(string key, long value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, Guid value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public void Add(string key, string value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
public void Add(string key, int value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public void Add(KeyValuePair<string, EntityProperty> item)
|
||||
{
|
||||
_properties.Add(item);
|
||||
}
|
||||
public void Add(string key, long value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
return _properties.ContainsKey(key);
|
||||
}
|
||||
public void Add(string key, string value)
|
||||
{
|
||||
_properties.Add(key, new EntityProperty(value));
|
||||
}
|
||||
|
||||
public bool Remove(string key)
|
||||
{
|
||||
return _properties.Remove(key);
|
||||
}
|
||||
public void Add(KeyValuePair<string, EntityProperty> item)
|
||||
{
|
||||
_properties.Add(item);
|
||||
}
|
||||
|
||||
public bool TryGetValue(string key, out EntityProperty value)
|
||||
{
|
||||
return _properties.TryGetValue(key, out value);
|
||||
}
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
return _properties.ContainsKey(key);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_properties.Clear();
|
||||
}
|
||||
public bool Remove(string key)
|
||||
{
|
||||
return _properties.Remove(key);
|
||||
}
|
||||
|
||||
public bool Contains(KeyValuePair<string, EntityProperty> item)
|
||||
{
|
||||
return _properties.Contains(item);
|
||||
}
|
||||
public bool TryGetValue(string key, out EntityProperty value)
|
||||
{
|
||||
return _properties.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
public void CopyTo(KeyValuePair<string, EntityProperty>[] array, int arrayIndex)
|
||||
{
|
||||
_properties.CopyTo(array, arrayIndex);
|
||||
}
|
||||
public void Clear()
|
||||
{
|
||||
_properties.Clear();
|
||||
}
|
||||
|
||||
public bool Remove(KeyValuePair<string, EntityProperty> item)
|
||||
{
|
||||
return _properties.Remove(item);
|
||||
}
|
||||
public bool Contains(KeyValuePair<string, EntityProperty> item)
|
||||
{
|
||||
return _properties.Contains(item);
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<string, EntityProperty>> GetEnumerator()
|
||||
{
|
||||
return _properties.GetEnumerator();
|
||||
}
|
||||
public void CopyTo(KeyValuePair<string, EntityProperty>[] array, int arrayIndex)
|
||||
{
|
||||
_properties.CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return _properties.GetEnumerator();
|
||||
public bool Remove(KeyValuePair<string, EntityProperty> item)
|
||||
{
|
||||
return _properties.Remove(item);
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<string, EntityProperty>> GetEnumerator()
|
||||
{
|
||||
return _properties.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return _properties.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class EmergencyAccessDetails : EmergencyAccess
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public string GranteeName { get; set; }
|
||||
public string GranteeEmail { get; set; }
|
||||
public string GrantorName { get; set; }
|
||||
public string GrantorEmail { get; set; }
|
||||
public class EmergencyAccessDetails : EmergencyAccess
|
||||
{
|
||||
public string GranteeName { get; set; }
|
||||
public string GranteeEmail { get; set; }
|
||||
public string GrantorName { get; set; }
|
||||
public string GrantorEmail { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class EmergencyAccessNotify : EmergencyAccess
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public string GrantorEmail { get; set; }
|
||||
public string GranteeName { get; set; }
|
||||
public string GranteeEmail { get; set; }
|
||||
public class EmergencyAccessNotify : EmergencyAccess
|
||||
{
|
||||
public string GrantorEmail { get; set; }
|
||||
public string GranteeName { get; set; }
|
||||
public string GranteeEmail { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
using Bit.Core.Entities;
|
||||
using Core.Models.Data;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class EmergencyAccessViewData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public EmergencyAccess EmergencyAccess { get; set; }
|
||||
public IEnumerable<CipherDetails> Ciphers { get; set; }
|
||||
public class EmergencyAccessViewData
|
||||
{
|
||||
public EmergencyAccess EmergencyAccess { get; set; }
|
||||
public IEnumerable<CipherDetails> Ciphers { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,35 @@
|
||||
using Bit.Core.Context;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class EventMessage : IEvent
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public EventMessage() { }
|
||||
|
||||
public EventMessage(ICurrentContext currentContext)
|
||||
: base()
|
||||
public class EventMessage : IEvent
|
||||
{
|
||||
IpAddress = currentContext.IpAddress;
|
||||
DeviceType = currentContext.DeviceType;
|
||||
}
|
||||
public EventMessage() { }
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
public EventType Type { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public Guid? InstallationId { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public Guid? CipherId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public Guid? GroupId { get; set; }
|
||||
public Guid? PolicyId { get; set; }
|
||||
public Guid? OrganizationUserId { get; set; }
|
||||
public Guid? ProviderUserId { get; set; }
|
||||
public Guid? ProviderOrganizationId { get; set; }
|
||||
public Guid? ActingUserId { get; set; }
|
||||
public DeviceType? DeviceType { get; set; }
|
||||
public string IpAddress { get; set; }
|
||||
public Guid? IdempotencyId { get; private set; } = Guid.NewGuid();
|
||||
public EventMessage(ICurrentContext currentContext)
|
||||
: base()
|
||||
{
|
||||
IpAddress = currentContext.IpAddress;
|
||||
DeviceType = currentContext.DeviceType;
|
||||
}
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
public EventType Type { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public Guid? InstallationId { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public Guid? CipherId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public Guid? GroupId { get; set; }
|
||||
public Guid? PolicyId { get; set; }
|
||||
public Guid? OrganizationUserId { get; set; }
|
||||
public Guid? ProviderUserId { get; set; }
|
||||
public Guid? ProviderOrganizationId { get; set; }
|
||||
public Guid? ActingUserId { get; set; }
|
||||
public DeviceType? DeviceType { get; set; }
|
||||
public string IpAddress { get; set; }
|
||||
public Guid? IdempotencyId { get; private set; } = Guid.NewGuid();
|
||||
}
|
||||
}
|
||||
|
@ -2,153 +2,154 @@
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class EventTableEntity : TableEntity, IEvent
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public EventTableEntity() { }
|
||||
|
||||
private EventTableEntity(IEvent e)
|
||||
public class EventTableEntity : TableEntity, IEvent
|
||||
{
|
||||
Date = e.Date;
|
||||
Type = e.Type;
|
||||
UserId = e.UserId;
|
||||
OrganizationId = e.OrganizationId;
|
||||
InstallationId = e.InstallationId;
|
||||
ProviderId = e.ProviderId;
|
||||
CipherId = e.CipherId;
|
||||
CollectionId = e.CollectionId;
|
||||
PolicyId = e.PolicyId;
|
||||
GroupId = e.GroupId;
|
||||
OrganizationUserId = e.OrganizationUserId;
|
||||
ProviderUserId = e.ProviderUserId;
|
||||
ProviderOrganizationId = e.ProviderOrganizationId;
|
||||
DeviceType = e.DeviceType;
|
||||
IpAddress = e.IpAddress;
|
||||
ActingUserId = e.ActingUserId;
|
||||
}
|
||||
public EventTableEntity() { }
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
public EventType Type { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public Guid? InstallationId { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public Guid? CipherId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public Guid? PolicyId { get; set; }
|
||||
public Guid? GroupId { get; set; }
|
||||
public Guid? OrganizationUserId { get; set; }
|
||||
public Guid? ProviderUserId { get; set; }
|
||||
public Guid? ProviderOrganizationId { get; set; }
|
||||
public DeviceType? DeviceType { get; set; }
|
||||
public string IpAddress { get; set; }
|
||||
public Guid? ActingUserId { get; set; }
|
||||
|
||||
public override IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext)
|
||||
{
|
||||
var result = base.WriteEntity(operationContext);
|
||||
|
||||
var typeName = nameof(Type);
|
||||
if (result.ContainsKey(typeName))
|
||||
private EventTableEntity(IEvent e)
|
||||
{
|
||||
result[typeName] = new EntityProperty((int)Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(typeName, new EntityProperty((int)Type));
|
||||
Date = e.Date;
|
||||
Type = e.Type;
|
||||
UserId = e.UserId;
|
||||
OrganizationId = e.OrganizationId;
|
||||
InstallationId = e.InstallationId;
|
||||
ProviderId = e.ProviderId;
|
||||
CipherId = e.CipherId;
|
||||
CollectionId = e.CollectionId;
|
||||
PolicyId = e.PolicyId;
|
||||
GroupId = e.GroupId;
|
||||
OrganizationUserId = e.OrganizationUserId;
|
||||
ProviderUserId = e.ProviderUserId;
|
||||
ProviderOrganizationId = e.ProviderOrganizationId;
|
||||
DeviceType = e.DeviceType;
|
||||
IpAddress = e.IpAddress;
|
||||
ActingUserId = e.ActingUserId;
|
||||
}
|
||||
|
||||
var deviceTypeName = nameof(DeviceType);
|
||||
if (result.ContainsKey(deviceTypeName))
|
||||
public DateTime Date { get; set; }
|
||||
public EventType Type { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public Guid? InstallationId { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public Guid? CipherId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public Guid? PolicyId { get; set; }
|
||||
public Guid? GroupId { get; set; }
|
||||
public Guid? OrganizationUserId { get; set; }
|
||||
public Guid? ProviderUserId { get; set; }
|
||||
public Guid? ProviderOrganizationId { get; set; }
|
||||
public DeviceType? DeviceType { get; set; }
|
||||
public string IpAddress { get; set; }
|
||||
public Guid? ActingUserId { get; set; }
|
||||
|
||||
public override IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext)
|
||||
{
|
||||
result[deviceTypeName] = new EntityProperty((int?)DeviceType);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(deviceTypeName, new EntityProperty((int?)DeviceType));
|
||||
}
|
||||
var result = base.WriteEntity(operationContext);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override void ReadEntity(IDictionary<string, EntityProperty> properties,
|
||||
OperationContext operationContext)
|
||||
{
|
||||
base.ReadEntity(properties, operationContext);
|
||||
|
||||
var typeName = nameof(Type);
|
||||
if (properties.ContainsKey(typeName) && properties[typeName].Int32Value.HasValue)
|
||||
{
|
||||
Type = (EventType)properties[typeName].Int32Value.Value;
|
||||
}
|
||||
|
||||
var deviceTypeName = nameof(DeviceType);
|
||||
if (properties.ContainsKey(deviceTypeName) && properties[deviceTypeName].Int32Value.HasValue)
|
||||
{
|
||||
DeviceType = (DeviceType)properties[deviceTypeName].Int32Value.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<EventTableEntity> IndexEvent(EventMessage e)
|
||||
{
|
||||
var uniquifier = e.IdempotencyId.GetValueOrDefault(Guid.NewGuid());
|
||||
|
||||
var pKey = GetPartitionKey(e);
|
||||
|
||||
var dateKey = CoreHelpers.DateTimeToTableStorageKey(e.Date);
|
||||
|
||||
var entities = new List<EventTableEntity>
|
||||
{
|
||||
new EventTableEntity(e)
|
||||
var typeName = nameof(Type);
|
||||
if (result.ContainsKey(typeName))
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"Date={dateKey}__Uniquifier={uniquifier}"
|
||||
result[typeName] = new EntityProperty((int)Type);
|
||||
}
|
||||
};
|
||||
|
||||
if (e.OrganizationId.HasValue && e.ActingUserId.HasValue)
|
||||
{
|
||||
entities.Add(new EventTableEntity(e)
|
||||
else
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"ActingUserId={e.ActingUserId}__Date={dateKey}__Uniquifier={uniquifier}"
|
||||
});
|
||||
}
|
||||
result.Add(typeName, new EntityProperty((int)Type));
|
||||
}
|
||||
|
||||
if (!e.OrganizationId.HasValue && e.ProviderId.HasValue && e.ActingUserId.HasValue)
|
||||
{
|
||||
entities.Add(new EventTableEntity(e)
|
||||
var deviceTypeName = nameof(DeviceType);
|
||||
if (result.ContainsKey(deviceTypeName))
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"ActingUserId={e.ActingUserId}__Date={dateKey}__Uniquifier={uniquifier}"
|
||||
});
|
||||
}
|
||||
|
||||
if (e.CipherId.HasValue)
|
||||
{
|
||||
entities.Add(new EventTableEntity(e)
|
||||
result[deviceTypeName] = new EntityProperty((int?)DeviceType);
|
||||
}
|
||||
else
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"CipherId={e.CipherId}__Date={dateKey}__Uniquifier={uniquifier}"
|
||||
});
|
||||
result.Add(deviceTypeName, new EntityProperty((int?)DeviceType));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
private static string GetPartitionKey(EventMessage e)
|
||||
{
|
||||
if (e.OrganizationId.HasValue)
|
||||
public override void ReadEntity(IDictionary<string, EntityProperty> properties,
|
||||
OperationContext operationContext)
|
||||
{
|
||||
return $"OrganizationId={e.OrganizationId}";
|
||||
base.ReadEntity(properties, operationContext);
|
||||
|
||||
var typeName = nameof(Type);
|
||||
if (properties.ContainsKey(typeName) && properties[typeName].Int32Value.HasValue)
|
||||
{
|
||||
Type = (EventType)properties[typeName].Int32Value.Value;
|
||||
}
|
||||
|
||||
var deviceTypeName = nameof(DeviceType);
|
||||
if (properties.ContainsKey(deviceTypeName) && properties[deviceTypeName].Int32Value.HasValue)
|
||||
{
|
||||
DeviceType = (DeviceType)properties[deviceTypeName].Int32Value.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.ProviderId.HasValue)
|
||||
public static List<EventTableEntity> IndexEvent(EventMessage e)
|
||||
{
|
||||
return $"ProviderId={e.ProviderId}";
|
||||
var uniquifier = e.IdempotencyId.GetValueOrDefault(Guid.NewGuid());
|
||||
|
||||
var pKey = GetPartitionKey(e);
|
||||
|
||||
var dateKey = CoreHelpers.DateTimeToTableStorageKey(e.Date);
|
||||
|
||||
var entities = new List<EventTableEntity>
|
||||
{
|
||||
new EventTableEntity(e)
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"Date={dateKey}__Uniquifier={uniquifier}"
|
||||
}
|
||||
};
|
||||
|
||||
if (e.OrganizationId.HasValue && e.ActingUserId.HasValue)
|
||||
{
|
||||
entities.Add(new EventTableEntity(e)
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"ActingUserId={e.ActingUserId}__Date={dateKey}__Uniquifier={uniquifier}"
|
||||
});
|
||||
}
|
||||
|
||||
if (!e.OrganizationId.HasValue && e.ProviderId.HasValue && e.ActingUserId.HasValue)
|
||||
{
|
||||
entities.Add(new EventTableEntity(e)
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"ActingUserId={e.ActingUserId}__Date={dateKey}__Uniquifier={uniquifier}"
|
||||
});
|
||||
}
|
||||
|
||||
if (e.CipherId.HasValue)
|
||||
{
|
||||
entities.Add(new EventTableEntity(e)
|
||||
{
|
||||
PartitionKey = pKey,
|
||||
RowKey = $"CipherId={e.CipherId}__Date={dateKey}__Uniquifier={uniquifier}"
|
||||
});
|
||||
}
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
return $"UserId={e.UserId}";
|
||||
private static string GetPartitionKey(EventMessage e)
|
||||
{
|
||||
if (e.OrganizationId.HasValue)
|
||||
{
|
||||
return $"OrganizationId={e.OrganizationId}";
|
||||
}
|
||||
|
||||
if (e.ProviderId.HasValue)
|
||||
{
|
||||
return $"ProviderId={e.ProviderId}";
|
||||
}
|
||||
|
||||
return $"UserId={e.UserId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
using System.Data;
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class GroupWithCollections : Group
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public DataTable Collections { get; set; }
|
||||
public class GroupWithCollections : Group
|
||||
{
|
||||
public DataTable Collections { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,24 @@
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public interface IEvent
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
EventType Type { get; set; }
|
||||
Guid? UserId { get; set; }
|
||||
Guid? OrganizationId { get; set; }
|
||||
Guid? InstallationId { get; set; }
|
||||
Guid? ProviderId { get; set; }
|
||||
Guid? CipherId { get; set; }
|
||||
Guid? CollectionId { get; set; }
|
||||
Guid? GroupId { get; set; }
|
||||
Guid? PolicyId { get; set; }
|
||||
Guid? OrganizationUserId { get; set; }
|
||||
Guid? ProviderUserId { get; set; }
|
||||
Guid? ProviderOrganizationId { get; set; }
|
||||
Guid? ActingUserId { get; set; }
|
||||
DeviceType? DeviceType { get; set; }
|
||||
string IpAddress { get; set; }
|
||||
DateTime Date { get; set; }
|
||||
public interface IEvent
|
||||
{
|
||||
EventType Type { get; set; }
|
||||
Guid? UserId { get; set; }
|
||||
Guid? OrganizationId { get; set; }
|
||||
Guid? InstallationId { get; set; }
|
||||
Guid? ProviderId { get; set; }
|
||||
Guid? CipherId { get; set; }
|
||||
Guid? CollectionId { get; set; }
|
||||
Guid? GroupId { get; set; }
|
||||
Guid? PolicyId { get; set; }
|
||||
Guid? OrganizationUserId { get; set; }
|
||||
Guid? ProviderUserId { get; set; }
|
||||
Guid? ProviderOrganizationId { get; set; }
|
||||
Guid? ActingUserId { get; set; }
|
||||
DeviceType? DeviceType { get; set; }
|
||||
string IpAddress { get; set; }
|
||||
DateTime Date { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,35 @@
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class InstallationDeviceEntity : TableEntity
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public InstallationDeviceEntity() { }
|
||||
|
||||
public InstallationDeviceEntity(Guid installationId, Guid deviceId)
|
||||
public class InstallationDeviceEntity : TableEntity
|
||||
{
|
||||
PartitionKey = installationId.ToString();
|
||||
RowKey = deviceId.ToString();
|
||||
}
|
||||
public InstallationDeviceEntity() { }
|
||||
|
||||
public InstallationDeviceEntity(string prefixedDeviceId)
|
||||
{
|
||||
var parts = prefixedDeviceId.Split("_");
|
||||
if (parts.Length < 2)
|
||||
public InstallationDeviceEntity(Guid installationId, Guid deviceId)
|
||||
{
|
||||
throw new ArgumentException("Not enough parts.");
|
||||
PartitionKey = installationId.ToString();
|
||||
RowKey = deviceId.ToString();
|
||||
}
|
||||
if (!Guid.TryParse(parts[0], out var installationId) || !Guid.TryParse(parts[1], out var deviceId))
|
||||
{
|
||||
throw new ArgumentException("Could not parse parts.");
|
||||
}
|
||||
PartitionKey = parts[0];
|
||||
RowKey = parts[1];
|
||||
}
|
||||
|
||||
public static bool IsInstallationDeviceId(string deviceId)
|
||||
{
|
||||
return deviceId != null && deviceId.Length == 73 && deviceId[36] == '_';
|
||||
public InstallationDeviceEntity(string prefixedDeviceId)
|
||||
{
|
||||
var parts = prefixedDeviceId.Split("_");
|
||||
if (parts.Length < 2)
|
||||
{
|
||||
throw new ArgumentException("Not enough parts.");
|
||||
}
|
||||
if (!Guid.TryParse(parts[0], out var installationId) || !Guid.TryParse(parts[1], out var deviceId))
|
||||
{
|
||||
throw new ArgumentException("Could not parse parts.");
|
||||
}
|
||||
PartitionKey = parts[0];
|
||||
RowKey = parts[1];
|
||||
}
|
||||
|
||||
public static bool IsInstallationDeviceId(string deviceId)
|
||||
{
|
||||
return deviceId != null && deviceId.Length == 73 && deviceId[36] == '_';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,35 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations;
|
||||
|
||||
public class OrganizationAbility
|
||||
namespace Bit.Core.Models.Data.Organizations
|
||||
{
|
||||
public OrganizationAbility() { }
|
||||
|
||||
public OrganizationAbility(Organization organization)
|
||||
public class OrganizationAbility
|
||||
{
|
||||
Id = organization.Id;
|
||||
UseEvents = organization.UseEvents;
|
||||
Use2fa = organization.Use2fa;
|
||||
Using2fa = organization.Use2fa && organization.TwoFactorProviders != null &&
|
||||
organization.TwoFactorProviders != "{}";
|
||||
UsersGetPremium = organization.UsersGetPremium;
|
||||
Enabled = organization.Enabled;
|
||||
UseSso = organization.UseSso;
|
||||
UseKeyConnector = organization.UseKeyConnector;
|
||||
UseScim = organization.UseScim;
|
||||
UseResetPassword = organization.UseResetPassword;
|
||||
}
|
||||
public OrganizationAbility() { }
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool Use2fa { get; set; }
|
||||
public bool Using2fa { get; set; }
|
||||
public bool UsersGetPremium { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public bool UseSso { get; set; }
|
||||
public bool UseKeyConnector { get; set; }
|
||||
public bool UseScim { get; set; }
|
||||
public bool UseResetPassword { get; set; }
|
||||
public OrganizationAbility(Organization organization)
|
||||
{
|
||||
Id = organization.Id;
|
||||
UseEvents = organization.UseEvents;
|
||||
Use2fa = organization.Use2fa;
|
||||
Using2fa = organization.Use2fa && organization.TwoFactorProviders != null &&
|
||||
organization.TwoFactorProviders != "{}";
|
||||
UsersGetPremium = organization.UsersGetPremium;
|
||||
Enabled = organization.Enabled;
|
||||
UseSso = organization.UseSso;
|
||||
UseKeyConnector = organization.UseKeyConnector;
|
||||
UseScim = organization.UseScim;
|
||||
UseResetPassword = organization.UseResetPassword;
|
||||
}
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool Use2fa { get; set; }
|
||||
public bool Using2fa { get; set; }
|
||||
public bool UsersGetPremium { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public bool UseSso { get; set; }
|
||||
public bool UseKeyConnector { get; set; }
|
||||
public bool UseScim { get; set; }
|
||||
public bool UseResetPassword { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,31 +1,32 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationConnections;
|
||||
|
||||
public class OrganizationConnectionData<T> where T : new()
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationConnections
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public OrganizationConnectionType Type { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public T Config { get; set; }
|
||||
|
||||
public OrganizationConnection ToEntity()
|
||||
public class OrganizationConnectionData<T> where T : new()
|
||||
{
|
||||
var result = new OrganizationConnection()
|
||||
{
|
||||
Type = Type,
|
||||
OrganizationId = OrganizationId,
|
||||
Enabled = Enabled,
|
||||
};
|
||||
result.SetConfig(Config);
|
||||
public Guid? Id { get; set; }
|
||||
public OrganizationConnectionType Type { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public T Config { get; set; }
|
||||
|
||||
if (Id.HasValue)
|
||||
public OrganizationConnection ToEntity()
|
||||
{
|
||||
result.Id = Id.Value;
|
||||
var result = new OrganizationConnection()
|
||||
{
|
||||
Type = Type,
|
||||
OrganizationId = OrganizationId,
|
||||
Enabled = Enabled,
|
||||
};
|
||||
result.SetConfig(Config);
|
||||
|
||||
if (Id.HasValue)
|
||||
{
|
||||
result.Id = Id.Value;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +1,31 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationSponsorships;
|
||||
|
||||
public class OrganizationSponsorshipData
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationSponsorships
|
||||
{
|
||||
public OrganizationSponsorshipData() { }
|
||||
public OrganizationSponsorshipData(OrganizationSponsorship sponsorship)
|
||||
public class OrganizationSponsorshipData
|
||||
{
|
||||
SponsoringOrganizationUserId = sponsorship.SponsoringOrganizationUserId;
|
||||
SponsoredOrganizationId = sponsorship.SponsoredOrganizationId;
|
||||
FriendlyName = sponsorship.FriendlyName;
|
||||
OfferedToEmail = sponsorship.OfferedToEmail;
|
||||
PlanSponsorshipType = sponsorship.PlanSponsorshipType.GetValueOrDefault();
|
||||
LastSyncDate = sponsorship.LastSyncDate;
|
||||
ValidUntil = sponsorship.ValidUntil;
|
||||
ToDelete = sponsorship.ToDelete;
|
||||
}
|
||||
public Guid SponsoringOrganizationUserId { get; set; }
|
||||
public Guid? SponsoredOrganizationId { get; set; }
|
||||
public string FriendlyName { get; set; }
|
||||
public string OfferedToEmail { get; set; }
|
||||
public PlanSponsorshipType PlanSponsorshipType { get; set; }
|
||||
public DateTime? LastSyncDate { get; set; }
|
||||
public DateTime? ValidUntil { get; set; }
|
||||
public bool ToDelete { get; set; }
|
||||
public OrganizationSponsorshipData() { }
|
||||
public OrganizationSponsorshipData(OrganizationSponsorship sponsorship)
|
||||
{
|
||||
SponsoringOrganizationUserId = sponsorship.SponsoringOrganizationUserId;
|
||||
SponsoredOrganizationId = sponsorship.SponsoredOrganizationId;
|
||||
FriendlyName = sponsorship.FriendlyName;
|
||||
OfferedToEmail = sponsorship.OfferedToEmail;
|
||||
PlanSponsorshipType = sponsorship.PlanSponsorshipType.GetValueOrDefault();
|
||||
LastSyncDate = sponsorship.LastSyncDate;
|
||||
ValidUntil = sponsorship.ValidUntil;
|
||||
ToDelete = sponsorship.ToDelete;
|
||||
}
|
||||
public Guid SponsoringOrganizationUserId { get; set; }
|
||||
public Guid? SponsoredOrganizationId { get; set; }
|
||||
public string FriendlyName { get; set; }
|
||||
public string OfferedToEmail { get; set; }
|
||||
public PlanSponsorshipType PlanSponsorshipType { get; set; }
|
||||
public DateTime? LastSyncDate { get; set; }
|
||||
public DateTime? ValidUntil { get; set; }
|
||||
public bool ToDelete { get; set; }
|
||||
|
||||
public bool CloudSponsorshipRemoved { get; set; }
|
||||
public bool CloudSponsorshipRemoved { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationSponsorships;
|
||||
|
||||
public class OrganizationSponsorshipSyncData
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationSponsorships
|
||||
{
|
||||
public string BillingSyncKey { get; set; }
|
||||
public Guid SponsoringOrganizationCloudId { get; set; }
|
||||
public IEnumerable<OrganizationSponsorshipData> SponsorshipsBatch { get; set; }
|
||||
public class OrganizationSponsorshipSyncData
|
||||
{
|
||||
public string BillingSyncKey { get; set; }
|
||||
public Guid SponsoringOrganizationCloudId { get; set; }
|
||||
public IEnumerable<OrganizationSponsorshipData> SponsorshipsBatch { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,13 @@
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
public class OrganizationUserInviteData
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers
|
||||
{
|
||||
public IEnumerable<string> Emails { get; set; }
|
||||
public OrganizationUserType? Type { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public IEnumerable<SelectionReadOnly> Collections { get; set; }
|
||||
public Permissions Permissions { get; set; }
|
||||
public class OrganizationUserInviteData
|
||||
{
|
||||
public IEnumerable<string> Emails { get; set; }
|
||||
public OrganizationUserType? Type { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public IEnumerable<SelectionReadOnly> Collections { get; set; }
|
||||
public Permissions Permissions { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,42 +1,43 @@
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
public class OrganizationUserOrganizationDetails
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers
|
||||
{
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool UsePolicies { get; set; }
|
||||
public bool UseSso { get; set; }
|
||||
public bool UseKeyConnector { get; set; }
|
||||
public bool UseScim { get; set; }
|
||||
public bool UseGroups { get; set; }
|
||||
public bool UseDirectory { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool UseTotp { get; set; }
|
||||
public bool Use2fa { get; set; }
|
||||
public bool UseApi { get; set; }
|
||||
public bool UseResetPassword { get; set; }
|
||||
public bool SelfHost { get; set; }
|
||||
public bool UsersGetPremium { get; set; }
|
||||
public int? Seats { get; set; }
|
||||
public short? MaxCollections { get; set; }
|
||||
public short? MaxStorageGb { get; set; }
|
||||
public string Key { get; set; }
|
||||
public Enums.OrganizationUserStatusType Status { get; set; }
|
||||
public Enums.OrganizationUserType Type { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public Enums.PlanType PlanType { get; set; }
|
||||
public string SsoExternalId { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public string ResetPasswordKey { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public string ProviderName { get; set; }
|
||||
public string FamilySponsorshipFriendlyName { get; set; }
|
||||
public string SsoConfig { get; set; }
|
||||
public DateTime? FamilySponsorshipLastSyncDate { get; set; }
|
||||
public DateTime? FamilySponsorshipValidUntil { get; set; }
|
||||
public bool? FamilySponsorshipToDelete { get; set; }
|
||||
public class OrganizationUserOrganizationDetails
|
||||
{
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool UsePolicies { get; set; }
|
||||
public bool UseSso { get; set; }
|
||||
public bool UseKeyConnector { get; set; }
|
||||
public bool UseScim { get; set; }
|
||||
public bool UseGroups { get; set; }
|
||||
public bool UseDirectory { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool UseTotp { get; set; }
|
||||
public bool Use2fa { get; set; }
|
||||
public bool UseApi { get; set; }
|
||||
public bool UseResetPassword { get; set; }
|
||||
public bool SelfHost { get; set; }
|
||||
public bool UsersGetPremium { get; set; }
|
||||
public int? Seats { get; set; }
|
||||
public short? MaxCollections { get; set; }
|
||||
public short? MaxStorageGb { get; set; }
|
||||
public string Key { get; set; }
|
||||
public Enums.OrganizationUserStatusType Status { get; set; }
|
||||
public Enums.OrganizationUserType Type { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public Enums.PlanType PlanType { get; set; }
|
||||
public string SsoExternalId { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public string ResetPasswordKey { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public string ProviderName { get; set; }
|
||||
public string FamilySponsorshipFriendlyName { get; set; }
|
||||
public string SsoConfig { get; set; }
|
||||
public DateTime? FamilySponsorshipLastSyncDate { get; set; }
|
||||
public DateTime? FamilySponsorshipValidUntil { get; set; }
|
||||
public bool? FamilySponsorshipToDelete { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
public class OrganizationUserPublicKey
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public class OrganizationUserPublicKey
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,35 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
public class OrganizationUserResetPasswordDetails
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers
|
||||
{
|
||||
public OrganizationUserResetPasswordDetails(OrganizationUser orgUser, User user, Organization org)
|
||||
public class OrganizationUserResetPasswordDetails
|
||||
{
|
||||
if (orgUser == null)
|
||||
public OrganizationUserResetPasswordDetails(OrganizationUser orgUser, User user, Organization org)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(orgUser));
|
||||
}
|
||||
if (orgUser == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(orgUser));
|
||||
}
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(org));
|
||||
}
|
||||
if (org == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(org));
|
||||
}
|
||||
|
||||
Kdf = user.Kdf;
|
||||
KdfIterations = user.KdfIterations;
|
||||
ResetPasswordKey = orgUser.ResetPasswordKey;
|
||||
EncryptedPrivateKey = org.PrivateKey;
|
||||
Kdf = user.Kdf;
|
||||
KdfIterations = user.KdfIterations;
|
||||
ResetPasswordKey = orgUser.ResetPasswordKey;
|
||||
EncryptedPrivateKey = org.PrivateKey;
|
||||
}
|
||||
public KdfType Kdf { get; set; }
|
||||
public int KdfIterations { get; set; }
|
||||
public string ResetPasswordKey { get; set; }
|
||||
public string EncryptedPrivateKey { get; set; }
|
||||
}
|
||||
public KdfType Kdf { get; set; }
|
||||
public int KdfIterations { get; set; }
|
||||
public string ResetPasswordKey { get; set; }
|
||||
public string EncryptedPrivateKey { get; set; }
|
||||
}
|
||||
|
@ -1,59 +1,60 @@
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
public class OrganizationUserUserDetails : IExternal, ITwoFactorProvidersUser
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers
|
||||
{
|
||||
private Dictionary<TwoFactorProviderType, TwoFactorProvider> _twoFactorProviders;
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string TwoFactorProviders { get; set; }
|
||||
public bool? Premium { get; set; }
|
||||
public OrganizationUserStatusType Status { get; set; }
|
||||
public OrganizationUserType Type { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public string ExternalId { get; set; }
|
||||
public string SsoExternalId { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public string ResetPasswordKey { get; set; }
|
||||
public bool UsesKeyConnector { get; set; }
|
||||
|
||||
public Dictionary<TwoFactorProviderType, TwoFactorProvider> GetTwoFactorProviders()
|
||||
public class OrganizationUserUserDetails : IExternal, ITwoFactorProvidersUser
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(TwoFactorProviders))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
private Dictionary<TwoFactorProviderType, TwoFactorProvider> _twoFactorProviders;
|
||||
|
||||
try
|
||||
public Guid Id { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string TwoFactorProviders { get; set; }
|
||||
public bool? Premium { get; set; }
|
||||
public OrganizationUserStatusType Status { get; set; }
|
||||
public OrganizationUserType Type { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public string ExternalId { get; set; }
|
||||
public string SsoExternalId { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public string ResetPasswordKey { get; set; }
|
||||
public bool UsesKeyConnector { get; set; }
|
||||
|
||||
public Dictionary<TwoFactorProviderType, TwoFactorProvider> GetTwoFactorProviders()
|
||||
{
|
||||
if (_twoFactorProviders == null)
|
||||
if (string.IsNullOrWhiteSpace(TwoFactorProviders))
|
||||
{
|
||||
_twoFactorProviders =
|
||||
JsonHelpers.LegacyDeserialize<Dictionary<TwoFactorProviderType, TwoFactorProvider>>(
|
||||
TwoFactorProviders);
|
||||
return null;
|
||||
}
|
||||
|
||||
return _twoFactorProviders;
|
||||
try
|
||||
{
|
||||
if (_twoFactorProviders == null)
|
||||
{
|
||||
_twoFactorProviders =
|
||||
JsonHelpers.LegacyDeserialize<Dictionary<TwoFactorProviderType, TwoFactorProvider>>(
|
||||
TwoFactorProviders);
|
||||
}
|
||||
|
||||
return _twoFactorProviders;
|
||||
}
|
||||
catch (Newtonsoft.Json.JsonException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (Newtonsoft.Json.JsonException)
|
||||
|
||||
public Guid? GetUserId()
|
||||
{
|
||||
return null;
|
||||
return UserId;
|
||||
}
|
||||
}
|
||||
|
||||
public Guid? GetUserId()
|
||||
{
|
||||
return UserId;
|
||||
}
|
||||
|
||||
public bool GetPremium()
|
||||
{
|
||||
return Premium.GetValueOrDefault(false);
|
||||
public bool GetPremium()
|
||||
{
|
||||
return Premium.GetValueOrDefault(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
using System.Data;
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
public class OrganizationUserWithCollections : OrganizationUser
|
||||
namespace Bit.Core.Models.Data.Organizations.OrganizationUsers
|
||||
{
|
||||
public DataTable Collections { get; set; }
|
||||
public class OrganizationUserWithCollections : OrganizationUser
|
||||
{
|
||||
public DataTable Collections { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
namespace Bit.Core.Models.Data.Organizations.Policies;
|
||||
|
||||
public interface IPolicyDataModel
|
||||
namespace Bit.Core.Models.Data.Organizations.Policies
|
||||
{
|
||||
public interface IPolicyDataModel
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.Policies;
|
||||
|
||||
public class ResetPasswordDataModel : IPolicyDataModel
|
||||
namespace Bit.Core.Models.Data.Organizations.Policies
|
||||
{
|
||||
[Display(Name = "ResetPasswordAutoEnrollCheckbox")]
|
||||
public bool AutoEnrollEnabled { get; set; }
|
||||
public class ResetPasswordDataModel : IPolicyDataModel
|
||||
{
|
||||
[Display(Name = "ResetPasswordAutoEnrollCheckbox")]
|
||||
public bool AutoEnrollEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Core.Models.Data.Organizations.Policies;
|
||||
|
||||
public class SendOptionsPolicyData : IPolicyDataModel
|
||||
namespace Bit.Core.Models.Data.Organizations.Policies
|
||||
{
|
||||
[Display(Name = "DisableHideEmail")]
|
||||
public bool DisableHideEmail { get; set; }
|
||||
public class SendOptionsPolicyData : IPolicyDataModel
|
||||
{
|
||||
[Display(Name = "DisableHideEmail")]
|
||||
public bool DisableHideEmail { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class PageOptions
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public string ContinuationToken { get; set; }
|
||||
public int PageSize { get; set; } = 50;
|
||||
public class PageOptions
|
||||
{
|
||||
public string ContinuationToken { get; set; }
|
||||
public int PageSize { get; set; } = 50;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class PagedResult<T>
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public List<T> Data { get; set; } = new List<T>();
|
||||
public string ContinuationToken { get; set; }
|
||||
public class PagedResult<T>
|
||||
{
|
||||
public List<T> Data { get; set; } = new List<T>();
|
||||
public string ContinuationToken { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,44 +1,45 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class Permissions
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public bool AccessEventLogs { get; set; }
|
||||
public bool AccessImportExport { get; set; }
|
||||
public bool AccessReports { get; set; }
|
||||
[Obsolete("This permission exists for client backwards-compatibility. It should not be used to determine permissions in this repository", true)]
|
||||
public bool ManageAllCollections => CreateNewCollections && EditAnyCollection && DeleteAnyCollection;
|
||||
public bool CreateNewCollections { get; set; }
|
||||
public bool EditAnyCollection { get; set; }
|
||||
public bool DeleteAnyCollection { get; set; }
|
||||
[Obsolete("This permission exists for client backwards-compatibility. It should not be used to determine permissions in this repository", true)]
|
||||
public bool ManageAssignedCollections => EditAssignedCollections && DeleteAssignedCollections;
|
||||
public bool EditAssignedCollections { get; set; }
|
||||
public bool DeleteAssignedCollections { get; set; }
|
||||
public bool ManageGroups { get; set; }
|
||||
public bool ManagePolicies { get; set; }
|
||||
public bool ManageSso { get; set; }
|
||||
public bool ManageUsers { get; set; }
|
||||
public bool ManageResetPassword { get; set; }
|
||||
public bool ManageScim { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<(bool Permission, string ClaimName)> ClaimsMap => new()
|
||||
public class Permissions
|
||||
{
|
||||
(AccessEventLogs, "accesseventlogs"),
|
||||
(AccessImportExport, "accessimportexport"),
|
||||
(AccessReports, "accessreports"),
|
||||
(CreateNewCollections, "createnewcollections"),
|
||||
(EditAnyCollection, "editanycollection"),
|
||||
(DeleteAnyCollection, "deleteanycollection"),
|
||||
(EditAssignedCollections, "editassignedcollections"),
|
||||
(DeleteAssignedCollections, "deleteassignedcollections"),
|
||||
(ManageGroups, "managegroups"),
|
||||
(ManagePolicies, "managepolicies"),
|
||||
(ManageSso, "managesso"),
|
||||
(ManageUsers, "manageusers"),
|
||||
(ManageResetPassword, "manageresetpassword"),
|
||||
(ManageScim, "managescim"),
|
||||
};
|
||||
public bool AccessEventLogs { get; set; }
|
||||
public bool AccessImportExport { get; set; }
|
||||
public bool AccessReports { get; set; }
|
||||
[Obsolete("This permission exists for client backwards-compatibility. It should not be used to determine permissions in this repository", true)]
|
||||
public bool ManageAllCollections => CreateNewCollections && EditAnyCollection && DeleteAnyCollection;
|
||||
public bool CreateNewCollections { get; set; }
|
||||
public bool EditAnyCollection { get; set; }
|
||||
public bool DeleteAnyCollection { get; set; }
|
||||
[Obsolete("This permission exists for client backwards-compatibility. It should not be used to determine permissions in this repository", true)]
|
||||
public bool ManageAssignedCollections => EditAssignedCollections && DeleteAssignedCollections;
|
||||
public bool EditAssignedCollections { get; set; }
|
||||
public bool DeleteAssignedCollections { get; set; }
|
||||
public bool ManageGroups { get; set; }
|
||||
public bool ManagePolicies { get; set; }
|
||||
public bool ManageSso { get; set; }
|
||||
public bool ManageUsers { get; set; }
|
||||
public bool ManageResetPassword { get; set; }
|
||||
public bool ManageScim { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<(bool Permission, string ClaimName)> ClaimsMap => new()
|
||||
{
|
||||
(AccessEventLogs, "accesseventlogs"),
|
||||
(AccessImportExport, "accessimportexport"),
|
||||
(AccessReports, "accessreports"),
|
||||
(CreateNewCollections, "createnewcollections"),
|
||||
(EditAnyCollection, "editanycollection"),
|
||||
(DeleteAnyCollection, "deleteanycollection"),
|
||||
(EditAssignedCollections, "editassignedcollections"),
|
||||
(DeleteAssignedCollections, "deleteassignedcollections"),
|
||||
(ManageGroups, "managegroups"),
|
||||
(ManagePolicies, "managepolicies"),
|
||||
(ManageSso, "managesso"),
|
||||
(ManageUsers, "manageusers"),
|
||||
(ManageResetPassword, "manageresetpassword"),
|
||||
(ManageScim, "managescim"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,20 @@
|
||||
using Bit.Core.Entities.Provider;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class ProviderAbility
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public ProviderAbility() { }
|
||||
|
||||
public ProviderAbility(Provider provider)
|
||||
public class ProviderAbility
|
||||
{
|
||||
Id = provider.Id;
|
||||
UseEvents = provider.UseEvents;
|
||||
Enabled = provider.Enabled;
|
||||
}
|
||||
public ProviderAbility() { }
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public ProviderAbility(Provider provider)
|
||||
{
|
||||
Id = provider.Id;
|
||||
UseEvents = provider.UseEvents;
|
||||
Enabled = provider.Enabled;
|
||||
}
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,17 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class ProviderOrganizationOrganizationDetails
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProviderId { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public string OrganizationName { get; set; }
|
||||
public string Key { get; set; }
|
||||
public string Settings { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public DateTime RevisionDate { get; set; }
|
||||
public int UserCount { get; set; }
|
||||
public int? Seats { get; set; }
|
||||
public string Plan { get; set; }
|
||||
public class ProviderOrganizationOrganizationDetails
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProviderId { get; set; }
|
||||
public Guid OrganizationId { get; set; }
|
||||
public string OrganizationName { get; set; }
|
||||
public string Key { get; set; }
|
||||
public string Settings { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public DateTime RevisionDate { get; set; }
|
||||
public int UserCount { get; set; }
|
||||
public int? Seats { get; set; }
|
||||
public string Plan { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +1,37 @@
|
||||
using Bit.Core.Enums.Provider;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class ProviderUserOrganizationDetails
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool UsePolicies { get; set; }
|
||||
public bool UseSso { get; set; }
|
||||
public bool UseKeyConnector { get; set; }
|
||||
public bool UseScim { get; set; }
|
||||
public bool UseGroups { get; set; }
|
||||
public bool UseDirectory { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool UseTotp { get; set; }
|
||||
public bool Use2fa { get; set; }
|
||||
public bool UseApi { get; set; }
|
||||
public bool UseResetPassword { get; set; }
|
||||
public bool SelfHost { get; set; }
|
||||
public bool UsersGetPremium { get; set; }
|
||||
public int? Seats { get; set; }
|
||||
public short? MaxCollections { get; set; }
|
||||
public short? MaxStorageGb { get; set; }
|
||||
public string Key { get; set; }
|
||||
public ProviderUserStatusType Status { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public Guid? ProviderUserId { get; set; }
|
||||
public string ProviderName { get; set; }
|
||||
public class ProviderUserOrganizationDetails
|
||||
{
|
||||
public Guid OrganizationId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool UsePolicies { get; set; }
|
||||
public bool UseSso { get; set; }
|
||||
public bool UseKeyConnector { get; set; }
|
||||
public bool UseScim { get; set; }
|
||||
public bool UseGroups { get; set; }
|
||||
public bool UseDirectory { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public bool UseTotp { get; set; }
|
||||
public bool Use2fa { get; set; }
|
||||
public bool UseApi { get; set; }
|
||||
public bool UseResetPassword { get; set; }
|
||||
public bool SelfHost { get; set; }
|
||||
public bool UsersGetPremium { get; set; }
|
||||
public int? Seats { get; set; }
|
||||
public short? MaxCollections { get; set; }
|
||||
public short? MaxStorageGb { get; set; }
|
||||
public string Key { get; set; }
|
||||
public ProviderUserStatusType Status { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public string PrivateKey { get; set; }
|
||||
public Guid? ProviderId { get; set; }
|
||||
public Guid? ProviderUserId { get; set; }
|
||||
public string ProviderName { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,18 @@
|
||||
using Bit.Core.Enums.Provider;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class ProviderUserProviderDetails
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid ProviderId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Key { get; set; }
|
||||
public ProviderUserStatusType Status { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public ProviderStatusType ProviderStatus { get; set; }
|
||||
public class ProviderUserProviderDetails
|
||||
{
|
||||
public Guid ProviderId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Key { get; set; }
|
||||
public ProviderUserStatusType Status { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public bool UseEvents { get; set; }
|
||||
public ProviderStatusType ProviderStatus { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class ProviderUserPublicKey
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
public class ProviderUserPublicKey
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string PublicKey { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
using Bit.Core.Enums.Provider;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class ProviderUserUserDetails
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProviderId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public ProviderUserStatusType Status { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
public class ProviderUserUserDetails
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProviderId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public ProviderUserStatusType Status { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
public string Permissions { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class SelectionReadOnly
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
public class SelectionReadOnly
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public abstract class SendData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public SendData() { }
|
||||
|
||||
public SendData(string name, string notes)
|
||||
public abstract class SendData
|
||||
{
|
||||
Name = name;
|
||||
Notes = notes;
|
||||
}
|
||||
public SendData() { }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public SendData(string name, string notes)
|
||||
{
|
||||
Name = name;
|
||||
Notes = notes;
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Notes { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,23 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class SendFileData : SendData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public SendFileData() { }
|
||||
|
||||
public SendFileData(string name, string notes, string fileName)
|
||||
: base(name, notes)
|
||||
public class SendFileData : SendData
|
||||
{
|
||||
FileName = fileName;
|
||||
public SendFileData() { }
|
||||
|
||||
public SendFileData(string name, string notes, string fileName)
|
||||
: base(name, notes)
|
||||
{
|
||||
FileName = fileName;
|
||||
}
|
||||
|
||||
// We serialize Size as a string since JSON (or Javascript) doesn't support full precision for long numbers
|
||||
[JsonNumberHandling(JsonNumberHandling.WriteAsString | JsonNumberHandling.AllowReadingFromString)]
|
||||
public long Size { get; set; }
|
||||
|
||||
public string Id { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public bool Validated { get; set; } = true;
|
||||
}
|
||||
|
||||
// We serialize Size as a string since JSON (or Javascript) doesn't support full precision for long numbers
|
||||
[JsonNumberHandling(JsonNumberHandling.WriteAsString | JsonNumberHandling.AllowReadingFromString)]
|
||||
public long Size { get; set; }
|
||||
|
||||
public string Id { get; set; }
|
||||
public string FileName { get; set; }
|
||||
public bool Validated { get; set; } = true;
|
||||
}
|
||||
|
@ -1,16 +1,17 @@
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class SendTextData : SendData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public SendTextData() { }
|
||||
|
||||
public SendTextData(string name, string notes, string text, bool hidden)
|
||||
: base(name, notes)
|
||||
public class SendTextData : SendData
|
||||
{
|
||||
Text = text;
|
||||
Hidden = hidden;
|
||||
}
|
||||
public SendTextData() { }
|
||||
|
||||
public string Text { get; set; }
|
||||
public bool Hidden { get; set; }
|
||||
public SendTextData(string name, string notes, string text, bool hidden)
|
||||
: base(name, notes)
|
||||
{
|
||||
Text = text;
|
||||
Hidden = hidden;
|
||||
}
|
||||
|
||||
public string Text { get; set; }
|
||||
public bool Hidden { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -2,124 +2,125 @@
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class SsoConfigurationData
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
private static string _oidcSigninPath = "/oidc-signin";
|
||||
private static string _oidcSignedOutPath = "/oidc-signedout";
|
||||
private static string _saml2ModulePath = "/saml2";
|
||||
|
||||
public static SsoConfigurationData Deserialize(string data)
|
||||
public class SsoConfigurationData
|
||||
{
|
||||
return CoreHelpers.LoadClassFromJsonData<SsoConfigurationData>(data);
|
||||
}
|
||||
private static string _oidcSigninPath = "/oidc-signin";
|
||||
private static string _oidcSignedOutPath = "/oidc-signedout";
|
||||
private static string _saml2ModulePath = "/saml2";
|
||||
|
||||
public string Serialize()
|
||||
{
|
||||
return CoreHelpers.ClassToJsonData(this);
|
||||
}
|
||||
|
||||
public SsoType ConfigType { get; set; }
|
||||
|
||||
public bool KeyConnectorEnabled { get; set; }
|
||||
public string KeyConnectorUrl { get; set; }
|
||||
|
||||
// OIDC
|
||||
public string Authority { get; set; }
|
||||
public string ClientId { get; set; }
|
||||
public string ClientSecret { get; set; }
|
||||
public string MetadataAddress { get; set; }
|
||||
public OpenIdConnectRedirectBehavior RedirectBehavior { get; set; }
|
||||
public bool GetClaimsFromUserInfoEndpoint { get; set; }
|
||||
public string AdditionalScopes { get; set; }
|
||||
public string AdditionalUserIdClaimTypes { get; set; }
|
||||
public string AdditionalEmailClaimTypes { get; set; }
|
||||
public string AdditionalNameClaimTypes { get; set; }
|
||||
public string AcrValues { get; set; }
|
||||
public string ExpectedReturnAcrValue { get; set; }
|
||||
|
||||
// SAML2 IDP
|
||||
public string IdpEntityId { get; set; }
|
||||
public string IdpSingleSignOnServiceUrl { get; set; }
|
||||
public string IdpSingleLogoutServiceUrl { get; set; }
|
||||
public string IdpX509PublicCert { get; set; }
|
||||
public Saml2BindingType IdpBindingType { get; set; }
|
||||
public bool IdpAllowUnsolicitedAuthnResponse { get; set; }
|
||||
public string IdpArtifactResolutionServiceUrl { get => null; set { /*IGNORE*/ } }
|
||||
public bool IdpDisableOutboundLogoutRequests { get; set; }
|
||||
public string IdpOutboundSigningAlgorithm { get; set; }
|
||||
public bool IdpWantAuthnRequestsSigned { get; set; }
|
||||
|
||||
// SAML2 SP
|
||||
public Saml2NameIdFormat SpNameIdFormat { get; set; }
|
||||
public string SpOutboundSigningAlgorithm { get; set; }
|
||||
public Saml2SigningBehavior SpSigningBehavior { get; set; }
|
||||
public bool SpWantAssertionsSigned { get; set; }
|
||||
public bool SpValidateCertificates { get; set; }
|
||||
public string SpMinIncomingSigningAlgorithm { get; set; }
|
||||
|
||||
public static string BuildCallbackPath(string ssoUri = null)
|
||||
{
|
||||
return BuildSsoUrl(_oidcSigninPath, ssoUri);
|
||||
}
|
||||
|
||||
public static string BuildSignedOutCallbackPath(string ssoUri = null)
|
||||
{
|
||||
return BuildSsoUrl(_oidcSignedOutPath, ssoUri);
|
||||
}
|
||||
|
||||
public static string BuildSaml2ModulePath(string ssoUri = null, string scheme = null)
|
||||
{
|
||||
return string.Concat(BuildSsoUrl(_saml2ModulePath, ssoUri),
|
||||
string.IsNullOrWhiteSpace(scheme) ? string.Empty : $"/{scheme}");
|
||||
}
|
||||
|
||||
public static string BuildSaml2AcsUrl(string ssoUri = null, string scheme = null)
|
||||
{
|
||||
return string.Concat(BuildSaml2ModulePath(ssoUri, scheme), "/Acs");
|
||||
}
|
||||
|
||||
public static string BuildSaml2MetadataUrl(string ssoUri = null, string scheme = null)
|
||||
{
|
||||
return BuildSaml2ModulePath(ssoUri, scheme);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAdditionalScopes() => AdditionalScopes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
public IEnumerable<string> GetAdditionalUserIdClaimTypes() => AdditionalUserIdClaimTypes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
public IEnumerable<string> GetAdditionalEmailClaimTypes() => AdditionalEmailClaimTypes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
public IEnumerable<string> GetAdditionalNameClaimTypes() => AdditionalNameClaimTypes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
private static string BuildSsoUrl(string relativePath, string ssoUri)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ssoUri) ||
|
||||
!Uri.IsWellFormedUriString(ssoUri, UriKind.Absolute))
|
||||
public static SsoConfigurationData Deserialize(string data)
|
||||
{
|
||||
return CoreHelpers.LoadClassFromJsonData<SsoConfigurationData>(data);
|
||||
}
|
||||
|
||||
public string Serialize()
|
||||
{
|
||||
return CoreHelpers.ClassToJsonData(this);
|
||||
}
|
||||
|
||||
public SsoType ConfigType { get; set; }
|
||||
|
||||
public bool KeyConnectorEnabled { get; set; }
|
||||
public string KeyConnectorUrl { get; set; }
|
||||
|
||||
// OIDC
|
||||
public string Authority { get; set; }
|
||||
public string ClientId { get; set; }
|
||||
public string ClientSecret { get; set; }
|
||||
public string MetadataAddress { get; set; }
|
||||
public OpenIdConnectRedirectBehavior RedirectBehavior { get; set; }
|
||||
public bool GetClaimsFromUserInfoEndpoint { get; set; }
|
||||
public string AdditionalScopes { get; set; }
|
||||
public string AdditionalUserIdClaimTypes { get; set; }
|
||||
public string AdditionalEmailClaimTypes { get; set; }
|
||||
public string AdditionalNameClaimTypes { get; set; }
|
||||
public string AcrValues { get; set; }
|
||||
public string ExpectedReturnAcrValue { get; set; }
|
||||
|
||||
// SAML2 IDP
|
||||
public string IdpEntityId { get; set; }
|
||||
public string IdpSingleSignOnServiceUrl { get; set; }
|
||||
public string IdpSingleLogoutServiceUrl { get; set; }
|
||||
public string IdpX509PublicCert { get; set; }
|
||||
public Saml2BindingType IdpBindingType { get; set; }
|
||||
public bool IdpAllowUnsolicitedAuthnResponse { get; set; }
|
||||
public string IdpArtifactResolutionServiceUrl { get => null; set { /*IGNORE*/ } }
|
||||
public bool IdpDisableOutboundLogoutRequests { get; set; }
|
||||
public string IdpOutboundSigningAlgorithm { get; set; }
|
||||
public bool IdpWantAuthnRequestsSigned { get; set; }
|
||||
|
||||
// SAML2 SP
|
||||
public Saml2NameIdFormat SpNameIdFormat { get; set; }
|
||||
public string SpOutboundSigningAlgorithm { get; set; }
|
||||
public Saml2SigningBehavior SpSigningBehavior { get; set; }
|
||||
public bool SpWantAssertionsSigned { get; set; }
|
||||
public bool SpValidateCertificates { get; set; }
|
||||
public string SpMinIncomingSigningAlgorithm { get; set; }
|
||||
|
||||
public static string BuildCallbackPath(string ssoUri = null)
|
||||
{
|
||||
return BuildSsoUrl(_oidcSigninPath, ssoUri);
|
||||
}
|
||||
|
||||
public static string BuildSignedOutCallbackPath(string ssoUri = null)
|
||||
{
|
||||
return BuildSsoUrl(_oidcSignedOutPath, ssoUri);
|
||||
}
|
||||
|
||||
public static string BuildSaml2ModulePath(string ssoUri = null, string scheme = null)
|
||||
{
|
||||
return string.Concat(BuildSsoUrl(_saml2ModulePath, ssoUri),
|
||||
string.IsNullOrWhiteSpace(scheme) ? string.Empty : $"/{scheme}");
|
||||
}
|
||||
|
||||
public static string BuildSaml2AcsUrl(string ssoUri = null, string scheme = null)
|
||||
{
|
||||
return string.Concat(BuildSaml2ModulePath(ssoUri, scheme), "/Acs");
|
||||
}
|
||||
|
||||
public static string BuildSaml2MetadataUrl(string ssoUri = null, string scheme = null)
|
||||
{
|
||||
return BuildSaml2ModulePath(ssoUri, scheme);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAdditionalScopes() => AdditionalScopes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
public IEnumerable<string> GetAdditionalUserIdClaimTypes() => AdditionalUserIdClaimTypes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
public IEnumerable<string> GetAdditionalEmailClaimTypes() => AdditionalEmailClaimTypes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
public IEnumerable<string> GetAdditionalNameClaimTypes() => AdditionalNameClaimTypes?
|
||||
.Split(',')?
|
||||
.Where(c => !string.IsNullOrWhiteSpace(c))?
|
||||
.Select(c => c.Trim()) ??
|
||||
Array.Empty<string>();
|
||||
|
||||
private static string BuildSsoUrl(string relativePath, string ssoUri)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ssoUri) ||
|
||||
!Uri.IsWellFormedUriString(ssoUri, UriKind.Absolute))
|
||||
{
|
||||
return relativePath;
|
||||
}
|
||||
if (Uri.TryCreate(string.Concat(ssoUri.TrimEnd('/'), relativePath), UriKind.Absolute, out var newUri))
|
||||
{
|
||||
return newUri.ToString();
|
||||
}
|
||||
return relativePath;
|
||||
}
|
||||
if (Uri.TryCreate(string.Concat(ssoUri.TrimEnd('/'), relativePath), UriKind.Absolute, out var newUri))
|
||||
{
|
||||
return newUri.ToString();
|
||||
}
|
||||
return relativePath;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Data;
|
||||
|
||||
public class UserKdfInformation
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public KdfType Kdf { get; set; }
|
||||
public int KdfIterations { get; set; }
|
||||
public class UserKdfInformation
|
||||
{
|
||||
public KdfType Kdf { get; set; }
|
||||
public int KdfIterations { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user