Skip to content

Commit 9b313d9

Browse files
authored
[PM-25923] Simplify and align response models for Organization members and Provider users (#6385)
* Update ProviderUserOrganizationDetailsView to include SSO configuration data * Updated the ProviderUserOrganizationDetailsViewQuery to join with SsoConfigs and select SSO-related fields. * Modified the SQL view to reflect the inclusion of SSO configuration data. * Added a new migration script for the updated view structure. * Add SSO configuration properties to ProviderUserOrganizationDetails model * Add SSO configuration handling to ProfileProviderOrganizationResponseModel * Introduced properties for SSO configuration, including SSO enabled status and KeyConnector details. * Implemented deserialization of SSO configuration data to populate new fields in the response model. * Add integration tests for ProviderUserRepository.GetManyOrganizationDetailsByUserAsync * Add BaseUserOrganizationDetails model to encapsulate common properties * Introduced a new abstract class to define shared properties for organization users and provider organization users * Add BaseProfileOrganizationResponseModel to encapsulate organization response properties * Introduced a new abstract class that ensures all properties are fully populated for profile organization responses. * Update ProviderUserOrganizationDetailsViewQuery to include missing ProviderUserId * Refactor OrganizationUserOrganizationDetails and ProviderUserOrganizationDetails to inherit from BaseUserOrganizationDetails * Updated both models to extend BaseUserOrganizationDetails, promoting code reuse and ensure they have the same base properties * Refactor ProfileOrganizationResponseModel and ProfileProviderOrganizationResponseModel to inherit from BaseProfileOrganizationResponseModel * Refactor ProviderUserRepositoryTests to improve organization detail assertions * Consolidated assertions for organization details into a new method, AssertProviderOrganizationDetails, enhancing code readability and maintainability. * Updated test cases to verify all relevant properties for organizations with and without SSO configurations. * Add integration test for GetManyDetailsByUserAsync to verify SSO properties * Implemented a new test case to ensure that the SSO properties are correctly populated for organizations with and without SSO configurations. * The test verifies the expected behavior of the method when interacting with the user and organization repositories, including cleanup of created entities after the test execution. * Add unit tests for ProfileOrganizationResponseModel and ProfileProviderOrganizationResponseModel * Introduced tests to validate the constructors of ProfileOrganizationResponseModel and ProfileProviderOrganizationResponseModel, ensuring that all properties are populated correctly based on the provided organization details. * Verified expected behavior for both organization and provider models, including SSO configurations and relevant properties. * Update SyncControllerTests.Get_ProviderPlanTypeProperlyPopulated to nullify SSO configurations in provider user organization details * Refactor BaseProfileOrganizationResponseModel and ProfileOrganizationResponseModel for null safety Updated properties in BaseProfileOrganizationResponseModel and ProfileOrganizationResponseModel to support null safety by introducing nullable types where appropriate. * Enhance null safety in BaseUserOrganizationDetails and OrganizationUserOrganizationDetails Updated properties in BaseUserOrganizationDetails and OrganizationUserOrganizationDetails to support null safety by introducing nullable types where appropriate, ensuring better handling of potential null values. * Move common properties from ProfileOrganizationResponseModel to BaseProfileOrganizationResponseModel * Refactor organization details: Remove BaseUserOrganizationDetails and introduce IProfileMemberOrganizationDetails interface for improved structure and clarity in organization user data management. * Enhance OrganizationUserOrganizationDetails: Implement IProfileMemberOrganizationDetails interface * Refactor ProviderUserOrganizationDetails: Implement IProfileMemberOrganizationDetails interface * Refactor ProfileOrganizationResponseModelTests and ProfileProviderOrganizationResponseModelTests: Update constructors to utilize Organization and ProviderUserOrganizationDetails, enhancing property population and test coverage. * Enhance ProviderUserOrganizationDetails: Add UseResetPassword, UseSecretsManager, and UsePasswordManager properties to the query and SQL views * Update BaseProfileOrganizationResponseModel documentation: Clarify purpose and usage of organization properties for OrganizationUsers and ProviderUsers. * Rename ProfileOrganizationResponseModel to ProfileMemberOrganizationResponseModel, update references and update related test names * Add XML documentation for ProfileMemberOrganizationResponseModel and ProfileProviderOrganizationResponseModel to clarify their purpose and relationships * Remove unnecessary cleanup code from OrganizationUserRepositoryTests * Remove unnecessary cleanup code from ProviderUserRepositoryTests * Rename test method in ProviderUserRepositoryTests to improve clarity on property population * Add CreateFullOrganization method to ProviderUserRepositoryTests for improved organization setup in tests * Refactor organization creation in tests to use CreateTestOrganizationAsync for consistency and improved setup * Rename IProfileMemberOrganizationDetails to IProfileOrganizationDetails * Rename ProfileMemberOrganizationResponseModel back to ProfileOrganizationResponseModel * Refactor organization response models to remove Family Sponsorship properties from BaseProfileOrganizationResponseModel and reintroduce them in ProfileOrganizationResponseModel. Update related interfaces and tests accordingly. * Bump date on migration script * Update OrganizationUserOrganizationDetailsViewQuery to include UseAutomaticUserConfirmation property
1 parent bd52cf5 commit 9b313d9

16 files changed

Lines changed: 881 additions & 231 deletions

File tree

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
using System.Text.Json.Serialization;
2+
using Bit.Core.AdminConsole.Enums.Provider;
3+
using Bit.Core.AdminConsole.Models.Data;
4+
using Bit.Core.Auth.Enums;
5+
using Bit.Core.Auth.Models.Data;
6+
using Bit.Core.Billing.Enums;
7+
using Bit.Core.Billing.Extensions;
8+
using Bit.Core.Enums;
9+
using Bit.Core.Models.Api;
10+
using Bit.Core.Models.Data;
11+
using Bit.Core.Utilities;
12+
13+
namespace Bit.Api.AdminConsole.Models.Response;
14+
15+
/// <summary>
16+
/// Contains organization properties for both OrganizationUsers and ProviderUsers.
17+
/// Any organization properties in sync data should be added to this class so they are populated for both
18+
/// members and providers.
19+
/// </summary>
20+
public abstract class BaseProfileOrganizationResponseModel : ResponseModel
21+
{
22+
protected BaseProfileOrganizationResponseModel(
23+
string type, IProfileOrganizationDetails organizationDetails) : base(type)
24+
{
25+
Id = organizationDetails.OrganizationId;
26+
UserId = organizationDetails.UserId;
27+
Name = organizationDetails.Name;
28+
Enabled = organizationDetails.Enabled;
29+
Identifier = organizationDetails.Identifier;
30+
ProductTierType = organizationDetails.PlanType.GetProductTier();
31+
UsePolicies = organizationDetails.UsePolicies;
32+
UseSso = organizationDetails.UseSso;
33+
UseKeyConnector = organizationDetails.UseKeyConnector;
34+
UseScim = organizationDetails.UseScim;
35+
UseGroups = organizationDetails.UseGroups;
36+
UseDirectory = organizationDetails.UseDirectory;
37+
UseEvents = organizationDetails.UseEvents;
38+
UseTotp = organizationDetails.UseTotp;
39+
Use2fa = organizationDetails.Use2fa;
40+
UseApi = organizationDetails.UseApi;
41+
UseResetPassword = organizationDetails.UseResetPassword;
42+
UsersGetPremium = organizationDetails.UsersGetPremium;
43+
UseCustomPermissions = organizationDetails.UseCustomPermissions;
44+
UseActivateAutofillPolicy = organizationDetails.PlanType.GetProductTier() == ProductTierType.Enterprise;
45+
UseRiskInsights = organizationDetails.UseRiskInsights;
46+
UseOrganizationDomains = organizationDetails.UseOrganizationDomains;
47+
UseAdminSponsoredFamilies = organizationDetails.UseAdminSponsoredFamilies;
48+
UseAutomaticUserConfirmation = organizationDetails.UseAutomaticUserConfirmation;
49+
UseSecretsManager = organizationDetails.UseSecretsManager;
50+
UsePasswordManager = organizationDetails.UsePasswordManager;
51+
SelfHost = organizationDetails.SelfHost;
52+
Seats = organizationDetails.Seats;
53+
MaxCollections = organizationDetails.MaxCollections;
54+
MaxStorageGb = organizationDetails.MaxStorageGb;
55+
Key = organizationDetails.Key;
56+
HasPublicAndPrivateKeys = organizationDetails.PublicKey != null && organizationDetails.PrivateKey != null;
57+
SsoBound = !string.IsNullOrWhiteSpace(organizationDetails.SsoExternalId);
58+
ResetPasswordEnrolled = !string.IsNullOrWhiteSpace(organizationDetails.ResetPasswordKey);
59+
ProviderId = organizationDetails.ProviderId;
60+
ProviderName = organizationDetails.ProviderName;
61+
ProviderType = organizationDetails.ProviderType;
62+
LimitCollectionCreation = organizationDetails.LimitCollectionCreation;
63+
LimitCollectionDeletion = organizationDetails.LimitCollectionDeletion;
64+
LimitItemDeletion = organizationDetails.LimitItemDeletion;
65+
AllowAdminAccessToAllCollectionItems = organizationDetails.AllowAdminAccessToAllCollectionItems;
66+
SsoEnabled = organizationDetails.SsoEnabled ?? false;
67+
if (organizationDetails.SsoConfig != null)
68+
{
69+
var ssoConfigData = SsoConfigurationData.Deserialize(organizationDetails.SsoConfig);
70+
KeyConnectorEnabled = ssoConfigData.MemberDecryptionType == MemberDecryptionType.KeyConnector && !string.IsNullOrEmpty(ssoConfigData.KeyConnectorUrl);
71+
KeyConnectorUrl = ssoConfigData.KeyConnectorUrl;
72+
SsoMemberDecryptionType = ssoConfigData.MemberDecryptionType;
73+
}
74+
}
75+
76+
public Guid Id { get; set; }
77+
[JsonConverter(typeof(HtmlEncodingStringConverter))]
78+
public string Name { get; set; } = null!;
79+
public bool Enabled { get; set; }
80+
public string? Identifier { get; set; }
81+
public ProductTierType ProductTierType { get; set; }
82+
public bool UsePolicies { get; set; }
83+
public bool UseSso { get; set; }
84+
public bool UseKeyConnector { get; set; }
85+
public bool UseScim { get; set; }
86+
public bool UseGroups { get; set; }
87+
public bool UseDirectory { get; set; }
88+
public bool UseEvents { get; set; }
89+
public bool UseTotp { get; set; }
90+
public bool Use2fa { get; set; }
91+
public bool UseApi { get; set; }
92+
public bool UseResetPassword { get; set; }
93+
public bool UseSecretsManager { get; set; }
94+
public bool UsePasswordManager { get; set; }
95+
public bool UsersGetPremium { get; set; }
96+
public bool UseCustomPermissions { get; set; }
97+
public bool UseActivateAutofillPolicy { get; set; }
98+
public bool UseRiskInsights { get; set; }
99+
public bool UseOrganizationDomains { get; set; }
100+
public bool UseAdminSponsoredFamilies { get; set; }
101+
public bool UseAutomaticUserConfirmation { get; set; }
102+
public bool SelfHost { get; set; }
103+
public int? Seats { get; set; }
104+
public short? MaxCollections { get; set; }
105+
public short? MaxStorageGb { get; set; }
106+
public string? Key { get; set; }
107+
public bool HasPublicAndPrivateKeys { get; set; }
108+
public bool SsoBound { get; set; }
109+
public bool ResetPasswordEnrolled { get; set; }
110+
public bool LimitCollectionCreation { get; set; }
111+
public bool LimitCollectionDeletion { get; set; }
112+
public bool LimitItemDeletion { get; set; }
113+
public bool AllowAdminAccessToAllCollectionItems { get; set; }
114+
public Guid? ProviderId { get; set; }
115+
[JsonConverter(typeof(HtmlEncodingStringConverter))]
116+
public string? ProviderName { get; set; }
117+
public ProviderType? ProviderType { get; set; }
118+
public bool SsoEnabled { get; set; }
119+
public bool KeyConnectorEnabled { get; set; }
120+
public string? KeyConnectorUrl { get; set; }
121+
public MemberDecryptionType? SsoMemberDecryptionType { get; set; }
122+
public bool AccessSecretsManager { get; set; }
123+
public Guid? UserId { get; set; }
124+
public OrganizationUserStatusType Status { get; set; }
125+
public OrganizationUserType Type { get; set; }
126+
public Permissions? Permissions { get; set; }
127+
}
Lines changed: 25 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,52 @@
1-
// FIXME: Update this file to be null safe and then delete the line below
2-
#nullable disable
3-
4-
using System.Text.Json.Serialization;
5-
using Bit.Core.AdminConsole.Enums.Provider;
6-
using Bit.Core.Auth.Enums;
7-
using Bit.Core.Auth.Models.Data;
8-
using Bit.Core.Billing.Enums;
9-
using Bit.Core.Billing.Extensions;
10-
using Bit.Core.Enums;
11-
using Bit.Core.Models.Api;
1+
using Bit.Core.Enums;
122
using Bit.Core.Models.Data;
133
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
144
using Bit.Core.Utilities;
155

166
namespace Bit.Api.AdminConsole.Models.Response;
177

18-
public class ProfileOrganizationResponseModel : ResponseModel
8+
/// <summary>
9+
/// Sync data for organization members and their organization.
10+
/// Note: see <see cref="ProfileProviderOrganizationResponseModel"/> for organization sync data received by provider users.
11+
/// </summary>
12+
public class ProfileOrganizationResponseModel : BaseProfileOrganizationResponseModel
1913
{
20-
public ProfileOrganizationResponseModel(string str) : base(str) { }
21-
2214
public ProfileOrganizationResponseModel(
23-
OrganizationUserOrganizationDetails organization,
15+
OrganizationUserOrganizationDetails organizationDetails,
2416
IEnumerable<Guid> organizationIdsClaimingUser)
25-
: this("profileOrganization")
17+
: base("profileOrganization", organizationDetails)
2618
{
27-
Id = organization.OrganizationId;
28-
Name = organization.Name;
29-
UsePolicies = organization.UsePolicies;
30-
UseSso = organization.UseSso;
31-
UseKeyConnector = organization.UseKeyConnector;
32-
UseScim = organization.UseScim;
33-
UseGroups = organization.UseGroups;
34-
UseDirectory = organization.UseDirectory;
35-
UseEvents = organization.UseEvents;
36-
UseTotp = organization.UseTotp;
37-
Use2fa = organization.Use2fa;
38-
UseApi = organization.UseApi;
39-
UseResetPassword = organization.UseResetPassword;
40-
UseSecretsManager = organization.UseSecretsManager;
41-
UsePasswordManager = organization.UsePasswordManager;
42-
UsersGetPremium = organization.UsersGetPremium;
43-
UseCustomPermissions = organization.UseCustomPermissions;
44-
UseActivateAutofillPolicy = organization.PlanType.GetProductTier() == ProductTierType.Enterprise;
45-
SelfHost = organization.SelfHost;
46-
Seats = organization.Seats;
47-
MaxCollections = organization.MaxCollections;
48-
MaxStorageGb = organization.MaxStorageGb;
49-
Key = organization.Key;
50-
HasPublicAndPrivateKeys = organization.PublicKey != null && organization.PrivateKey != null;
51-
Status = organization.Status;
52-
Type = organization.Type;
53-
Enabled = organization.Enabled;
54-
SsoBound = !string.IsNullOrWhiteSpace(organization.SsoExternalId);
55-
Identifier = organization.Identifier;
56-
Permissions = CoreHelpers.LoadClassFromJsonData<Permissions>(organization.Permissions);
57-
ResetPasswordEnrolled = !string.IsNullOrWhiteSpace(organization.ResetPasswordKey);
58-
UserId = organization.UserId;
59-
OrganizationUserId = organization.OrganizationUserId;
60-
ProviderId = organization.ProviderId;
61-
ProviderName = organization.ProviderName;
62-
ProviderType = organization.ProviderType;
63-
FamilySponsorshipFriendlyName = organization.FamilySponsorshipFriendlyName;
64-
IsAdminInitiated = organization.IsAdminInitiated ?? false;
65-
FamilySponsorshipAvailable = (FamilySponsorshipFriendlyName == null || IsAdminInitiated) &&
19+
Status = organizationDetails.Status;
20+
Type = organizationDetails.Type;
21+
OrganizationUserId = organizationDetails.OrganizationUserId;
22+
UserIsClaimedByOrganization = organizationIdsClaimingUser.Contains(organizationDetails.OrganizationId);
23+
Permissions = CoreHelpers.LoadClassFromJsonData<Permissions>(organizationDetails.Permissions);
24+
IsAdminInitiated = organizationDetails.IsAdminInitiated ?? false;
25+
FamilySponsorshipFriendlyName = organizationDetails.FamilySponsorshipFriendlyName;
26+
FamilySponsorshipLastSyncDate = organizationDetails.FamilySponsorshipLastSyncDate;
27+
FamilySponsorshipToDelete = organizationDetails.FamilySponsorshipToDelete;
28+
FamilySponsorshipValidUntil = organizationDetails.FamilySponsorshipValidUntil;
29+
FamilySponsorshipAvailable = (organizationDetails.FamilySponsorshipFriendlyName == null || IsAdminInitiated) &&
6630
StaticStore.GetSponsoredPlan(PlanSponsorshipType.FamiliesForEnterprise)
67-
.UsersCanSponsor(organization);
68-
ProductTierType = organization.PlanType.GetProductTier();
69-
FamilySponsorshipLastSyncDate = organization.FamilySponsorshipLastSyncDate;
70-
FamilySponsorshipToDelete = organization.FamilySponsorshipToDelete;
71-
FamilySponsorshipValidUntil = organization.FamilySponsorshipValidUntil;
72-
AccessSecretsManager = organization.AccessSecretsManager;
73-
LimitCollectionCreation = organization.LimitCollectionCreation;
74-
LimitCollectionDeletion = organization.LimitCollectionDeletion;
75-
LimitItemDeletion = organization.LimitItemDeletion;
76-
AllowAdminAccessToAllCollectionItems = organization.AllowAdminAccessToAllCollectionItems;
77-
UserIsClaimedByOrganization = organizationIdsClaimingUser.Contains(organization.OrganizationId);
78-
UseRiskInsights = organization.UseRiskInsights;
79-
UseOrganizationDomains = organization.UseOrganizationDomains;
80-
UseAdminSponsoredFamilies = organization.UseAdminSponsoredFamilies;
81-
SsoEnabled = organization.SsoEnabled ?? false;
82-
83-
if (organization.SsoConfig != null)
84-
{
85-
var ssoConfigData = SsoConfigurationData.Deserialize(organization.SsoConfig);
86-
KeyConnectorEnabled = ssoConfigData.MemberDecryptionType == MemberDecryptionType.KeyConnector && !string.IsNullOrEmpty(ssoConfigData.KeyConnectorUrl);
87-
KeyConnectorUrl = ssoConfigData.KeyConnectorUrl;
88-
SsoMemberDecryptionType = ssoConfigData.MemberDecryptionType;
89-
}
90-
91-
UseAutomaticUserConfirmation = organization.UseAutomaticUserConfirmation;
31+
.UsersCanSponsor(organizationDetails);
32+
AccessSecretsManager = organizationDetails.AccessSecretsManager;
9233
}
9334

94-
public Guid Id { get; set; }
95-
[JsonConverter(typeof(HtmlEncodingStringConverter))]
96-
public string Name { get; set; }
97-
public bool UsePolicies { get; set; }
98-
public bool UseSso { get; set; }
99-
public bool UseKeyConnector { get; set; }
100-
public bool UseScim { get; set; }
101-
public bool UseGroups { get; set; }
102-
public bool UseDirectory { get; set; }
103-
public bool UseEvents { get; set; }
104-
public bool UseTotp { get; set; }
105-
public bool Use2fa { get; set; }
106-
public bool UseApi { get; set; }
107-
public bool UseResetPassword { get; set; }
108-
public bool UseSecretsManager { get; set; }
109-
public bool UsePasswordManager { get; set; }
110-
public bool UsersGetPremium { get; set; }
111-
public bool UseCustomPermissions { get; set; }
112-
public bool UseActivateAutofillPolicy { get; set; }
113-
public bool SelfHost { get; set; }
114-
public int? Seats { get; set; }
115-
public short? MaxCollections { get; set; }
116-
public short? MaxStorageGb { get; set; }
117-
public string Key { get; set; }
118-
public OrganizationUserStatusType Status { get; set; }
119-
public OrganizationUserType Type { get; set; }
120-
public bool Enabled { get; set; }
121-
public bool SsoBound { get; set; }
122-
public string Identifier { get; set; }
123-
public Permissions Permissions { get; set; }
124-
public bool ResetPasswordEnrolled { get; set; }
125-
public Guid? UserId { get; set; }
12635
public Guid OrganizationUserId { get; set; }
127-
public bool HasPublicAndPrivateKeys { get; set; }
128-
public Guid? ProviderId { get; set; }
129-
[JsonConverter(typeof(HtmlEncodingStringConverter))]
130-
public string ProviderName { get; set; }
131-
public ProviderType? ProviderType { get; set; }
132-
public string FamilySponsorshipFriendlyName { get; set; }
36+
public bool UserIsClaimedByOrganization { get; set; }
37+
public string? FamilySponsorshipFriendlyName { get; set; }
13338
public bool FamilySponsorshipAvailable { get; set; }
134-
public ProductTierType ProductTierType { get; set; }
135-
public bool KeyConnectorEnabled { get; set; }
136-
public string KeyConnectorUrl { get; set; }
13739
public DateTime? FamilySponsorshipLastSyncDate { get; set; }
13840
public DateTime? FamilySponsorshipValidUntil { get; set; }
13941
public bool? FamilySponsorshipToDelete { get; set; }
140-
public bool AccessSecretsManager { get; set; }
141-
public bool LimitCollectionCreation { get; set; }
142-
public bool LimitCollectionDeletion { get; set; }
143-
public bool LimitItemDeletion { get; set; }
144-
public bool AllowAdminAccessToAllCollectionItems { get; set; }
42+
public bool IsAdminInitiated { get; set; }
14543
/// <summary>
146-
/// Obsolete.
147-
/// See <see cref="UserIsClaimedByOrganization"/>
44+
/// Obsolete property for backward compatibility
14845
/// </summary>
14946
[Obsolete("Please use UserIsClaimedByOrganization instead. This property will be removed in a future version.")]
15047
public bool UserIsManagedByOrganization
15148
{
15249
get => UserIsClaimedByOrganization;
15350
set => UserIsClaimedByOrganization = value;
15451
}
155-
/// <summary>
156-
/// Indicates if the user is claimed by the organization.
157-
/// </summary>
158-
/// <remarks>
159-
/// A user is claimed by an organization if the user's email domain is verified by the organization and the user is a member.
160-
/// The organization must be enabled and able to have verified domains.
161-
/// </remarks>
162-
public bool UserIsClaimedByOrganization { get; set; }
163-
public bool UseRiskInsights { get; set; }
164-
public bool UseOrganizationDomains { get; set; }
165-
public bool UseAdminSponsoredFamilies { get; set; }
166-
public bool IsAdminInitiated { get; set; }
167-
public bool SsoEnabled { get; set; }
168-
public MemberDecryptionType? SsoMemberDecryptionType { get; set; }
169-
public bool UseAutomaticUserConfirmation { get; set; }
17052
}
Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,24 @@
11
using Bit.Core.AdminConsole.Models.Data.Provider;
2-
using Bit.Core.Billing.Enums;
3-
using Bit.Core.Billing.Extensions;
42
using Bit.Core.Enums;
53
using Bit.Core.Models.Data;
64

75
namespace Bit.Api.AdminConsole.Models.Response;
86

9-
public class ProfileProviderOrganizationResponseModel : ProfileOrganizationResponseModel
7+
/// <summary>
8+
/// Sync data for provider users and their managed organizations.
9+
/// Note: see <see cref="ProfileOrganizationResponseModel"/> for organization sync data received by organization members.
10+
/// </summary>
11+
public class ProfileProviderOrganizationResponseModel : BaseProfileOrganizationResponseModel
1012
{
11-
public ProfileProviderOrganizationResponseModel(ProviderUserOrganizationDetails organization)
12-
: base("profileProviderOrganization")
13+
public ProfileProviderOrganizationResponseModel(ProviderUserOrganizationDetails organizationDetails)
14+
: base("profileProviderOrganization", organizationDetails)
1315
{
14-
Id = organization.OrganizationId;
15-
Name = organization.Name;
16-
UsePolicies = organization.UsePolicies;
17-
UseSso = organization.UseSso;
18-
UseKeyConnector = organization.UseKeyConnector;
19-
UseScim = organization.UseScim;
20-
UseGroups = organization.UseGroups;
21-
UseDirectory = organization.UseDirectory;
22-
UseEvents = organization.UseEvents;
23-
UseTotp = organization.UseTotp;
24-
Use2fa = organization.Use2fa;
25-
UseApi = organization.UseApi;
26-
UseResetPassword = organization.UseResetPassword;
27-
UsersGetPremium = organization.UsersGetPremium;
28-
UseCustomPermissions = organization.UseCustomPermissions;
29-
UseActivateAutofillPolicy = organization.PlanType.GetProductTier() == ProductTierType.Enterprise;
30-
SelfHost = organization.SelfHost;
31-
Seats = organization.Seats;
32-
MaxCollections = organization.MaxCollections;
33-
MaxStorageGb = organization.MaxStorageGb;
34-
Key = organization.Key;
35-
HasPublicAndPrivateKeys = organization.PublicKey != null && organization.PrivateKey != null;
3616
Status = OrganizationUserStatusType.Confirmed; // Provider users are always confirmed
3717
Type = OrganizationUserType.Owner; // Provider users behave like Owners
38-
Enabled = organization.Enabled;
39-
SsoBound = false;
40-
Identifier = organization.Identifier;
18+
ProviderId = organizationDetails.ProviderId;
19+
ProviderName = organizationDetails.ProviderName;
20+
ProviderType = organizationDetails.ProviderType;
4121
Permissions = new Permissions();
42-
ResetPasswordEnrolled = false;
43-
UserId = organization.UserId;
44-
ProviderId = organization.ProviderId;
45-
ProviderName = organization.ProviderName;
46-
ProviderType = organization.ProviderType;
47-
ProductTierType = organization.PlanType.GetProductTier();
48-
LimitCollectionCreation = organization.LimitCollectionCreation;
49-
LimitCollectionDeletion = organization.LimitCollectionDeletion;
50-
LimitItemDeletion = organization.LimitItemDeletion;
51-
AllowAdminAccessToAllCollectionItems = organization.AllowAdminAccessToAllCollectionItems;
52-
UseRiskInsights = organization.UseRiskInsights;
53-
UseOrganizationDomains = organization.UseOrganizationDomains;
54-
UseAdminSponsoredFamilies = organization.UseAdminSponsoredFamilies;
55-
UseAutomaticUserConfirmation = organization.UseAutomaticUserConfirmation;
22+
AccessSecretsManager = false; // Provider users cannot access Secrets Manager
5623
}
5724
}

0 commit comments

Comments
 (0)