bitwarden / passwordless-server

Bitwarden Passwordless.dev infrastructure/backend (API, database, Docker, etc).
https://bitwarden.com/
Other
86 stars 28 forks source link

PAS-420 | Additional validation during organization creation #652

Closed jonashendrickx closed 3 months ago

jonashendrickx commented 3 months ago

Ticket

Description

Proper validation for all the fields during organization creation. Several fields did not have any validation present, and would cause the admin console to crash due to required database constraints. Or you could simply insert junk data with no sanitization.

Shape

n/a

Screenshots

image Screenshot 2024-07-29 at 13 37 28 Screenshot 2024-07-29 at 13 39 40

Checklist

I did the following to ensure that my changes were tested thoroughly:

I did the following to ensure that my changes do not introduce security vulnerabilities:

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 16.48352% with 76 lines in your changes missing coverage. Please review.

Project coverage is 34.12%. Comparing base (a1cd4c1) to head (4390e54).

Files Patch % Lines
...sole/Components/Pages/Organization/Create.razor.cs 0.00% 57 Missing :warning:
src/Common/Db/Converters/EnumToStringConverter.cs 28.57% 10 Missing :warning:
...minConsole/Services/MagicLinks/MagicLinkBuilder.cs 0.00% 7 Missing :warning:
src/AdminConsole/Components/Pages/Initialize.razor 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #652 +/- ## ======================================= Coverage 34.12% 34.12% ======================================= Files 560 560 Lines 29905 29926 +21 Branches 918 922 +4 ======================================= + Hits 10204 10212 +8 - Misses 19564 19577 +13 Partials 137 137 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.