Conversation
|
New Issues (3)Checkmarx found the following issues in this Pull Request
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7241 +/- ##
==========================================
+ Coverage 56.87% 57.68% +0.80%
==========================================
Files 2028 2035 +7
Lines 88827 89645 +818
Branches 7917 7993 +76
==========================================
+ Hits 50523 51709 +1186
+ Misses 36472 36072 -400
- Partials 1832 1864 +32 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Overall Assessment: REQUEST CHANGES This PR adds five new cipher scene types (Card, Identity, Login, SecureNote, SSH Key) for the Seeder API, adds Code Review Details
Prior unresolved findings (still applicable):
|
theMickster
left a comment
There was a problem hiding this comment.
Two minor but important things I think we should change now because we aren't likely to come back to these scenes for any tech debt refactor for a long while.
| public string? Password { get; set; } | ||
| public string? Uri { get; set; } | ||
| public string? Notes { get; set; } | ||
| public IEnumerable<(string name, string value, int type)>? Fields { get; set; } |
There was a problem hiding this comment.
🔵 [SUGGESTION] C# value tuples (ValueTuple) don't round-trip through System.Text.Json with named elements — at runtime the names are Item1, Item2, Item3, not name, value, type. Since SceneExecutor deserializes requests via JsonSerializer.Deserialize, callers would need to send {"Item1": ..., "Item2": ..., "Item3": ...} for this to work, which is unintuitive.
Consider using FieldViewDto (or a dedicated DTO) instead of the tuple so the JSON contract is explicit and matches the field names callers would expect:
| public IEnumerable<(string name, string value, int type)>? Fields { get; set; } | |
| public IEnumerable<FieldViewDto>? Fields { get; set; } |
This would require a small adapter in SeedAsync to convert to the tuple the factory expects, or updating LoginCipherSeeder.Create to accept FieldViewDto directly.
theMickster
left a comment
There was a problem hiding this comment.
@MGibson1 Will you also try to see what might be going on with the Docker build job for the Seeder? I don't suspect that this code broke anything, but I just don't want to forget about it throwing exceptions.
For now only supports one login cipher
596e5e1 to
728090a
Compare
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1c5bd7f to
221ae12
Compare
| Uris = string.IsNullOrEmpty(uri) ? null : [new LoginUriViewDto { Uri = uri }] | ||
| }, | ||
| Reprompt = reprompt ? RepromptTypes.Password : RepromptTypes.None, | ||
| DeletedDate = deleted ? DateTime.UtcNow.AddDays(-1) : null, |
There was a problem hiding this comment.
DeletedDate is set on CipherViewDto but never propagated to the Cipher entity -- setting deleted: true silently has no effect
Details and fix
CipherEncryption.CreateEntity (in CipherEncryption.cs lines 46-57) does not copy DeletedDate from EncryptedCipherDto to the returned Cipher entity. It only sets Id, OrganizationId, UserId, Type, Data, Key, Reprompt, CreationDate, and RevisionDate.
The EncryptedCipherDto does carry DeletedDate through encryption, but it is discarded when building the final entity.
Fix in CipherEncryption.CreateEntity:
return new Cipher
{
Id = CoreHelpers.GenerateComb(),
OrganizationId = organizationId,
UserId = userId,
Type = cipherType,
Data = dataJson,
Key = encrypted.Key,
Reprompt = (CipherRepromptType?)encrypted.Reprompt,
CreationDate = DateTime.UtcNow,
RevisionDate = DateTime.UtcNow,
DeletedDate = encrypted.DeletedDate,
};This requires adding a DeletedDate parameter to CreateEntity or reading it from the EncryptedCipherDto that is already passed in.
|






📔 Objective
Provide seeder api scenes for cipher creation. To reduce API complexity, I elected to create multiple scenes rather than a single that keys off of a type.
📸 Screenshots