a957530d5e
[AC-1682] Updated queries to check for OrganizationId
2024-03-29 14:10:57 +00:00
28bba94d81
[AC-1682] Setting FlexibleCollections = 1 only for Orgs that had data migrated in previous steps
2024-03-29 12:13:04 +00:00
7b54d78d67
[AC-1682] Removed MySql transaction from script because EF migration already wraps it under its own transaction
2024-03-29 12:03:29 +00:00
c20912f95c
[AC-1682] Drop temp tables if they exist when starting the scripts
2024-03-29 12:00:24 +00:00
26f5bf8afd
[AC-1682] Fixed Sqlite query
2024-03-28 14:50:02 +00:00
00eea0621c
[AC-1682] dotnet format
2024-03-25 15:28:46 +00:00
262887f9c3
[AC-1682] Added Sqlite migration and script
2024-03-25 15:22:17 +00:00
d6f7d94b22
[AC-1682] Removed Sqlite migrations and scripts
2024-03-22 15:46:31 +00:00
6c21d4e96a
Merge branch 'main' into ac/ac-1682/ef-migrations
2024-03-22 11:53:01 +00:00
9f7e05869e
[AC-1900] Update Vault DB to support provider billing ( #3875 )
...
* Add Gateway columns to Provider table
* Add ProviderId column to Transaction table
* Create ProviderPlan table
* Matt's feedback
* Rui's feedback
* Fixed Gateway parameter on Provider
2024-03-21 11:15:49 -04:00
997af0f6ab
[PM-221] Adding CipherId to the Send table, create/update sprocs, and added mi… ( #3646 )
...
* Adding CipherId to the Send table, create/update sprocs, and added migrations
* changing migrator script to drop create sprocs
* fixing double brackets
* Revert "changing migrator script to drop create sprocs"
This reverts commit 2d5171e7e5
.
* Remove comment I nitpicked
* Script best practices
* Fix typo
* Try recreate again
* Fix missing output
* Revert "Try recreate again"
This reverts commit 38257ebeaa
.
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com >
Co-authored-by: federicom09 <fmonesiglio@bitwarden.com >
2024-03-04 19:31:33 -05:00
0f3aa5d1ae
Merge branch 'main' into ac/ac-1682/ef-migrations
2024-02-26 13:32:30 +00:00
1499d1e2c6
[SM-713] Add database support for secret access policies ( #3681 )
...
* mssql add column and migration
* Add secret access policies to EF models and config
* Clear new access policies on service account delete
* Add SM cleanup code on delete
* Fix EF org user bulk delete
* Run EF migrations
2024-02-22 10:06:39 -06:00
4e6360cc4f
[deps] DbOps: Update EntityFrameworkCore ( #3823 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-20 09:42:30 -05:00
a24465b137
[AC-1682] Bumped up dates on EF migrations
2024-02-16 14:43:12 +00:00
6d1ead5b61
[AC-1682] Bumped up date on migration scripts
2024-02-16 13:09:58 +00:00
f7f692cf08
[AC-1682] Update RevisionDate in Group table
2024-02-16 12:51:13 +00:00
39e336eddd
Merge branch 'main' into ac/ac-1682/ef-migrations
...
# Conflicts:
# src/Sql/dbo/Stored Procedures/Organization_EnableCollectionEnhancements.sql
# util/SqliteMigrations/SqliteMigrations.csproj
2024-02-16 12:47:39 +00:00
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
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
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
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
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
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
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
73a13150f7
[AC-1682] Sqlite migrations + dotnet format
2023-12-20 12:25:55 +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
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
8bf798a79f
added webauthncredential ef migrations ( #3555 )
2023-12-13 07:03:42 -08:00
890a09804f
Stop using lockfiles ( #3550 )
2023-12-12 09:09:42 -05:00
43eea0d297
[deps] Billing: Update Braintree to v5.21.0 ( #3537 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-08 14:46:39 -05:00
62bf2a146f
[deps] Tools: Update MailKit to v4.3.0 ( #3533 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-08 18:21:26 +01:00
baafbe4576
[deps] Tools: Update SendGrid to v9.28.1 ( #3534 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-08 18:07:33 +01:00
3e323ae3d9
[deps] Platform: Update dotnet monorepo to v6.0.25 ( #3507 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-08 12:04:13 -05:00
3ecec808b6
[deps] Billing: Update Serilog.Extensions.Logging.File to v3 ( #3069 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-08 11:54:20 -05:00
26e6093c14
Bumped version to 2023.12.0 ( #3519 )
...
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com >
2023-12-05 10:55:20 -05:00
333a51b3f2
[deps] Tools: Update Handlebars.Net to v2.1.4 ( #3508 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-04 12:02:30 +01:00
85df9716d8
[deps] SM: Update EntityFrameworkCore ( #3494 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-30 16:49:15 -06:00
14bd7d1415
[deps] Billing: Update Newtonsoft.Json to v13.0.3 ( #3439 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-28 08:47:04 -05:00
959b2393b3
[deps] Billing: Update Serilog.Sinks.SyslogMessages to v2.0.9 ( #3456 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-28 08:41:44 -05:00
b062ab8043
[AC-1122] Add AllowAdminAccessToAllCollectionItems setting to Organizations ( #3379 )
...
* [AC-1117] Add manage permission (#3126 )
* Update sql files to add Manage permission
* Add migration script
* Rename collection manage migration file to remove duplicate migration date
* Migrations
* Add manage to models
* Add manage to repository
* Add constraint to Manage columns
* Migration lint fixes
* Add manage to OrganizationUserUserDetails_ReadWithCollectionsById
* Add missing manage fields
* Add 'Manage' to UserCollectionDetails
* Use CREATE OR ALTER where possible
* [AC-1374] Limit collection creation/deletion to Owner/Admin (#3145 )
* feat: update org table with new column, write migration, refs AC-1374
* feat: update views with new column, refs AC-1374
* feat: Alter sprocs (org create/update) to include new column, refs AC-1374
* feat: update entity/data/request/response models to handle new column, refs AC-1374
* feat: update necessary Provider related views during migration, refs AC-1374
* fix: update org create to default new column to false, refs AC-1374
* feat: added new API/request model for collection management and removed property from update request model, refs AC-1374
* fix: renamed migration script to be after secrets manage beta column changes, refs AC-1374
* fix: dotnet format, refs AC-1374
* feat: add ef migrations to reflect mssql changes, refs AC-1374
* fix: dotnet format, refs AC-1374
* feat: update API signature to accept Guid and explain Cd verbiage, refs AC-1374
* fix: merge conflict resolution
* [AC-1174] CollectionUser and CollectionGroup authorization handlers (#3194 )
* [AC-1174] Introduce BulkAuthorizationHandler.cs
* [AC-1174] Introduce CollectionUserAuthorizationHandler
* [AC-1174] Add CreateForNewCollection CollectionUser requirement
* [AC-1174] Add some more details to CollectionCustomization
* [AC-1174] Formatting
* [AC-1174] Add CollectionGroupOperation.cs
* [AC-1174] Introduce CollectionGroupAuthorizationHandler.cs
* [AC-1174] Cleanup CollectionFixture customization
Implement and use re-usable extension method to support seeded Guids
* [AC-1174] Introduce WithValueFromList AutoFixtureExtensions
Modify CollectionCustomization to use multiple organization Ids for auto generated test data
* [AC-1174] Simplify CollectionUserAuthorizationHandler.cs
Modify the authorization handler to only perform authorization logic. Validation logic will need to be handled by any calling commands/controllers instead.
* [AC-1174] Introduce shared CollectionAccessAuthorizationHandlerBase
A shared base authorization handler was created for both CollectionUser and CollectionGroup resources, as they share the same underlying management authorization logic.
* [AC-1174] Update CollectionUserAuthorizationHandler and CollectionGroupAuthorizationHandler to use the new CollectionAccessAuthorizationHandlerBase class
* [AC-1174] Formatting
* [AC-1174] Cleanup typo and redundant ToList() call
* [AC-1174] Add check for provider users
* [AC-1174] Reduce nested loops
* [AC-1174] Introduce ICollectionAccess.cs
* [AC-1174] Remove individual CollectionGroup and CollectionUser auth handlers and use base class instead
* [AC-1174] Tweak unit test to fail minimally
* [AC-1174] Reorganize authorization handlers in Core project
* [AC-1174] Introduce new AddCoreAuthorizationHandlers() extension method
* [AC-1174] Move CollectionAccessAuthorizationHandler into Api project
* [AC-1174] Move CollectionFixture to Vault folder
* [AC-1174] Rename operation to CreateUpdateDelete
* [AC-1174] Require single organization for collection access authorization handler
- Add requirement that all target collections must belong to the same organization
- Simplify logic related to multiple organizations
- Update tests and helpers
- Use ToHashSet to improve lookup time
* [AC-1174] Fix null reference exception
* [AC-1174] Throw bad request exception when collections belong to different organizations
* [AC-1174] Switch to CollectionAuthorizationHandler instead of CollectionAccessAuthorizationHandler to reduce complexity
* Fix improper merge conflict resolution
* fix: add permission check for collection management api, refs AC-1647 (#3252 )
* [AC-1125] Enforce org setting for creating/deleting collections (#3241 )
* [AC-1117] Add manage permission (#3126 )
* Update sql files to add Manage permission
* Add migration script
* Rename collection manage migration file to remove duplicate migration date
* Migrations
* Add manage to models
* Add manage to repository
* Add constraint to Manage columns
* Migration lint fixes
* Add manage to OrganizationUserUserDetails_ReadWithCollectionsById
* Add missing manage fields
* Add 'Manage' to UserCollectionDetails
* Use CREATE OR ALTER where possible
* [AC-1374] Limit collection creation/deletion to Owner/Admin (#3145 )
* feat: update org table with new column, write migration, refs AC-1374
* feat: update views with new column, refs AC-1374
* feat: Alter sprocs (org create/update) to include new column, refs AC-1374
* feat: update entity/data/request/response models to handle new column, refs AC-1374
* feat: update necessary Provider related views during migration, refs AC-1374
* fix: update org create to default new column to false, refs AC-1374
* feat: added new API/request model for collection management and removed property from update request model, refs AC-1374
* fix: renamed migration script to be after secrets manage beta column changes, refs AC-1374
* fix: dotnet format, refs AC-1374
* feat: add ef migrations to reflect mssql changes, refs AC-1374
* fix: dotnet format, refs AC-1374
* feat: update API signature to accept Guid and explain Cd verbiage, refs AC-1374
* feat: created collection auth handler/operations, added LimitCollectionCdOwnerAdmin to CurrentContentOrganization, refs AC-1125
* feat: create vault service collection extensions and register with base services, refs AC-1125
* feat: deprecated CurrentContext.CreateNewCollections, refs AC-1125
* feat: deprecate DeleteAnyCollection for single resource usages, refs AC-1125
* feat: move service registration to api, update references, refs AC-1125
* feat: add bulk delete authorization handler, refs AC-1125
* feat: always assign user and give manage access on create, refs AC-1125
* fix: updated CurrentContextOrganization type, refs AC-1125
* feat: combined existing collection authorization handlers/operations, refs AC-1125
* fix: OrganizationServiceTests -> CurrentContentOrganization typo, refs AC-1125
* fix: format, refs AC-1125
* fix: update collection controller tests, refs AC-1125
* fix: dotnet format, refs AC-1125
* feat: removed extra BulkAuthorizationHandler, refs AC-1125
* fix: dotnet format, refs AC-1125
* fix: change string to guid for org id, update bulk delete request model, refs AC-1125
* fix: remove delete many collection check, refs AC-1125
* fix: clean up collection auth handler, refs AC-1125
* fix: format fix for CollectionOperations, refs AC-1125
* fix: removed unnecessary owner check, add org null check to custom permission validation, refs AC-1125
* fix: remove unused methods in CurrentContext, refs AC-1125
* fix: removed obsolete test, fixed failling delete many test, refs AC-1125
* fix: CollectionAuthorizationHandlerTests fixes, refs AC-1125
* fix: OrganizationServiceTests fix broken test by mocking GetOrganization, refs AC-1125
* fix: CollectionAuthorizationHandler - remove unused repository, refs AC-1125
* feat: moved UserId null check to common method, refs AC-1125
* fix: updated auth handler tests to remove dependency on requirement for common code checks, refs AC-1125
* feat: updated conditionals/comments for create/delete methods within colleciton auth handler, refs AC-1125
* feat: added create/delete collection auth handler success methods, refs AC-1125
* fix: new up permissions to prevent excessive null checks, refs AC-1125
* fix: remove old reference to CreateNewCollections, refs AC-1125
* fix: typo within ViewAssignedCollections method, refs AC-1125
---------
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com >
* refactor: remove organizationId from CollectionBulkDeleteRequestModel, refs AC-1649 (#3282 )
* [AC-1174] Bulk Collection Management (#3229 )
* [AC-1174] Update SelectionReadOnlyRequestModel to use Guid for Id property
* [AC-1174] Introduce initial bulk-access collection endpoint
* [AC-1174] Introduce BulkAddCollectionAccessCommand and validation logic/tests
* [AC-1174] Add CreateOrUpdateAccessMany method to CollectionRepository
* [AC-1174] Add event logs for bulk add collection access command
* [AC-1174] Add User_BumpAccountRevisionDateByCollectionIds and database migration script
* [AC-1174] Implement EF repository method
* [AC-1174] Improve null checks
* [AC-1174] Remove unnecessary BulkCollectionAccessRequestModel helpers
* [AC-1174] Add unit tests for new controller endpoint
* [AC-1174] Fix formatting
* [AC-1174] Remove comment
* [AC-1174] Remove redundant organizationId parameter
* [AC-1174] Ensure user and group Ids are distinct
* [AC-1174] Cleanup tests based on PR feedback
* [AC-1174] Formatting
* [AC-1174] Update CollectionGroup alias in the sproc
* [AC-1174] Add some additional comments to SQL sproc
* [AC-1174] Add comment explaining additional SaveChangesAsync call
---------
Co-authored-by: Thomas Rittson <trittson@bitwarden.com >
* [AC-1646] Rename LimitCollectionCdOwnerAdmin column (#3300 )
* Rename LimitCollectionCdOwnerAdmin -> LimitCollectionCreationDeletion
* Rename and bump migration script
* [AC-1666] Removed EditAnyCollection from Create/Delete permission checks (#3301 )
* fix: remove EditAnyCollection from Create/Delete permission check, refs AC-1666
* fix: updated comment, refs AC-1666
* [AC-1669] Bug - Remove obsolete assignUserId from CollectionService.SaveAsync(...) (#3312 )
* fix: remove AssignUserId from CollectionService.SaveAsync, refs AC-1669
* fix: add manage access conditional before creating collection, refs AC-1669
* fix: move access logic for create/update, fix all tests, refs AC-1669
* fix: add CollectionAccessSelection fixture, update tests, update bad reqeuest message, refs AC-1669
* fix: format, refs AC-1669
* fix: update null params with specific arg.is null checks, refs Ac-1669
* fix: update attribute class name, refs AC-1669
* [AC-1713] [Flexible collections] Add feature flags to server (#3334 )
* Add feature flags for FlexibleCollections and BulkCollectionAccess
* Flag new routes and behaviour
---------
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com >
* Add joint codeownership for auth handlers (#3346 )
* [AC-1717] Update default values for LimitCollectionCreationDeletion (#3365 )
* Change default value in organization create sproc to 1
* Drop old column name still present in some QA instances
* Set LimitCollectionCreationDeletion value in code based on feature flag
* Fix: add missing namespace after merging in master
* Fix: add missing namespace after merging in master
* [AC-1683] Fix DB migrations for new Manage permission (#3307 )
* [AC-1683] Update migration script and introduce V2 procedures and types
* [AC-1683] Update repository calls to use new V2 procedures / types
* [AC-1684] Update bulk add collection migration script to use new V2 type
* [AC-1683] Undo Manage changes to more original procedures
* [AC-1683] Restore whitespace changes
* [AC-1683] Clarify comments regarding explicit column lists
* [AC-1683] Update migration script dates
* [AC-1683] Split the migration script for readability
* [AC-1683] Re-name SelectReadOnlyArray_V2 to CollectionAccessSelectionType
* [AC-1648] [Flexible Collections] Bump migration scripts before feature branch merge (#3371 )
* Bump dates on sql migration scripts
* Bump date on ef migrations
* [AC-1727] Add AllowAdminAccessToAllCollectionItems column to Organization table
* [AC-1720] Update stored procedures and views that query the organization table and new column
* [AC-1727] Add EF migrations for new DB column
* [AC-1729] Update API request/response models
* [AC-1122] Add new setting to CurrentContextOrganization.cs
* [AC-1122] Ensure new setting is disabled for new orgs when the feature flag is enabled
* [AC-1122] Use V1 feature flag for new setting
* [AC-1122] Formatting
* [AC-1122] Update migration script date
---------
Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com >
Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com >
Co-authored-by: Vincent Salucci <vincesalucci21@gmail.com >
Co-authored-by: Thomas Rittson <trittson@bitwarden.com >
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com >
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com >
2023-11-27 11:44:07 -08:00
636a7646a3
Bumped version to 2023.10.3 ( #3462 )
...
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com >
2023-11-21 11:43:57 -05:00
87fd4ad97d
[PM-3569] Upgrade to Duende.Identity ( #3185 )
...
* Upgrade to Duende.Identity
* Linting
* Get rid of last IdentityServer4 package
* Fix identity test since Duende returns additional configuration
* Use Configure
PostConfigure is ran after ASP.NET's PostConfigure
so ConfigurationManager was already configured and our HttpHandler wasn't
being respected.
* Regenerate lockfiles
* Move to 6.0.4 for patches
* fixes with testing
* Add additional grant type supported in 6.0.4 and beautify
* Lockfile refresh
* Reapply lockfiles
* Apply change to new WebAuthn logic
* When automated merging fails me
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com >
Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com >
2023-11-20 16:32:23 -05:00