PM-34033 - Add user & org API key seeding and improve CLI output#7324
PM-34033 - Add user & org API key seeding and improve CLI output#7324theMickster merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Refactored from util/Seeder/Pipeline/RecipeOrchestrator.cs
|
Overall Assessment: APPROVE This PR adds organization API key seeding via a new Code Review DetailsNo findings identified. The new step follows the established pipeline pattern (step registration, context state, bulk commit ordering), the |
There was a problem hiding this comment.
Refactored from util/Seeder/Recipes/OrganizationRecipe.cs
There was a problem hiding this comment.
Refactored from `util/Seeder/Recipes/IndividualUserRecipe.cs
| public int KdfIterations { get; set; } = 5_000; | ||
|
|
||
| [Option("mangle", Description = "Enable ID mangling for test isolation")] | ||
| public bool Mangle { get; set; } = false; |
There was a problem hiding this comment.
This is tech debt cleanup that shouldn't have been added
|
|
||
| private static GlobalSettings LoadGlobalSettings() | ||
| { | ||
| Console.WriteLine("Loading global settings..."); |
There was a problem hiding this comment.
Pointless to have this in the output...
There was a problem hiding this comment.
I really dig the flare we have here with the art work, but time to trim it down 😉
I will likely add a switch to skip this all-together when automated processes (like CI/CD or Bash scripts) call the CLI, but for now I am keeping it because it's still neat.
| { | ||
| var org = context.RequireOrganization(); | ||
|
|
||
| var apiKey = new OrganizationApiKey |
There was a problem hiding this comment.
This was taken directly from src/Core/AdminConsole/OrganizationFeatures/OrganizationApiKeys/CreateOrganizationApiKeyCommand.cs.
|
Great job! No new security vulnerabilities introduced in this pull request |
| Premium = premium, | ||
| MaxStorageGb = maxStorageGb, | ||
| ApiKey = Guid.NewGuid().ToString("N")[..30], | ||
| ApiKey = CoreHelpers.SecureRandomString(30), |
There was a problem hiding this comment.
This was taken directly form src/Core/Auth/UserFeatures/Registration/Implementations/RegisterUserCommand.cs
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7324 +/- ##
=======================================
Coverage 57.91% 57.91%
=======================================
Files 2045 2045
Lines 90235 90235
Branches 8024 8024
=======================================
+ Hits 52263 52264 +1
+ Misses 36105 36104 -1
Partials 1867 1867 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Individual is not a particularly descriptive name. Is it an individual user, organization, folder, cipher?
There was a problem hiding this comment.
This seems both very specific and generic at the same time. Isn't the result dependent on what you are seeding?
There was a problem hiding this comment.
Same here, the name is very generic but it's tied to an organization .
|




🎟️ Tracking
PM-34033
📔 Objective
.csfiles.