1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00
Commit Graph

944 Commits

Author SHA1 Message Date
b20b8099a7 [PM-5314] Upgrade MSSQL cumulative update (#3548)
* Upgrade MSSQL cumulative update

* Go to 24
2024-02-02 08:57:19 -05:00
7bf17a20f4 [AC-2104] Add flexible collections properties to provider organizations sync response (#3717) 2024-01-29 14:04:45 -06:00
bac06763f5 [AC-1682] Flexible collections: data migrations for deprecated permissions (#3437)
* [AC-1682] Data migrations for OrgUsers or Groups with AccessAll enabled

* [AC-1682] Added script to update [dbo].[CollectionUser] with [Manage] = 1 for all users with Manager role or 'EditAssignedCollections' permission

* [AC-1682] Updated sql data migration procedures with performance recommendations

* [AC-1682] Moved data migration scripts to DbScripts_transition folder

* Apply suggestions from code review: Remove Manage permission from Collection assignments

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

* [AC-1682] Removed unnecessary Collection table join on ManagersEditAssignedCollectionUsers sql script

* [AC-1682] Change JOIN to INNER JOIN in SQL scripts

* [AC-1682] Renamed sql script to recent date and added correct order to file name

* [AC-1682] Add new rows to CollectionUser for Managers and users with EditAssignedCollections permission assigned to groups with collection access

* [AC-1682] Update FC data migration scripts to clear AccessAll flags and set all Managers to Users

* [AC-1682] Updated data migration scripts to bump the account revision date

* [AC-1682] Created Organization_EnableCollectionEnhancements to migrate organization data for flexible collections

* [AC-1682] Added script to migrate all organization data for flexible collections

* [AC-1682] Deleted old data migration scripts

* Revert "[AC-1682] Deleted old data migration scripts"

This reverts commit 54cc6fab8f.

* [AC-1682] Modified AccessAllCollectionUsers script to bump revision date by each OrgUser

* [AC-1682] Update data migration script to only enable collection enhancements for organizations that have not yet migrated

* [AC-1682] Updated AccessAllCollectionGroups migration script to use User_BumpAccountRevisionDateByCollectionId

* [AC-1682] Bumped up the date on data migration scripts

* [AC-1682] Added back batching system to AccessAllCollectionUsers data migration script

* [AC-1682] Added data migration script to set FlexibleCollections = 1 for all orgs

* [AC-1682] Modified data migration script to contain multiple transactions

* [AC-1682] Deleted old data migration scripts

* [AC-1682] Placed temp tables outside transactions

* [AC-1682] Removed batching from AllOrgsEnableCollectionEnhancements script

* [AC-1682] Removed bulk data migration script

* [AC-1682] Refactor stored procedure to enable collection enhancements

* [AC-1682] Added missing where clause

* [AC-1682] Modified data migration script to have just one big transaction

* [AC-1682] Combining all updated OrganizationUserIds to bump all revision dates at the same time

* Update src/Sql/dbo/Stored Procedures/Organization_EnableCollectionEnhancements.sql

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

* [AC-1682] Renamed aliases

* [AC-1682] Simplified inner queries

* [AC-1682] Bumping each modified groups RevisionDate

* [AC-1682] Removed updating CollectionUser existing records with [ReadOnly] = 0 and [HidePasswords] = 0

* [AC-1682] Updating OrganizationUser RevisionDate

* [AC-1682] Updated the stored procedure file

* [AC-1682] Selecting distinct values to insert into CollectionUser table

* Revert "[AC-1682] Removed updating CollectionUser existing records with [ReadOnly] = 0 and [HidePasswords] = 0"

This reverts commit 086c88f3c6.

* [AC-1682] Bumped up the date on the migration script

* [AC-1682] Updating OrganizationUser RevisionDate

---------

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2024-01-25 14:08:09 +00:00
880ceafe9f [BEEEP] [SM-1059] Add missing auth table indexes to EF config (#3625)
* Add missing indexes to EF auth tables

* Add EF migrations
2024-01-17 10:42:43 -06:00
b97a1a9ed2 [PM-5519] [PM-5526] [PM-5624] [PM-5600] More Grant SQL fixes (#3668)
* SQLite scripts to apply autoincrementing Id key

* Drop erroneous Id column if created
2024-01-16 09:08:55 -05:00
8a0e90c3a1 [AC-1682] sqlite data migrations 2024-01-15 16:33:08 +00:00
2df5fe1340 [deps] SM: Update EntityFrameworkCore to v7.0.15 (#3666)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-12 16:30:23 -07:00
57cb97dc2d Merge branch 'ac/ac-1682/data-migrations-for-deprecated-permissions' into ac/ac-1682/ef-migrations 2024-01-12 18:35:26 +00:00
667f3cdd00 Merge branch 'main' into ac/ac-1682/data-migrations-for-deprecated-permissions 2024-01-12 18:35:03 +00:00
d5b41c1b51 [AC-1682] Updated postgres migrations 2024-01-12 15:33:35 +00:00
752e2c01ea [AC-1682] Updated mysql migrations 2024-01-12 15:01:01 +00:00
19fb7e583e [AC-1682] Bumped up the dates on the migration scripts 2024-01-12 12:54:34 +00:00
5c08d181a4 Merge branch 'main' into ac/ac-1682/ef-migrations 2024-01-12 12:02:14 +00:00
db4d7aa609 [PM-5519] [PM-5526] [PM-5624] [PM-5600] Tweak EF settings for MySQL grant auto-increment (#3662)
* Tweak EF settings for grant auto-increment

* Go back to zero generated default as that doesn't matter

* Explicit value generation callout

* Go with custom SQL for direct automatic increment

* Proper column creation

* Lint
2024-01-11 16:06:29 -05:00
96b5278d7c [AC-1682] Removed batching from AllOrgsEnableCollectionEnhancements script 2024-01-11 18:31:47 +00:00
c4ad7d72e8 [AC-1682] Placed temp tables outside transactions 2024-01-11 18:01:11 +00:00
3bf1b53536 [AC-1682] Deleted old data migration scripts 2024-01-11 17:43:39 +00:00
f78e28f037 [AC-1682] Modified data migration script to contain multiple transactions 2024-01-11 16:42:30 +00:00
ba06076577 [AC-1682] Added data migration script to set FlexibleCollections = 1 for all orgs 2024-01-11 14:41:16 +00:00
68c586f3c7 [AC-1682] Added back batching system to AccessAllCollectionUsers data migration script 2024-01-11 14:40:29 +00:00
8a5ea76d8d [AC-1682] Bumped up the date on data migration scripts 2024-01-11 14:04:51 +00:00
8cc889554d [AC-1682] Updated AccessAllCollectionGroups migration script to use User_BumpAccountRevisionDateByCollectionId 2024-01-11 13:58:45 +00:00
f4450c082c [AC-1682] Update data migration script to only enable collection enhancements for organizations that have not yet migrated 2024-01-11 13:05:46 +00:00
71978fe954 Merge branch 'main' into ac/ac-1682/data-migrations-for-deprecated-permissions 2024-01-11 12:15:40 +00:00
ee43767c84 [AC-1682] Modified AccessAllCollectionUsers script to bump revision date by each OrgUser 2024-01-11 12:15:36 +00:00
a214c60268 Revert "[AC-1682] Deleted old data migration scripts"
This reverts commit 54cc6fab8f.
2024-01-11 11:55:16 +00:00
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
3392ede534 [BEEEP][SM-1062] Add missing table indexes to EF config (#3628)
* Add missing EF indexes

* Add EF migrations

* move configs

* regenerate migrations
2024-01-10 12:03:16 -06:00
54cc6fab8f [AC-1682] Deleted old data migration scripts 2024-01-10 15:29:48 +00:00
0d8609a094 [AC-1682] Added script to migrate all organization data for flexible collections 2024-01-10 15:29:06 +00:00
dfc403243b [AC-1682] Created Organization_EnableCollectionEnhancements to migrate organization data for flexible collections 2024-01-10 15:05:22 +00:00
8bf17eb198 [AC-1682] Updated data migration scripts to bump the account revision date 2024-01-10 12:34:36 +00:00
fcd2dd380d [AC-1682] Update FC data migration scripts to clear AccessAll flags and set all Managers to Users 2024-01-10 11:34:31 +00:00
a480bd16e4 [BEEEP] [SM-1060] Add missing tools table indexes to EF config (#3626)
* Add missing indexes

* Add EF migrations
2024-01-09 09:46:45 -06:00
e7ce15fe1d Merge branch 'main' into ac/ac-1682/data-migrations-for-deprecated-permissions 2024-01-09 14:28:19 +00:00
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
e20f533b10 [AC-1985] Fix collection permissions when editing items (#3599)
* Fix broken cipher permissions in UserCipherDetails_V2

* Re-create all sprocs that reference UserCipherDetails_V2
2023-12-28 13:08:03 +10:00
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
Ike
9b50cf89b7 [PM-3505][PM-4587] Update Delete Organization and User SPROCs and EF methods (#3604)
* update Organization_DeleteById SPROC

* Add migration for user delete

* Updated delete methods for EF support

* added WITH RECOMPILE

* updating sprocs in sql project

* Add recompile
2023-12-27 07:08:49 -08:00
73a13150f7 [AC-1682] Sqlite migrations + dotnet format 2023-12-20 12:25:55 +00:00
86ba89f230 [AC-1682] Postgres migrations 2023-12-20 11:57:36 +00:00
c5f1be4d79 [AC-1682] MySql migrations 2023-12-19 19:49:57 +00:00
fc8606acab [AC-1682] mySql scripts formatting 2023-12-19 15:46:23 +00:00
5f1f7d6f23 [AC-1682] Added new mysql migration 2023-12-19 15:37:39 +00:00
87d420a5e1 Merge branch 'ac/ac-1682/data-migrations-for-deprecated-permissions' into ac/ac-1682/ef-migrations 2023-12-19 15:19:59 +00:00
69c0997f6c Merge branch 'main' into ac/ac-1682/data-migrations-for-deprecated-permissions 2023-12-18 20:53:10 +00:00
d2808b2615 Auth/PM-1658 - Dynamic Org Invite Link to accelerate users through org invite accept process (#3378)
* PM-1658 - Create User_ReadByEmails stored proc

* PM-1658 - Update UserRepository.cs with dapper and EF implementations of GetManyByEmailsAsync using new stored proc

* PM-1658 - OrganizationService.cs - Proved out that the new GetManyByEmailsAsync along with a hash set will allow me to generate a a dict mapping org user ids to a bool representing if they have an org user account or not.

* PM-1658 - OrganizationService.cs - re-implement all send invites logic as part of rebase

* PM-1658 - Add new User_ReadByEmails stored proc to SQL project

* PM-1658 - HandlebarsMailService.cs - (1) Remove unnecessary SendOrganizationInviteEmailAsync method as we can simply use the bulk method for one or more emails (2) Refactor BulkSendOrganizationInviteEmailAsync parameters into new OrganizationInvitesInfo class

* PM-1658 - OrganizationService.cs - rebase commit 2

* PM-1658 - rebase commit 3 - org service + IMailService conflicts resolved

* PM-1658 - Update HandlebarsMailService.cs and OrganizationUserInvitedViewModel.cs to include new query params required client side for accelerating the user through the org invite accept process.

* dotnet format

* PM-1658 - rebase commit 4 -  Fix broken OrganizationServiceTests.cs

* PM-1658 TODO cleanup

* PM-1658 - Remove noop for deleted method.

* rebase commit 5 - fix NoopMailService merge conflicts

* PM-1658 - Fix SQL formatting with proper indentations

* PM-1658 - Rename BulkSendOrganizationInviteEmailAsync to SendOrganizationInviteEmailsAsync per PR feedback

* PM-1658 - Per PR Feedback, refactor OrganizationUserInvitedViewModel creation to use new static factory function for better encapsulation of the creation process.

* PM-1658 - Rename OrganizationInvitesInfo.Invites to OrgUserTokenPairs b/c that just makes sense.

* PM-1658 - Per PR feedback, simplify query params sent down to client. Always include whether the user exists but only include the org sso identifier if it is meant to be used (b/c sso is enabled and sso required policy is on)

* dotnet format

* PM-1658 - OrganizationServiceTests.cs - Fix mysteriously failing tests - several tests were falling into logic which created n org users using the organizationUserRepository.CreateAsync instead of the organizationUserRepository.CreateManyAsync method.  This meant that I had to add a new mock helper to ensure that those created org users had valid and distinct guids to avoid aggregate exceptions due to my added dict in the latter parts of the invite process.

* PM-1658 - Resolve errors from mistakes made during rebase merge conflict resolutions

* PM-1658 - OrganizationServiceTests.cs - fix new test with mock to make guids unique.

* dotnet format

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2023-12-18 11:16:17 -05:00
7d718b677b [AC-1682] Add new rows to CollectionUser for Managers and users with EditAssignedCollections permission assigned to groups with collection access 2023-12-18 14:54:57 +00:00
2e9be13ffe [AC-1682] dotnet format 2023-12-17 21:28:30 +00:00
003b6dcc4d [AC-1682] Added EF migrations 2023-12-17 21:26:12 +00:00