1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-24 12:35:25 +01:00
Commit Graph

2528 Commits

Author SHA1 Message Date
Chad Scharf
ee5946c4b9
EC-262 - add missing validation on deactivate (#2064) 2022-06-17 11:04:25 -04:00
Thomas Rittson
3360d40592
[EC-243] Grant premium status when member accepts org invite (#2043) 2022-06-17 06:30:50 +10:00
Chad Scharf
b2a0aa2860
EC-262 - implement org user deactivated flag and behavior server (#2050)
* SM-47 - Add Disabled status to enum + schema

* SM-47 - Enable and disable sprocs and repositories

* SM-47 - Organization service enble/disable user

* SM-47 - Fix lint errors

* SM-47 - add disable/enable endpoints to API

* SM-47 - Add bulk operations for enable/disable

* SM-47 - Fix linting errors, one of these days I'll do this first

* SM-47 - Codesense fix DRY warnings

* EC-262 - Code review changes, async cleanup

* EC-262 - Fix build issues, async refs

* EC-262 - Update controller param types

* EC-262 - Ensure mutable state is correct

* EC-262 - rename disabled to deactivated
2022-06-16 15:59:57 -04:00
Gbubemi Smith
8e79c20dce
[SG-72] Sync changed email address with stripe (#2042)
* sync changed email address with strip

* sync changed email address with strip

* fixed formatting

* throw exception if not successful

* Added revert if stripe sync fails

* Added revert if stripe sync fails

* Added revert if stripe sync fails

* created stripe sync service

* fixed lint issue

* reverted to use stripe exception message

* added null checks to customer id and email address

* added braces

* removed empty email
2022-06-16 17:45:26 +01:00
Thomas Rittson
b39a43210d
[EC-235] Reapply permissions fix for Admin cipher endpoint (#2061)
* Reapply fix from PR 2036, accidentally clobbered by PR 2022
2022-06-15 12:47:36 +10:00
Robyn MacCallum
d626174f7e
Fix null collectionIds after live-syncing a cipher (#2057) 2022-06-13 13:50:44 -04:00
Justin Baur
46b4207ab6
[PS-899] Fix unawaited Task (#2055)
* Fix unawaited task and switch to Guid parameters

* Remove whitespace

* Formatting

* Fix unwanted Assert
2022-06-13 11:18:53 -04:00
Federico Maccaroni
e3699156de
[PS-589] Fix DeviceUnknownVerification User_Update proc (#2041)
* PS-589 Fix 2022-05-24_00_DeviceUnknownVerification User_Update proc to remove the NULL and set the default value

* PS-589 updated stored procedures on Sql project to have UnknownDeviceVerificationEnabled with default 1 instead of NULL
2022-06-13 16:42:24 +02:00
Matt Gibson
9ff82ab176
Use the correct policy enum type (#2045)
Explicit conversion from non-generics to generics doesn't seem to work
here, so I moved to using the read methods already on base Policy.
2022-06-09 18:57:56 -05:00
Dan Poltawski
65ac9a527f
Fix bitwarden typo in API URI (#2044) 2022-06-09 12:21:55 -04:00
Matt Gibson
ef403b4362
[PS-616] [PS-795] Fix/auto enroll master password reset without user verification (#2038)
* Fix parameter name to match entity

* Deserialize policy data in object

* Add policy with config type to fixtures

* Return policy with deserialized config

* Use CoreHelper serializers

* Add master password reset on accept request

* Simplify policy data parsing

* Linter
2022-06-08 08:44:28 -05:00
Drank Sinatra
194b76c13d
Add Spanish version of healthcare.gov (#2040)
The site for USA government health insurance has a separate base domain in Spanish.
2022-06-07 21:39:18 +02:00
Gbubemi Smith
64edad8f49
[PS-165] Missing copy verification code (#2022)
* Made changes to organization details endpoint

* Fixed formatting

* Added script to utils directory
2022-06-07 16:52:07 +01:00
Chad Scharf
60a167f2b7
Update swashbuckle for swaggerUI (#2039) 2022-06-07 10:11:18 -04:00
thericle
496c9a5d50
protonmail.com domain has been replaced by proton.me (#2034)
* protonmail.com domain has been replaced by proton.me

Protonvpn.com is still in use so there is still a need for equivalent domains for Proton.

* Update StaticStore.cs
2022-06-06 21:06:58 -04:00
Thomas Rittson
f602df2eb9
[EC-235] Give Admins (and above) access to all items (#2036) 2022-06-07 10:33:39 +10:00
Federico Maccaroni
b070e9a387
[PS-589] Fix emergency contact takeover device verification and endpoints for its settings (#2016)
* Added UnknownDeviceVerificationEnabled on User that is turned off when emergency contact takes over the account. Also added endpoints to get and update 2fa device verification settings. And Updated migrations & tests

* Applied dotnet format

* Fixed method rename call on TwoFactorController

* PS-589 Format fixes

* PS-589 changed UnknownDeviceVerificationEnabled to be non-nullable
2022-06-06 14:52:50 -03:00
Carlos J. Muentes
14302efa2c
CSA-2 - Require user interaction for SSO redirect (#1948)
* CSA-2 - adding validation before redirecting for SSO login

* Updating server to use generated and signed JWT for SSO redirect

* Removing erroneous file

* Removing erroneous file

* Updating for PR feedback, adding domain_hint to Login and fixing invalid domain_hint name reference

* Some code styling changes from PR feedback

* Removing unnecessary JSON serialization

* Couple small changes from PR feedback

* Fixing linting errors

* Update formatting in AccountController.cs

* Remove unused dependency

* Add token lifetime to settings

* Use tokenable directly

* Return defined models

* Revert sso proj file changes

* Check expiration validity when validating org

* Show error message with expired token

* Formatting fixes

* Add SsoTokenLifetime to Sso settings

* Fix build errors

* Fix sql warnings

Co-authored-by: Carlos J. Muentes <cmuentes@bitwarden.com>
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2022-06-01 12:23:52 -05:00
Thomas Avery
c27645265c
Fix Master Password Hint Email template (#2019) 2022-06-01 11:05:08 -05:00
Daniel James Smith
610be2cdcc
[EC-144] Fix stripe revert logic (#2014)
* Revert scaling by previous value

* Throw is Stripe subscription revert fails

* Remove unused property

* Add null check to accommodate for not existing storage-gb-xxx subscription item

* Use long? instead of Nullable<long>

* Remove redundant try/catch

* Ensure collectionMethod is changed back, even when revertSub fails

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2022-05-31 22:55:09 +02:00
Addison Beck
39ba68e66b
[fix] Correct a typo in the event name of a stripe webhook (#2023) 2022-05-31 18:08:34 +02:00
Addison Beck
052f760fbb
[fix] Cancel unpaid subscriptions (#2017)
* [refactor] Create a static class for documenting handled stripe webhooks

* [fix] Cancel unpaid subscriptions after 4 failed payments
2022-05-31 10:55:56 -04:00
Kyle Spearrin
810b653915
log captcha response info (#2018)
* log captcha response info

* wrap in isBot condition
2022-05-26 14:33:02 -04:00
Thomas Avery
11b6e5d21d
Fix for displaying email address in email template (#2015) 2022-05-25 11:42:34 -05:00
Justin Baur
f235938c41
Change OrgUser Delete Behavior (#2010)
* Fix OrgUserDelete sprocs

* Update Sqlproj
2022-05-23 15:50:54 -04:00
Thomas Avery
0c925f92c9
Fix port number for vs profile Api-SelfHost (#2011) 2022-05-23 14:22:04 -05:00
Justin Baur
719abc7e61
[BEEEP] Integration tests (#1945)
* Add api integration tests

* Add some stuff

* Make program mockable

* Work on IntegrationTests for Identity

* Formatting

* Update packages.lock.json

* Update more packages.lock.json

* Update all packages.lock.json

* Fix InMemory configuration

* Actually fix test configuration

* Fix tests for CI

* Fix event service

* Force EF EventRepository

* Add client_credentials test

* Remove Api.IntegrationTest

* Remove Api Program changes

* Cleanup

* Add more Auth-Email tests

* Run formatting

* Address some PR feedback

* Move integration stuff to it's own common project

* Ran linter

* Add shared project to test solution

* Remove sln changes

* Clean usings

* Add more coverage

* Address PR feedback
2022-05-20 15:24:59 -04:00
Carlos J. Muentes
452472deab
CSA-1 - adding master password authentication when enrolling in passw… (#1940)
* CSA-2 - adding master password authentication when enrolling in password reset

* Getting user by principal rather than ID

* Removing unnecessary userId call

* Use secret verification for re-auth api requests

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
2022-05-19 14:55:42 -05:00
Matt Gibson
60e36a8f0f
Add InstallationId to event responses (#2007) 2022-05-19 09:58:47 -05:00
Federico Maccaroni
e314537713
PS-661 Fix Captcha Bypass Token Validation (#2004) 2022-05-19 10:15:49 -03:00
Justin Baur
53241f16e0
Add Additional Logging to Self-hosted installs for F4E (#1999)
* Add logging to SH logs

* Fix tests
2022-05-16 09:57:00 -04:00
Justin Baur
6b484e29a7
Switch to sending org name in cloud invite (#2002) 2022-05-16 09:50:33 -04:00
Federico Maccaroni
2e2d3075d1
EC-198 Added feature flag for 2FA Email for new device login (#1993)
* EC-198 added global setting flag for 2FA email on new device login feature

* EC-198 Removed is development environment check on 2FA email new device login given that we can now rely on the global settings feature flag

* EC-198 Improved IGlobalSettings and UserService code for testing
2022-05-13 10:48:48 -03:00
Matt Gibson
c54c39b28c
Feature/self hosted families for enterprise (#1991)
* Families for enterprise/split up organization sponsorship service (#1829)

* Split OrganizationSponsorshipService into commands

* Use tokenable for token validation

* Use interfaces to set up for DI

* Use commands over services

* Move service tests to command tests

* Value types can't be null

* Run dotnet format

* Update src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommand.cs

Co-authored-by: Justin Baur <admin@justinbaur.com>

* Fix controller tests

Co-authored-by: Justin Baur <admin@justinbaur.com>

* Families for enterprise/split up organization sponsorship service (#1875)

* Split OrganizationSponsorshipService into commands

* Use tokenable for token validation

* Use interfaces to set up for DI

* Use commands over services

* Move service tests to command tests

* Value types can't be null

* Run dotnet format

* Update src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/CancelSponsorshipCommand.cs

Co-authored-by: Justin Baur <admin@justinbaur.com>

* Fix controller tests

* Split create and send sponsorships

* Split up create sponsorship

* Add self hosted commands to dependency injection

* Add field to store cloud billing sync key on self host instances

* Fix typo

* Fix data protector purpose of sponsorship offers

* Split cloud and selfhosted sponsorship offer tokenable

* Generate offer from self hosted with all necessary auth data

* Add Required properties to constructor

* Split up cancel sponsorship command

* Split revoke sponsorship command between cloud and self hosted

* Fix/f4e multiple sponsorships (#1838)

* Use sponosorship from validate to redeem

* Update tests

* Format

* Remove sponsorship service

* Run dotnet format

* Fix self hosted only controller attribute

* Clean up file structure and fixes

* Remove unneeded tokenables

* Remove obsolete commands

* Do not require file/class prefix if unnecessary

* Update Organizaiton sprocs

* Remove unnecessary models

* Fix tests

* Generalize LicenseService path calculation

Use async file read and deserialization

* Use interfaces for testability

* Remove unused usings

* Correct test direction

* Test license reading

* remove unused usings

* Format

Co-authored-by: Justin Baur <admin@justinbaur.com>

* Improve DataProtectorTokenFactory test coverage (#1884)

* Add encstring to server

* Test factory

Co-authored-by: Carlos Muentes <cmuentes@bitwarden.com>

* Format

* Remove SymmetricKeyProtectedString

Not needed

* Set ForcInvalid

Co-authored-by: Carlos Muentes <cmuentes@bitwarden.com>

* Feature/self f4e/api keys (#1896)

* Add in ApiKey

* Work on API Key table

* Work on apikey table

* Fix response model

* Work on information for UI

* Work on last sync date

* Work on sync status

* Work on auth

* Work on tokenable

* Work on merge

* Add custom requirement

* Add policy

* Run formatting

* Work on EF Migrations

* Work on OrganizationConnection

* Work on database

* Work on additional database table

* Run formatting

* Small fixes

* More cleanup

* Cleanup

* Add RevisionDate

* Add GO

* Finish Sql project

* Add newlines

* Fix stored proc file

* Fix sqlproj

* Add newlines

* Fix table

* Add navigation property

* Delete Connections when organization is deleted

* Add connection validation

* Start adding ID column

* Work on ID column

* Work on SQL migration

* Work on migrations

* Run formatting

* Fix test build

* Fix sprocs

* Work on migrations

* Fix Create table

* Fix sproc

* Add prints to migration

* Add default value

* Update EF migrations

* Formatting

* Add to integration tests

* Minor fixes

* Formatting

* Cleanup

* Address PR feedback

* Address more PR feedback

* Fix formatting

* Fix formatting

* Fix

* Address PR feedback

* Remove accidential change

* Fix SQL build

* Run formatting

* Address PR feedback

* Add sync data to OrganizationUserOrgDetails

* Add comments

* Remove OrganizationConnectionService interface

* Remove unused using

* Address PR feedback

* Formatting

* Minor fix

* Feature/self f4e/update db (#1930)

* Fix migration

* Fix TimesRenewed

* Add comments

* Make two properties non-nullable

* Remove need for SponsoredOrg on SH (#1934)

* Remove need for SponsoredOrg on SH

* Add Family prefix

* Add check for enterprise org on BillingSync key (#1936)

* [PS-10] Feature/sponsorships removed at end of term (#1938)

* Rename commands to min unique names

* Inject revoke command based on self hosting

* WIP: Remove/Revoke marks to delete

* Complete WIP

* Improve remove/revoke tests

* PR review

* Fail validation if sponsorship has failed to sync for 6 months

* Feature/do not accept old self host sponsorships (#1939)

* Do not accept >6mo old self-hosted sponsorships

* Give disabled grace period of 3 months

* Fix issues of Sql.proj differing from migration outcome (#1942)

* Fix issues of Sql.proj differing from migration outcome

* Yoink int tests

* Add missing assert helpers

* Feature/org sponsorship sync (#1922)

* Self-hosted side sync first pass

TODO:
* flush out org sponsorship model
* implement cloud side
* process cloud-side response and update self-hosted records

* sync scaffolding second pass

* remove list of Org User ids from sync and begin work on SelfHostedRevokeSponsorship

* allow authenticated http calls from server to return a result

* update models

* add logic for sync and change offer email template

* add billing sync key and hide CreateSponsorship without user

* fix tests

* add job scheduling

* add authorize attributes to endpoints

* separate models into data/model and request/response

* batch sync more, add EnableCloudCommunication for testing

* send emails in bulk

* make userId and sponsorshipType non nullable

* batch more on self hosted side of sync

* remove TODOs and formatting

* changed logic of cloud sync

* let BaseIdentityClientService handle all logging

* call sync from scheduled job on self host

* create bulk db operations for OrganizationSponsorships

* remove SponsoredOrgId from sync, return default from server http call

* validate BillingSyncKey during sync

revert changes to CreateSponsorshipCommand

* revert changes to ICreateSponsorshipCommand

* add some tests

* add DeleteExpiredSponsorshipsJob

* add cloud sync test

* remove extra method

* formatting

* prevent new sponsorships from disabled orgs

* update packages

* - pulled out send sponsorship command dependency from sync on cloud
- don't throw error when sponsorships are empty
- formatting

* formatting models

* more formatting

* remove licensingService dependency from selfhosted sync

* use installation urls and formatting

* create constructor for RequestModel and formatting

* add date parameter to OrganizationSponsorship_DeleteExpired

* add new migration

* formatting

* rename OrganizationCreateSponsorshipRequestModel to OrganizationSponsorshipCreateRequestModel

* prevent whole sync from failing if one sponsorship type is unsupported

* deserialize config and billingsynckey from org connection

* alter log message when sync disabled

* Add grace period to disabled orgs

* return early on self hosted if there are no sponsorships in database

* rename BillingSyncConfig

* send sponsorship offers from controller

* allow config to be a null object

* better exception handling in sync scheduler

* add ef migrations

* formatting

* fix tests

* fix validate test

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Fix OrganizationApiKey issues (#1941)

Co-authored-by: Justin Baur <admin@justinbaur.com>

* Feature/org sponsorship self hosted tests (#1947)

* Self-hosted side sync first pass

TODO:
* flush out org sponsorship model
* implement cloud side
* process cloud-side response and update self-hosted records

* sync scaffolding second pass

* remove list of Org User ids from sync and begin work on SelfHostedRevokeSponsorship

* allow authenticated http calls from server to return a result

* update models

* add logic for sync and change offer email template

* add billing sync key and hide CreateSponsorship without user

* fix tests

* add job scheduling

* add authorize attributes to endpoints

* separate models into data/model and request/response

* batch sync more, add EnableCloudCommunication for testing

* send emails in bulk

* make userId and sponsorshipType non nullable

* batch more on self hosted side of sync

* remove TODOs and formatting

* changed logic of cloud sync

* let BaseIdentityClientService handle all logging

* call sync from scheduled job on self host

* create bulk db operations for OrganizationSponsorships

* remove SponsoredOrgId from sync, return default from server http call

* validate BillingSyncKey during sync

revert changes to CreateSponsorshipCommand

* revert changes to ICreateSponsorshipCommand

* add some tests

* add DeleteExpiredSponsorshipsJob

* add cloud sync test

* remove extra method

* formatting

* prevent new sponsorships from disabled orgs

* update packages

* - pulled out send sponsorship command dependency from sync on cloud
- don't throw error when sponsorships are empty
- formatting

* formatting models

* more formatting

* remove licensingService dependency from selfhosted sync

* use installation urls and formatting

* create constructor for RequestModel and formatting

* add date parameter to OrganizationSponsorship_DeleteExpired

* add new migration

* formatting

* rename OrganizationCreateSponsorshipRequestModel to OrganizationSponsorshipCreateRequestModel

* prevent whole sync from failing if one sponsorship type is unsupported

* deserialize config and billingsynckey from org connection

* add mockHttp nuget package and use httpclientfactory

* fix current tests

* WIP of creating tests

* WIP of new self hosted tests

* WIP self hosted tests

* finish self hosted tests

* formatting

* format of interface

* remove extra config file

* added newlines

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Fix Organization_DeleteById (#1950)

* Fix Organization_Delete

* Fix L

* [PS-4] block enterprise user from sponsoring itself (#1943)

* [PS-248] Feature/add connections enabled endpoint (#1953)

* Move Organization models to sub namespaces

* Add Organization Connection api endpoints

* Get all connections rather than just enabled ones

* Add missing services to DI

* pluralize private api endpoints

* Add type protection to org connection request/response

* Fix route

* Use nullable Id to signify no connection

* Test Get Connections enabled

* Fix data discoverer

* Also drop this sproc for rerunning

* Id is the OUTPUT of create sprocs

* Fix connection config parsing

* Linter fixes

* update sqlproj file name

* Use param xdocs on methods

* Simplify controller path attribute

* Use JsonDocument to avoid escaped json in our response/request strings

* Fix JsonDoc tests

* Linter fixes

* Fix ApiKey Command and add tests (#1949)

* Fix ApiKey command

* Formatting

* Fix test failures introduced in #1943 (#1957)

* Remove "Did you know?" copy from emails. (#1962)

* Remove "Did you know"

* Remove jsonIf helper

* Feature/fix send single sponsorship offer email (#1956)

* Fix sponsorship offer email

* Do not sanitize org name

* PR feedback

* Feature/f4e sync event [PS-75] (#1963)

* Create sponsorship sync event type

* Add InstallationId to Event model

* Add combinatorics-based test case generators

* Log sponsorships sync event on sync

* Linter and test fixes

* Fix failing test

* Migrate sprocs and view

* Remove unused `using`s

* [PS-190] Add manual sync trigger in self hosted (#1955)

* WIP add button to admin project for billing sync

* add connection table to view page

* minor fixes for self hosted side of sync

* fixes number of bugs for cloud side of sync

* deserialize before returning for some reason

* add json attributes to return models

* list of sponsorships parameter is immutable, add secondary list

* change sproc name

* add error handling

* Fix tests

* modify call to connection

* Update src/Admin/Controllers/OrganizationsController.cs

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* undo change to sproc name

* simplify logic

* Update src/Core/OrganizationFeatures/OrganizationSponsorships/FamiliesForEnterprise/Cloud/CloudSyncSponsorshipsCommand.cs

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* register services despite if self hosted or cloud

* remove json properties

* revert merge conflict

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Update OrganizationSponsorship valid until when updating org expirati… (#1966)

* Update OrganizationSponsorship valid until when updating org expiration date

* Linter fixes

* [PS-7] change revert email copy and add ValidUntil to sponsorship (#1965)

* change revert email copy and add ValidUntil to sponsorship

* add 15 days if no ValidUntil

* Chore/merge/self hosted families for enterprise (#1972)

* Log swallowed HttpRequestExceptions (#1866)

Co-authored-by: Hinton <oscar@oscarhinton.com>

* Allow for utilization of  readonly db connection (#1937)

* Bump the pin of the download-artifacts action to bypass the broken GitHub api (#1952)

* Bumped version to 1.48.0 (#1958)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [EC-160] Give Provider Users access to all org ciphers and collections (#1959)

* Bumped version to 1.48.1 (#1961)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Avoid sending "user need confirmation" emails when there are no org admins (#1960)

* Remove noncompliant users for new policies (#1951)

* [PS-284] Allow installation clients to not need a user. (#1968)

* Allow installation clients to not need a user.

* Run formatting

Co-authored-by: Andrei <30410186+Manolachi@users.noreply.github.com>
Co-authored-by: Hinton <oscar@oscarhinton.com>
Co-authored-by: sneakernuts <671942+sneakernuts@users.noreply.github.com>
Co-authored-by: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Justin Baur <136baur@gmail.com>

* Fix/license file not found (#1974)

* Handle null license

* Throw hint message if license is not found by the admin project.

* Use CloudOrganizationId from Connection config

* Change test to support change

* Fix test

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Feature/f4e selfhosted rename migration to .sql (#1971)

* rename migration to .sql

* format

* Add unit tests to self host F4E (#1975)

* Work on tests

* Added more tests

* Run linting

* Address PR feedback

* Fix AssertRecent

* Linting

* Fixed empty tests

* Fix/misc self hosted f4e (#1973)

* Allow setting of ApiUri

* Return updates sponsorshipsData objects

* Bind arguments by name

* Greedy load sponsorships to email.

When upsert was called, it creates Ids on _all_ records, which meant
that the lazy-evaluation from this call always returned an empty list.

* add scope for sync command DI in job. simplify error logic

* update the sync job to get CloudOrgId from the BillingSyncKey

Co-authored-by: Jacob Fink <jfink@bitwarden.com>

* Chore/merge/self hosted families for enterprise (#1987)

* Log swallowed HttpRequestExceptions (#1866)

Co-authored-by: Hinton <oscar@oscarhinton.com>

* Allow for utilization of  readonly db connection (#1937)

* Bump the pin of the download-artifacts action to bypass the broken GitHub api (#1952)

* Bumped version to 1.48.0 (#1958)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* [EC-160] Give Provider Users access to all org ciphers and collections (#1959)

* Bumped version to 1.48.1 (#1961)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Avoid sending "user need confirmation" emails when there are no org admins (#1960)

* Remove noncompliant users for new policies (#1951)

* [PS-284] Allow installation clients to not need a user. (#1968)

* Allow installation clients to not need a user.

* Run formatting

* Use accept flow for sponsorship offers (#1964)

* PS-82 check send 2FA email for new devices on TwoFactorController send-email-login (#1977)

* [Bug] Skip WebAuthn 2fa event logs during login flow (#1978)

* [Bug] Supress WebAuthn 2fa event logs during login process

* Formatting

* Simplified method call with new paramter input

* Update RealIps Description (#1980)

Describe the syntax of the real_ips configuration key with an example, to prevent type errors in the `setup` container when parsing `config.yml`

* add proper URI validation to duo host (#1984)

* captcha scores (#1967)

* captcha scores

* some api fixes

* check bot on captcha attribute

* Update src/Core/Services/Implementations/HCaptchaValidationService.cs

Co-authored-by: e271828- <e271828-@users.noreply.github.com>

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: e271828- <e271828-@users.noreply.github.com>

* ensure no path specific in duo host (#1985)

Co-authored-by: Andrei <30410186+Manolachi@users.noreply.github.com>
Co-authored-by: Hinton <oscar@oscarhinton.com>
Co-authored-by: sneakernuts <671942+sneakernuts@users.noreply.github.com>
Co-authored-by: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Justin Baur <136baur@gmail.com>
Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Jordan Cooks <notnamed@users.noreply.github.com>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: e271828- <e271828-@users.noreply.github.com>

* Address feedback (#1990)

Co-authored-by: Justin Baur <admin@justinbaur.com>
Co-authored-by: Carlos Muentes <cmuentes@bitwarden.com>
Co-authored-by: Jake Fink <jfink@bitwarden.com>
Co-authored-by: Justin Baur <136baur@gmail.com>
Co-authored-by: Andrei <30410186+Manolachi@users.noreply.github.com>
Co-authored-by: Hinton <oscar@oscarhinton.com>
Co-authored-by: sneakernuts <671942+sneakernuts@users.noreply.github.com>
Co-authored-by: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Jordan Cooks <notnamed@users.noreply.github.com>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: e271828- <e271828-@users.noreply.github.com>
2022-05-10 16:12:09 -05:00
Thomas Rittson
1efb25608c
Fix ManageBilling permission check (#1988) 2022-05-10 16:37:13 +10:00
Thomas Rittson
227b725514
[EC-152] Hide Subscription/Billing information for Provider-managed organizations (#1970)
* Block billing endpoints if org is managed by Provider
2022-05-10 12:19:22 +10:00
Kyle Spearrin
06c9b123f9
ensure no path specific in duo host (#1985) 2022-05-09 16:00:00 -04:00
Kyle Spearrin
3ffd240287
captcha scores (#1967)
* captcha scores

* some api fixes

* check bot on captcha attribute

* Update src/Core/Services/Implementations/HCaptchaValidationService.cs

Co-authored-by: e271828- <e271828-@users.noreply.github.com>

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
Co-authored-by: e271828- <e271828-@users.noreply.github.com>
2022-05-09 12:25:13 -04:00
Kyle Spearrin
a5bfc0554b
add proper URI validation to duo host (#1984) 2022-05-09 12:00:05 -04:00
Vincent Salucci
8b1a6b4ad3
[Bug] Skip WebAuthn 2fa event logs during login flow (#1978)
* [Bug] Supress WebAuthn 2fa event logs during login process

* Formatting

* Simplified method call with new paramter input
2022-04-28 16:42:47 -05:00
Federico Maccaroni
a7a45893a3
PS-82 check send 2FA email for new devices on TwoFactorController send-email-login (#1977) 2022-04-28 13:14:09 -03:00
Matt Gibson
68f875b3d9
Use accept flow for sponsorship offers (#1964) 2022-04-27 11:03:14 -05:00
Justin Baur
972657f982
[PS-284] Allow installation clients to not need a user. (#1968)
* Allow installation clients to not need a user.

* Run formatting
2022-04-22 16:40:38 -04:00
Thomas Rittson
669d44c170
Remove noncompliant users for new policies (#1951) 2022-04-22 08:13:02 +10:00
Oscar Hinton
de997a2246
Avoid sending "user need confirmation" emails when there are no org admins (#1960) 2022-04-20 21:05:21 +02:00
Thomas Rittson
ec9dd8e16b
[EC-160] Give Provider Users access to all org ciphers and collections (#1959) 2022-04-20 09:59:00 +02:00
sneakernuts
d1e4a43964
Allow for utilization of readonly db connection (#1937) 2022-04-08 21:20:23 +00:00
Andrei
95acc79ebb
Log swallowed HttpRequestExceptions (#1866)
Co-authored-by: Hinton <oscar@oscarhinton.com>
2022-04-07 12:37:11 +02:00
sneakernuts
0e88720d3a
Logging config changes (#1935)
* Logging config changes

* Regenerated packages.lock.json files

* fixed up more typos and regenerated json
2022-04-05 15:19:16 +00:00
AHL
af152811af
Issue 1362: Proposed change for controllers parsing string GUIDs. (#1887)
Co-authored-by: alexanderhlee <alexanderhlee@gmail.com>
2022-04-05 10:08:37 +02:00
Vincent Salucci
9a1a7543c5
[euvr] Separate Billing Payment/History APIs (#1932)
* [euvr] Separate Billing Payment/History APIs

* Formatting

* Created AccountsBillingController // Deprecated GetBilling // Simplified PaymentService helpers

* Formatting
2022-04-04 11:40:28 -05:00
Federico Maccaroni
6f60d24f5a
Email verification for new devices (#1931)
* PS-56 Added Email 2FA on login with new devices that don't have any 2FA enabled

* PS-56 Fixed wrong argument in VerifyTwoFactor call
2022-04-01 17:08:47 -03:00
Lauren N. Liberda
971914871d
add some european takeaway domains to global domains (#1915) 2022-03-27 16:54:05 +02:00
Matt Gibson
860a552bc7
Fix swapped launch settings default (#1925) 2022-03-25 16:11:01 -04:00
Matt Gibson
4814cef245
Feature/self hosted development (#1921)
* Add self-host option to migration runner

* Add Self-host launch options

* Add self-hosted settings override

Let's a single secrets/env config file control both
cloud and self-hosted settings by allowing
overrides to cloud settings with self-hosted

* Allow dev-signed licenses on dev self-hosted

* Allow setting bitwarden cloud api url

Useful for testing api integration between installations and cloud

* Remove testing echoes

* Remove run config property groups

* Use `getopts` for options

* Pass in full environment
2022-03-21 17:13:00 -05:00
Matt Gibson
a8f55bc10d
Seek to origin of MemoryStream before use (#1918) 2022-03-16 10:38:13 -05:00
Oscar Hinton
e8cb8b67c9
Fix license signature containing LicenseType (#1917) 2022-03-16 16:15:36 +01:00
Matt Gibson
eee5caf1f8
Seek to origin of MemoryStream before use (#1916) 2022-03-16 10:01:16 -05:00
Matt Gibson
9a9c9d4bf6
Add error handling to identity accounts controller (#1909) 2022-03-14 20:08:01 -05:00
Chad Scharf
76ddcfa2dc
Fix org manager check on export (#1906)
* Fix org manager check on export

* Fix filter typo from collection to cipher
2022-03-14 15:34:22 -04:00
Vincent Salucci
7046aecfd5
[Captcha] BUG Add null checks | Make ceiling default to zero (#1903)
* [Captcha] BUG Add null checks | Make ceiling default to zero

* Formatting
2022-03-09 12:07:06 -06:00
Justin Baur
dd37745736
Fix OneLogin Import (#1899)
* Add PermissiveStringConverter

* Formatting

* Add value check

* Fix PR feedback

* Run formatter
2022-03-08 13:22:47 -05:00
Matt Gibson
a725802476
Handle null user in captch tokenable (#1897)
* Handle null user in captch tokenable

* Update test/Core.Test/Models/Business/Tokenables/HCaptchaTokenableTests.cs

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2022-03-08 08:21:54 -06:00
Robyn MacCallum
4deb138fd9
Ignore case on AutoEnrollEnabled so it is deserialized properly (#1900) 2022-03-07 16:53:30 -05:00
Oscar Hinton
a92d4f9bde
Cleanup node scripts (#1858) 2022-03-03 23:53:09 +01:00
Thomas Rittson
3443fe952b
Don't send default SsoConfigurationData to clients (#1879) 2022-03-04 07:09:55 +10:00
Robyn MacCallum
17b22ca5a9
Add attachments check before moving ciphers to a free org (#1890) 2022-03-02 17:37:36 -05:00
Vincent Salucci
19d5817f8f
[Captcha] Implement failed logins ceiling (#1870)
* [Hacker1] Failed Login Attempts Captcha

* [Captcha] Implement failed logins ceiling

* Formatting

* Updated approach after implementation talks with Kyle

* Updated email templates // Updated calling arch for failed attempts

* Formatting

* Updated 2fa email links

* Renamed baserequest methods to better match their actions

* EF migrations/scripts

* Updated with requested changes

* Defaults for MaxiumumFailedLoginAttempts
2022-03-02 15:45:00 -06:00
Kyle Spearrin
4cbe05da3c
SendGrid Mail Delivery Provider (#1892)
* add sendgrid mail delivery service

* <

* remove duplicate code

* fix test by using ISendGridClient interface
2022-03-01 19:09:51 -05:00
Chad Scharf
a7a39fb54d
CSA-6 Fix/remove artifact binding (#1885)
* Remove artifact binding, add validation

* Re-add JSON properties but eviscerate them
2022-02-28 13:43:49 -05:00
Oscar Hinton
95998292f7
Ensure we require premium for u2f (#1869) 2022-02-16 20:28:20 +01:00
Oscar Hinton
8d6c49f656
Add lock files for NuGet (#1855) 2022-02-10 15:40:31 +01:00
Justin Baur
1b0d18a7c5
Switch to Legacy Deserialization (#1851) 2022-02-09 10:39:45 -05:00
Oscar Hinton
f824a2aaf1
Revert to using newtonsoft for saving org TwoFactorProviders (#1850) 2022-02-09 14:46:37 +01:00
Oscar Hinton
e05fce18bd
Resolve being unable to configure duo (System.Text.Json) (#1847) 2022-02-09 14:12:31 +01:00
Oscar Hinton
2ed8be75dd
Fix organization duo 2fa not working due to switch to System.Text.Json (#1846) 2022-02-09 13:45:20 +01:00
Daniel James Smith
cecf052b33
Remove falsely added Microsoft.Azure.Storage.Blobs (#1845) 2022-02-09 13:32:40 +01:00
Oscar Hinton
9c98f0358b
Fix newtonsoft complaining about U2f keys (#1844) 2022-02-09 13:05:03 +01:00
Oscar Hinton
11144e70ea
Partial revert of #1803 since Azure.Cosmos still uses newtonsoft (#1843) 2022-02-09 13:04:55 +01:00
Justin Baur
b1cd42e394
Fix json only serializing base properties (#1840)
* Fix json only serializing base properties

* Run formatting

* Switch to returning concrete type

* Update method name
2022-02-07 10:28:11 -05:00
Oscar Hinton
f56d2ecae5
[Hotfix] Fix attachment download (#1841) 2022-02-07 15:46:20 +01:00
Oscar Hinton
cd61c826f9
[BEEEP] Add explicit error message when uploading the wrong license type (#1831) 2022-02-07 09:43:00 +01:00
Justin Baur
240b6e7463
Update File Size to allow null (#1839)
* Update File Size to allow null

* Remove unneeded nullable number
2022-02-03 13:23:43 -05:00
Matt Gibson
5f2da6e4b7
Fix/identity service model validation (#1837)
* Fix indentation

* Fix comment

* Extract ModelStateValidationFilter add to Indentity MVC opts

* Remove unnecessary base constructor call
2022-02-02 13:26:15 -06:00
Justin Baur
9e074bca49
Revert TwoFactorProviders to be saved with numerical value (#1828)
* Add enum key resolver

* Change tests to reflect changes
2022-02-02 14:21:11 -05:00
Matt Gibson
8ce4d56a91
Fix/f4e multiple sponsorships (#1838)
* Use sponosorship from validate to redeem

* Update tests

* Format
2022-02-02 12:59:47 -06:00
Vincent Salucci
452677e441
[Icons] Update not found image (#1836) 2022-02-01 23:09:24 -06:00
Addison Beck
1e68958b20
[bug] Adjust permissions logic for putting users to a collection (#1834) 2022-02-01 13:30:37 -05:00
Justin Baur
b47c30d4f4
Fix organization_license not reading camelCase (#1832)
* Fix organization_license not reading camelCase

* Fix formatting
2022-02-01 12:26:50 -05:00
Oscar Hinton
a9a5417350
Fix WebAuthn not working after move to System.Text.Json (#1818) 2022-01-24 18:13:43 +01:00
Oscar Hinton
ac8ca46f0f
Remove the u2f lib (#1820) 2022-01-24 12:14:04 +01:00
Justin Baur
5268f2781e
Start Migration from Newtonsoft.Json to System.Text.Json (#1803)
* Start switch to System.Text.Json

* Work on switching to System.Text.Json

* Main work on STJ refactor

* Fix build errors

* Run formatting

* Delete unused file

* Use legacy for two factor providers

* Run formatter

* Add TokenProviderTests

* Run formatting

* Fix merge issues

* Switch to use JsonSerializer

* Address PR feedback

* Fix formatting

* Ran formatter

* Switch to async

* Ensure Enums are serialized as strings

* Fix formatting

* Enqueue single items as arrays

* Remove CreateAsync method on AzureQueueService
2022-01-21 09:36:25 -05:00
Oscar Hinton
68a8092235
[Emergency Access] Add premium check (#1815) 2022-01-18 16:05:12 +01:00
Oscar Hinton
0def1830af
Move identity endpoints to Identity service (#1807) 2022-01-17 13:21:51 +01:00
Federico Maccaroni
56ee3bd290
Fix silent push notifications for iOS, it should not contain alert, badge nor sound keys in aps (#1808) 2022-01-14 10:52:50 -03:00
Justin Baur
486845242f
Fix EF bugs (#1791) 2022-01-13 15:38:05 -05:00
Oscar Hinton
e4a10aae27
Split out repositories to Infrastructure.Dapper / EntityFramework (#1759) 2022-01-11 10:40:51 +01:00
Matt Gibson
e2c6fc81f4
Feature/token service (#1785)
* Implement draft token service

* Add tokenizer and factory

* Handle expiring tokens through base class

* Allow direct token validity checks

* Add safe unprotect to tokenizer

* Add interface to tokenizer factory

* Use tokenizer

* Fix rebase

* Handle cleartext prefix in tokenizer base

* Use epoch milliseconds for expiration in tokens

* Use tokenizers

* Test tokens

* Linter fixes

* Add TokenizerFactory to DI services

* Test epoch milliseconds deserialization

* Use separate injectables for each token type

* Fix directory

* Add functional unprotect to token

* Fix namespace and correct object names

* Remove Tokenable interface

* Test remaining Tokens classes

* Dotnet format

* Fix sut provider errors with update

* Remove useless property

Co-authored-by: Hinton <oscar@oscarhinton.com>
2022-01-10 09:58:16 -06:00
Daniel James Smith
355bf2127b
Migrate deprecated Microsoft.Azure.Storage.Blob to Azure.Storage.Blobs (#1732)
* Migrate from deprecated Microsoft.Azure.Storage to Azure.Storage.Blobs

* Remove and order usings

* Do not fetch BlobProperties before uploading a new file.

* Save an api call by calling GetPropertiesAsync and catching an error instead of calling Exists first

* Formatted files

* Verified ContentLength is the correct blob property for file-size

* Use a generic Exception catch for file validation

* Added a catch all to the GetBlobCertificateAsync in case something throws

* Remove and sort using

* Changes after running dotnet-format

* Remove checks for CanGenerateSasUri
2021-12-22 19:47:35 +01:00
Justin Baur
bb34de74cb
Freshsales integration (#1782)
* Add FreshsalesController

* Add better errors

* Fix formatting issues

* Add comments

* Add Billing.Test to solution files

* Fix unit test

* Format code

* Address PR feedback
2021-12-22 13:27:52 -05:00