diff --git a/util/Seeder/Factories/OrganizationSeeder.cs b/util/Seeder/Factories/OrganizationSeeder.cs index 0abd2349aa..0b1d908f8d 100644 --- a/util/Seeder/Factories/OrganizationSeeder.cs +++ b/util/Seeder/Factories/OrganizationSeeder.cs @@ -3,18 +3,19 @@ using Bit.Core.Billing.Enums; using Bit.Core.Entities; using Bit.Core.Enums; using Bit.Core.Utilities; +using Bit.Seeder.Services; namespace Bit.Seeder.Factories; internal static class OrganizationSeeder { - internal static Organization Create(string name, string domain, int seats, string? publicKey = null, string? privateKey = null, PlanType planType = PlanType.EnterpriseAnnually) + internal static Organization Create(string name, string domain, int seats, IManglerService manglerService, string? publicKey = null, string? privateKey = null, PlanType planType = PlanType.EnterpriseAnnually) { var org = new Organization { Id = CoreHelpers.GenerateComb(), - Identifier = domain, - Name = name, + Identifier = manglerService.Mangle(domain), + Name = manglerService.Mangle(name), BillingEmail = $"billing@{domain}", Seats = seats, Status = OrganizationStatusType.Created, diff --git a/util/Seeder/Recipes/OrganizationWithUsersRecipe.cs b/util/Seeder/Recipes/OrganizationWithUsersRecipe.cs index 720ce73cce..00a1206b3b 100644 --- a/util/Seeder/Recipes/OrganizationWithUsersRecipe.cs +++ b/util/Seeder/Recipes/OrganizationWithUsersRecipe.cs @@ -26,7 +26,7 @@ public class OrganizationWithUsersRecipe( // Generate organization keys var orgKeys = RustSdkService.GenerateOrganizationKeys(); var organization = OrganizationSeeder.Create( - name, domain, seats, orgKeys.PublicKey, orgKeys.PrivateKey); + name, domain, seats, manglerService, orgKeys.PublicKey, orgKeys.PrivateKey); // Create owner with SDK-generated keys var ownerUser = UserSeeder.Create($"owner@{domain}", passwordHasher, manglerService); diff --git a/util/Seeder/Recipes/OrganizationWithVaultRecipe.cs b/util/Seeder/Recipes/OrganizationWithVaultRecipe.cs index cbceacf88a..785534e817 100644 --- a/util/Seeder/Recipes/OrganizationWithVaultRecipe.cs +++ b/util/Seeder/Recipes/OrganizationWithVaultRecipe.cs @@ -61,7 +61,7 @@ public class OrganizationWithVaultRecipe( // Create organization via factory var organization = OrganizationSeeder.Create( - options.Name, options.Domain, seats, orgKeys.PublicKey, orgKeys.PrivateKey, options.PlanType); + options.Name, options.Domain, seats, manglerService, orgKeys.PublicKey, orgKeys.PrivateKey, options.PlanType); // Create owner user via factory var ownerEmail = $"owner@{options.Domain}"; diff --git a/util/Seeder/Steps/CreateOrganizationStep.cs b/util/Seeder/Steps/CreateOrganizationStep.cs index a8d9b8ebc2..e8e78c990b 100644 --- a/util/Seeder/Steps/CreateOrganizationStep.cs +++ b/util/Seeder/Steps/CreateOrganizationStep.cs @@ -56,7 +56,7 @@ internal sealed class CreateOrganizationStep : IStep var seats = _seats ?? PlanFeatures.GenerateRealisticSeatCount(_planType, domain); var orgKeys = RustSdkService.GenerateOrganizationKeys(); - var organization = OrganizationSeeder.Create(name, domain, seats, orgKeys.PublicKey, orgKeys.PrivateKey, _planType); + var organization = OrganizationSeeder.Create(name, domain, seats, context.GetMangler(), orgKeys.PublicKey, orgKeys.PrivateKey, _planType); context.Organization = organization; context.OrgKeys = orgKeys;