2017-03-06 20:51:13 -05:00
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
|
using Bit.Core.Models.Data;
|
2021-01-12 11:02:39 -05:00
|
|
|
|
using Bit.Core.Utilities;
|
2021-07-15 16:37:27 +02:00
|
|
|
|
|
2017-03-08 21:55:08 -05:00
|
|
|
|
namespace Bit.Core.Models.Api
|
2017-03-06 20:51:13 -05:00
|
|
|
|
{
|
|
|
|
|
|
public class ProfileOrganizationResponseModel : ResponseModel
|
|
|
|
|
|
{
|
2021-07-15 16:37:27 +02:00
|
|
|
|
public ProfileOrganizationResponseModel(string str) : base(str) {}
|
|
|
|
|
|
|
|
|
|
|
|
public ProfileOrganizationResponseModel(OrganizationUserOrganizationDetails organization) : this("profileOrganization")
|
2017-03-06 20:51:13 -05:00
|
|
|
|
{
|
|
|
|
|
|
Id = organization.OrganizationId.ToString();
|
|
|
|
|
|
Name = organization.Name;
|
2020-01-15 15:17:32 -05:00
|
|
|
|
UsePolicies = organization.UsePolicies;
|
2020-07-22 09:38:39 -04:00
|
|
|
|
UseSso = organization.UseSso;
|
2017-05-08 14:22:40 -04:00
|
|
|
|
UseGroups = organization.UseGroups;
|
2017-05-20 15:31:16 -04:00
|
|
|
|
UseDirectory = organization.UseDirectory;
|
2017-12-14 15:48:44 -05:00
|
|
|
|
UseEvents = organization.UseEvents;
|
2017-07-07 14:08:30 -04:00
|
|
|
|
UseTotp = organization.UseTotp;
|
2018-04-02 17:15:20 -04:00
|
|
|
|
Use2fa = organization.Use2fa;
|
2019-03-02 15:09:33 -05:00
|
|
|
|
UseApi = organization.UseApi;
|
2021-05-06 14:53:12 -05:00
|
|
|
|
UseResetPassword = organization.UseResetPassword;
|
2018-07-24 11:04:20 -04:00
|
|
|
|
UsersGetPremium = organization.UsersGetPremium;
|
2019-03-01 09:33:23 -05:00
|
|
|
|
SelfHost = organization.SelfHost;
|
2017-05-08 14:22:40 -04:00
|
|
|
|
Seats = organization.Seats;
|
|
|
|
|
|
MaxCollections = organization.MaxCollections;
|
2017-07-07 14:08:30 -04:00
|
|
|
|
MaxStorageGb = organization.MaxStorageGb;
|
2017-03-06 20:51:13 -05:00
|
|
|
|
Key = organization.Key;
|
2021-05-06 14:53:12 -05:00
|
|
|
|
HasPublicAndPrivateKeys = organization.PublicKey != null && organization.PrivateKey != null;
|
2017-03-06 20:51:13 -05:00
|
|
|
|
Status = organization.Status;
|
2017-03-25 21:21:38 -04:00
|
|
|
|
Type = organization.Type;
|
2017-04-11 15:57:13 -04:00
|
|
|
|
Enabled = organization.Enabled;
|
2020-07-28 21:11:45 -04:00
|
|
|
|
SsoBound = !string.IsNullOrWhiteSpace(organization.SsoExternalId);
|
2020-08-26 14:12:04 -04:00
|
|
|
|
Identifier = organization.Identifier;
|
2021-01-12 11:02:39 -05:00
|
|
|
|
Permissions = CoreHelpers.LoadClassFromJsonData<Permissions>(organization.Permissions);
|
2021-04-20 16:58:57 -05:00
|
|
|
|
ResetPasswordEnrolled = organization.ResetPasswordKey != null;
|
2021-03-30 09:48:52 -05:00
|
|
|
|
UserId = organization.UserId?.ToString();
|
2021-06-30 09:35:26 +02:00
|
|
|
|
ProviderId = organization.ProviderId?.ToString();
|
|
|
|
|
|
ProviderName = organization.ProviderName;
|
2017-03-06 20:51:13 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
|
public string Name { get; set; }
|
2020-01-15 15:17:32 -05:00
|
|
|
|
public bool UsePolicies { get; set; }
|
2020-07-22 09:38:39 -04:00
|
|
|
|
public bool UseSso { get; set; }
|
2017-05-08 14:22:40 -04:00
|
|
|
|
public bool UseGroups { get; set; }
|
2017-05-20 15:31:16 -04:00
|
|
|
|
public bool UseDirectory { get; set; }
|
2017-12-14 15:48:44 -05:00
|
|
|
|
public bool UseEvents { get; set; }
|
2017-07-07 14:08:30 -04:00
|
|
|
|
public bool UseTotp { get; set; }
|
2018-04-02 17:15:20 -04:00
|
|
|
|
public bool Use2fa { get; set; }
|
2019-03-02 15:09:33 -05:00
|
|
|
|
public bool UseApi { get; set; }
|
2021-05-06 14:53:12 -05:00
|
|
|
|
public bool UseResetPassword { get; set; }
|
2018-07-24 11:04:20 -04:00
|
|
|
|
public bool UsersGetPremium { get; set; }
|
2019-03-01 09:33:23 -05:00
|
|
|
|
public bool SelfHost { get; set; }
|
Postgres & MySql Support For Self-Hosted Installations (#1386)
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 12:35:48 -04:00
|
|
|
|
public int? Seats { get; set; }
|
|
|
|
|
|
public short? MaxCollections { get; set; }
|
2017-07-07 14:08:30 -04:00
|
|
|
|
public short? MaxStorageGb { get; set; }
|
2017-03-06 20:51:13 -05:00
|
|
|
|
public string Key { get; set; }
|
|
|
|
|
|
public OrganizationUserStatusType Status { get; set; }
|
2017-03-25 16:34:30 -04:00
|
|
|
|
public OrganizationUserType Type { get; set; }
|
2017-04-11 15:57:13 -04:00
|
|
|
|
public bool Enabled { get; set; }
|
2020-07-28 21:11:45 -04:00
|
|
|
|
public bool SsoBound { get; set; }
|
2020-08-26 14:12:04 -04:00
|
|
|
|
public string Identifier { get; set; }
|
2021-01-12 11:02:39 -05:00
|
|
|
|
public Permissions Permissions { get; set; }
|
2021-04-20 16:58:57 -05:00
|
|
|
|
public bool ResetPasswordEnrolled { get; set; }
|
2021-03-30 09:48:52 -05:00
|
|
|
|
public string UserId { get; set; }
|
2021-05-06 14:53:12 -05:00
|
|
|
|
public bool HasPublicAndPrivateKeys { get; set; }
|
2021-06-30 09:35:26 +02:00
|
|
|
|
public string ProviderId { get; set; }
|
|
|
|
|
|
public string ProviderName { get; set; }
|
2017-03-06 20:51:13 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|