-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SM-837 SM input names validation #810
Conversation
No New Or Fixed Issues Found |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #810 +/- ##
==========================================
+ Coverage 56.07% 57.60% +1.53%
==========================================
Files 193 193
Lines 12675 13076 +401
==========================================
+ Hits 7107 7533 +426
+ Misses 5568 5543 -25 ☔ View full report in Codecov by Sentry. |
# Conflicts: # crates/bitwarden/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great
Thank you!
I am not a pro at rust yet, so I do recommend @coltonhurst also review this if he has time, but from what I can tell it looks good 😄
# Conflicts: # crates/bitwarden/src/error.rs # crates/bitwarden/src/secrets_manager/projects/create.rs # crates/bitwarden/src/secrets_manager/projects/update.rs # crates/bitwarden/src/secrets_manager/secrets/create.rs # crates/bitwarden/src/secrets_manager/secrets/update.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these changes @mzieniukbw 😊
As we discussed internally we might not need the whole library, we could keep a version of the error type you created and do more simple validation checks for now until we need something bigger.
But would love thoughts from @dani-garcia & @Hinton in case this could be used for more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, some minor comments.
I'm okay with using the library, you're right that we're not doing much validation at the moment, but I think it would be good to try it out.
Showing error value on unknown validation type Co-authored-by: Daniel García <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
< removed my comments, please disregard >
# Conflicts: # Cargo.lock # crates/bitwarden-sm/src/projects/create.rs # crates/bitwarden-sm/src/projects/update.rs # crates/bitwarden-sm/src/secrets/create.rs # crates/bitwarden-sm/src/secrets/update.rs # crates/bitwarden/Cargo.toml # crates/bitwarden/src/error.rs
# Conflicts: # Cargo.lock
@coltonhurst i had to resolve a merge conflict before merging, please approve again if that's ok. |
🎟️ Tracking
https://bitwarden.atlassian.net/browse/SM-837
📔 Objective
Input validation and sanitisation for SM should be the same as we do in
bitwarden/clients
Validation:
name
: required, max length 500key
: required, max length 500value
: required, max length 25000notes
: max length 7000Sanitisation to SM cli:
name
: trimkey
: trimnotes
: trim📸 Screenshots
⏰ Reminders before review
team
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmedissue and could potentially benefit from discussion
:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes