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

1922 Commits

Author SHA1 Message Date
Kyle Spearrin
6174df0874
[PM-6196] Cleanup distributed cache for identity (#3704)
* cleanup distributed cache for identity

* removed unused using

* use persistent IDistributedCache
2024-02-09 07:43:28 -05:00
Shane Melton
636f716d62
[AC-1124] Restrict admins from accessing items in Collections tab (#3676)
* [AC-1124] Add GetManyUnassignedOrganizationDetailsByOrganizationIdAsync to the CipherRepository

* [AC-1124] Introduce IOrganizationCiphersQuery.cs to replace some CipherService queries

* [AC-1124] Add additional CipherDetails model that includes CollectionIds

* [AC-1124] Update CiphersController and response models
- Add new endpoint for assigned ciphers
- Update existing endpoint to only return all ciphers when feature flag is enabled the user has access

* [AC-1124] Add migration script

* [AC-1124] Add follow up ticket for Todos

* [AC-1124] Fix feature service usage after merge with main

* [AC-1124] Optimize unassigned ciphers query

* [AC-1124] Update migration script date

* [AC-1124] Update migration script date

* [AC-1124] Formatting
2024-02-08 14:07:58 -08:00
Kyle Spearrin
9ecc4794fe
[PM-6177] Persistent distributed cache using Cosmos (#3772)
* cosmos distributed cache

* rename container to default
2024-02-08 14:34:53 -05:00
Kyle Spearrin
3e73f1cb4a
[PM-6167] Remove cosmos logging sink (#3769)
* get rid of cosmos logging sink

* remove logs from layout

* delete log models

* remove logs_view permission

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2024-02-08 18:35:45 +00:00
Vincent Salucci
d29755de5a
[AC-1880] Public API - Deprecated properties (#3706)
* feat: remove required for AccessAll and add xmldoc for usage restrictions, refs AC-1880

* feat: add validation for create group workflow wrt manage property, refs AC-1880

* feat: add validation for update group workflow wrt manage property, refs AC-1880

* feat: add validation for create and update member workflow wrt manage property, refs AC-1880

* feat: add validation for update collection workflow wrt manage property, refs AC-1880

* fix: flaky Public/GroupsControllerTests + more test coverage, refs AC-1880
2024-02-08 07:44:36 -06:00
Kyle Spearrin
7747744ff9
[PM-6153] Dedicated redis connection for rate limiter (#3763)
* rearrange how redis is registered

* separate redis connection string for rate limiter
2024-02-07 17:38:18 -05:00
renovate[bot]
039d3cbce7
[deps] Auth: Update Otp.NET to v1.3.0 (#3605)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-07 17:37:10 -05:00
Kyle Spearrin
a019355ab4
[PM-6141] Remove rate limiting ip blocker (#3754)
* remove rate limiting ip blocker

* remove using

* fix tests
2024-02-07 12:23:26 -05:00
Kyle Spearrin
6e6b50fd86
update rate limiter library (#3756)
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2024-02-07 12:23:05 -05:00
Kyle Spearrin
fc1d7c7059
[PM-3561] Clean the return url of any whitespace (#3696)
* clean the return url of any whitespace

* ReplaceWhiteSpace helper

* tests for ReplaceWhiteSpace helper

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2024-02-06 13:30:37 -05:00
renovate[bot]
88befc393a
[deps] DbOps: Update Microsoft.Data.SqlClient to v5.1.5 (#3749)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 17:07:31 -05:00
renovate[bot]
2df7e3127f
[deps] Tools: Update Microsoft.Extensions.Configuration to v8 (major) (#3741)
* [deps] Tools: Update Microsoft.Extensions.Configuration to v8

* Bump missing updates on integration tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-02-05 22:39:16 +01:00
Colton Hurst
7cbe888b82
SM-1012: Removing SM Beta (Phase 2) (#3663)
* SM-1012: Phase 2, removing SM Beta from the server (but not db)

* SM-1012: Add migration for RemoveSMBetaFromOrganization

* SM-1012: Dotnet format

* SM-1012: Undo RemoveSMBetaFromOrganization EF migration

* SM-1012: Redo RemoveSMBetaFromOrganization EF migration

* SM-1012: Ran dotnet format
2024-02-05 15:51:31 -05:00
Matt Bishop
ae1fdb0992
[PM-5052] Upgrade to .NET 8 (#3461)
* Upgrade to .NET 8

* Linting

* Clean up old JSON deserialization code

* More .NET 8-oriented linting

* Light feedback

* Get rid of old test we don't know the root issue for

* Fix a new test

* Remove now-unnecessary Renovate constraint

* Use Any()

* Somehow a 6.0 tooling config we don't need snuck back in

* Space out properties that always change per release

* Bump a few core packages since the last update
2024-02-05 13:03:42 -05:00
renovate[bot]
6c3356c73f
[deps] Tools: Update aws-sdk-net monorepo to v3.7.300.46 (#3738)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 13:09:13 +01:00
Conner Turnbull
9a1519f131
[PM-5766] Automatic Tax Feature Flag (#3729)
* Added feature flag constant

* Wrapped Automatic Tax logic behind feature flag

* Only getting customer if feature is anabled.

* Enabled feature flag in unit tests

* Made IPaymentService scoped

* Added missing StripeFacade calls
2024-02-01 13:21:17 -05:00
renovate[bot]
34c4a5df5d
[deps] Tools: Update SendGrid to v9.29.1 (#3727)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-01 10:27:25 +00:00
renovate[bot]
f7cf989b24
[deps] Tools: Update aws-sdk-net monorepo to v3.7.300.43 (#3726)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-31 18:11:31 +01:00
Alex Morask
2ad4bb8a79
[AC-1980] Upgrade Stripe.net (#3596)
* Upgrade Stripe.net

* Don't process mismatched version webhooks

* Manually handle API mismatch in Stripe webhook

* Pivot webhook secret off webhook version
2024-01-31 08:19:29 -05:00
Todd Martin
6ebb408a97
[PM-5638] Update minimum version for vault item encryption to 2024.2.0 (#3718) 2024-01-29 16:16:54 -05:00
Rui Tomé
7bf17a20f4
[AC-2104] Add flexible collections properties to provider organizations sync response (#3717) 2024-01-29 14:04:45 -06:00
Conner Turnbull
d7de5cbf28
[AC-1843] Automate PM discount for SM Trial (#3661)
* Added appliesTo to customer discount. Added productId to subscription item

* Added IsFromSecretsManagerTrial flag to add discount for SM trials

* Fixed broken tests

---------

Co-authored-by: Alex Morask <amorask@bitwarden.com>
2024-01-29 11:10:27 -05:00
Conner Turnbull
a2e6550b61
[PM-5766] Enabled Automatic Tax for all customers (#3685)
* Removed TaxRate logic when creating or updating a Stripe subscription and replaced it with AutomaticTax enabled flag

* Updated Stripe webhook to update subscription to automatically calculate tax

* Removed TaxRate unit tests since Stripe now handles tax

* Removed test proration logic

* Including taxInfo when updating payment method

* Adding the address to the upgrade free org flow if it doesn't exist

* Fixed failing tests and added a new test to validate that the customer is updated
2024-01-29 09:48:59 -05:00
Todd Martin
114b72d738
[PM-5638] Bump minimum client version for vault item encryption (#3711)
Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
2024-01-26 17:00:37 -05:00
Todd Martin
2763345e9e
[PM-3777[PM-3633] Update minimum KDF iterations when creating new User record (#3687)
* Updated minimum iterations on new Users to the default.

* Fixed test I missed.
2024-01-25 10:59:53 -05:00
Andreas Coroiu
c4625c6c94
[PM-5819] fix: return empty string if name is null (#3691) 2024-01-25 14:50:13 +01:00
Thomas Rittson
10f590b4e7
[AC-2026] Add flexible collections opt-in endpoint (#3643)
Stored procedure to be added in AC-1682
2024-01-25 16:57:57 +10:00
Ike
0deb13791a
[PM-4614] Updating Duo to SDK v4 for Universal Prompt (#3664)
* added v4 updates

* Fixed packages.

* Null checks and OrganizationDuo

* enable backwards compatibility support

* updated validation

* Update DuoUniversalPromptService.cs

add JIRA ticket for cleanup

* Update BaseRequestValidator.cs

* updates to names and comments

* fixed tests

* fixed validation errros and authURL

* updated naming

* Filename change

* Update BaseRequestValidator.cs
2024-01-24 10:13:00 -08:00
Matt Gibson
8dc8b681bb
Vault/pm 4185/checksum uris (#3418)
* Add checksum to Login Uri models

* Revert "Revert "Add checksum to Login Uri models (#3318)" (#3417)"

This reverts commit b44887d125.

* PM-4810 Bumped up minimum version

---------

Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
Co-authored-by: Carlos Gonçalves <carlosmaccam@gmail.com>
2024-01-24 17:23:09 +00:00
Shane Melton
e6bb6e1114
[PM-5788] Ensure Collection Service respects Flexible Collections falg (#3686)
* [PM-5788] Ensure the organization has FC enabled before enforcing a user/group with Manage permissions

* [PM-5788] Fix unit test
2024-01-22 08:05:42 -08:00
Thomas Rittson
77698c3ee2
[AC-2052] Block Manager role and AccessAll if using FlexibleCollections (#3671)
* Also don't assign AccessAll to the first orgUser if using Flexible Collections
2024-01-22 08:56:20 +10:00
Kyle Spearrin
4b6299a055
[PM-5149] unique SP entity id for organization sso configs (#3520)
* org specific sp entity id

* updates

* dont default true
2024-01-18 16:54:01 -05:00
Oscar Hinton
ef359c3cf1
[PM-5566] Remove U2F keys from TwoFactorProviders (#3645)
* Remove U2F keys from TwoFactorProviders

* Remove U2f from Premium check.
2024-01-18 11:54:57 -05:00
Matt Bishop
974d23efdd
Establish IFeatureService as scoped (#3679)
* Establish IFeatureService as scoped

* Lint

* Feedback around injection
2024-01-18 09:47:34 -05:00
renovate[bot]
cd006f3779
[deps] Platform: Update Microsoft.Data.SqlClient to v5.1.4 (#3680)
* [deps] Platform: Update Microsoft.Data.SqlClient to v5.1.4

* Remove Explicit Dep

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2024-01-17 15:43:40 -05:00
Thomas Rittson
96f9fbb951
[AC-2027] Update Flexible Collections logic to use organization property (#3644)
* Update optionality to use org.FlexibleCollections

Also break old feature flag key to ensure it's never enabled

* Add logic to set defaults for collection management setting

* Update optionality logic to use org property

* Add comments

* Add helper method for getting individual orgAbility

* Fix validate user update permissions interface

* Fix tests

* dotnet format

* Fix more tests

* Simplify self-hosted update logic

* Fix mapping

* Use new getOrganizationAbility method

* Refactor invite and save orgUser methods

Pass in whole organization object instead of using OrganizationAbility

* fix CipherService tests

* dotnet format

* Remove manager check to simplify this set of changes

* Misc cleanup before review

* Fix undefined variable

* Refactor bulk-access endpoint to avoid early repo call

* Restore manager check

* Add tests for UpdateOrganizationLicenseCommand

* Add nullable regions

* Delete unused dependency

* dotnet format

* Fix test
2024-01-17 12:33:35 +00:00
renovate[bot]
ef37cdc71a
[deps] Billing: Update Braintree to v5.23.0 (#3678)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-16 15:47:26 -05:00
Alex Morask
95139def0f
[AC-1758] Implement RemoveOrganizationFromProviderCommand (#3515)
* Add RemovePaymentMethod to StripePaymentService

* Add SendProviderUpdatePaymentMethod to HandlebarsMailService

* Add RemoveOrganizationFromProviderCommand

* Use RemoveOrganizationFromProviderCommand in ProviderOrganizationController

* Remove RemoveOrganizationAsync from ProviderService

* Add RemoveOrganizationFromProviderCommandTests

* PR review feedback and refactoring

* Remove RemovePaymentMethod from StripePaymentService

* Review feedback

* Add Organization RisksSubscriptionFailure endpoint

* fix build error

* Review feedback

* [AC-1359] Bitwarden Portal Unlink Provider Buttons (#3588)

* Added ability to unlink organization from provider from provider edit page

* Refreshing provider edit page after removing an org

* Added button to organization to remove the org from the provider

* Updated based on product feedback

* Removed organization name from alert message

* Temporary logging

* Remove coupon from Stripe org after disconnected from MSP

* Updated test

* Change payment terms on org disconnect from MSP

* Set Stripe account email to new billing email

* Remove logging

---------

Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
2024-01-12 10:38:47 -05:00
Matt Bishop
23f9d2261d
[PM-5548] Eliminate in-app purchase logic (#3640)
* Eliminate in-app purchase logic

* Totally remove obsolete and unused properties / types

* Remove unused enum values

* Restore token update
2024-01-11 15:26:32 -05:00
Todd Martin
b9c6e00c2d
[PM-5659] Add null check on policy query when building invite link (#3659)
* Added null check on policy query.

* PM-5659 - OrganizationServiceTests.cs - Add test for scenario in which an org has never turned on the RequireSSO policy and it will be null

* dotnet format

---------

Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2024-01-11 09:58:15 -05:00
Thomas Rittson
b829812a3f
[AC-2025] Add Organization.FlexibleCollections to database and sprocs (#3642)
* Add Organization.FlexibleCollections property and column

* Add new property to OrganizationAbility

* Add SQL and EF migrations
2024-01-11 13:25:57 +10:00
Kyle Spearrin
a6db79f613
[PM-5645] Cosmos DB Grant Storage (#3634)
* table storage grants

* simple shard on storage accounts

* use is not

* cosmos grant repo

* remove single storage connection string

* some fixes to dapper grant repo

* pattern matching

* add fallback to base PersistedGrantStore

* service collection extension cleanup

* cleanup

* remove unused Id

* empty string rowkey

* fix sharding method logic

* ttl for cosmos

* make ttl an int

* fixes to cosmos implementation

* fix partition key values

* catch notfound exceptions

* indenting

* update grantitem with custom serialization

* use new transform helpers

* grantloader perf test tool

* ref

* remove grant loader project

* remove table storage implementation

* remove table storage stuff

* all redis fallback to build to null

* revert sln file change

* EOF new line

* remove trailing comma

* lint fixes

* add grant to names

* move cosmos serilaizer to utils

* add some .net 8 keyed service comments

* EnableContentResponseOnWrite

* Fix type in EF grant repository
2024-01-10 12:59:16 +00:00
renovate[bot]
8daa754ecb
[deps] Tools: Update aws-sdk-net monorepo to v3.7.300.31 (#3649)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-08 13:36:01 +01:00
Will Martin
c553ec6aa0
[AC-1389] [AC-1919] Only require CanManage permission when admins cannot access all items (#3530)
* move this error behind the Flexible Collections v1 flag instead of MVP
* only enforce this requirement if organization.allowAdminAccessToAllCollectionItems is false

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2024-01-05 11:56:59 +10:00
renovate[bot]
061253e428
[deps] Tools: Update aws-sdk-net monorepo to v3.7.300.28 (#3536)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-03 13:44:33 +01:00
renovate[bot]
bfa9269b42
[PM-5294][deps]: Update Duende.IdentityServer to v6.3.7 (#3499)
* [deps]: Update Duende.IdentityServer to v6.3.6

* Fix test

* Grant table changes

* Reassert view

* EF migrations

* Restore non-null key and simpler index

* Master SQL sync

* Lint

* Fix ID setting since the property isn't exposed

* Bump to .7

* Point to new Duende package

* Drop unused indexes first

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2023-12-28 15:04:45 -05:00
SmithThe4th
be842c762c
Revert "Updated minimum version. (#3613)" (#3621)
This reverts commit 2ab35e389c.
2023-12-28 10:45:43 -05:00
Vincent Salucci
71def39015
[AC-1809] Update OrganizationAbility with Collection Management Settings (#3571)
* feat: Update OrganizationAbility with LimitCollectionCreationDeletion, refs AC-1809

* feat: Update OrganizationAbility constructor usage to pass feature flag state, refs AC-1809

* feat: Update EF retrieval of org abilities to include new property from database, refs AC-1809

* feat: Update sproc to include LimitCollectionCreationDeletion property and create migration, refs AC-1809

* feat: Inject ApplicationCache into handler accessing LimitCollectionCreationDeletion, refs AC-1809

* feat: remove collection management settings from CurrentContextOrganization and update tests, refs AC-1809

* feat: add AllowAdminAccessToAllCollectionItems to OrganizationAbility pipeline, refs AC-1809

---------

Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-12-28 10:07:06 +10:00
Todd Martin
2ab35e389c
Updated minimum version. (#3613) 2023-12-27 12:26:42 -05:00
Alex Morask
c60f260c0f
[AC-1754] Provide upgrade flow for paid organizations (#3468)
* wip

* Add CompleteSubscriptionUpdate

* Add AdjustSubscription to PaymentService

* Use PaymentService.AdjustSubscription in UpgradeOrganizationPlanCommand

* Add CompleteSubscriptionUpdateTests

* Remove unused changes

* Update UpgradeOrganizationPlanCommandTests

* Fixing missing usings after master merge

* Defects: AC-1958, AC-1959

* Allow user to unsubscribe from Secrets Manager and Storage during upgrade

* Handled null exception when upgrading away from a plan that doesn't allow secrets manager

* Resolved issue where Teams Starter couldn't increase storage

---------

Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
2023-12-27 09:30:23 -05:00