bitwarden / passwordless-server

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

When no mail providers are registered, fall back to no-op behavior #714

Closed Tyrrrz closed 2 months ago

Tyrrrz commented 2 months ago

705 changed the behavior in regard to how the mail providers are configured:

The issue is that, in certain scenarios, the application may not be able to write data to the file system and thus may not use the FileMailProvider, making it a poor default choice. This happens, for example, when running in Docker, where the application is executed under an under-privileged user account for security reasons:

image

Additionally, there does not appear to be a way to set the NoopMailProvider through configuration as it's only defined in tests.

This PR reverts some of the user-facing behavior changes introduced in #705 and makes it so that no emails are sent when the configuration does not specify any mail provider.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 35.12%. Comparing base (5bcf203) to head (b106d59). Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
src/Common/Services/Mail/MailBootstrap.cs 33.33% 2 Missing :warning:
src/Common/Services/Mail/AggregateMailProvider.cs 90.90% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #714 +/- ## ========================================== - Coverage 35.14% 35.12% -0.03% ========================================== Files 574 574 Lines 31176 31155 -21 Branches 930 929 -1 ========================================== - Hits 10958 10942 -16 + Misses 20072 20067 -5 Partials 146 146 ```

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