* modify grant_save sql script to migration and Auth SQL scripts to not use merge
* Update formatting for sql files
* Fix formatting for sql files
* Format using Prettier
* Rename 2024-01-03_00_FixGrantSave.sql to 2024-02-12_00_FixGrantSave.sql
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* [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
* [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>
* [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>
* 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
* 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>
* Create UserCipherDetails_v2 and update logic to remove AccessAll
* Create v2 variants of all sprocs that rely on it
* Add feature flag logic to call old or new sproc
* Make equivalent changes to EF queries
* Reverted accidental change that granted premium to Families 2019 plans
* Removed transaction and added a plan type index to organization
* Removed index
* Added IDs for organizations that should keep UsersGetPremium
* Updated to store IDs in temp table
* 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>
* AC-1828: Allow reseller to add all teams and enterprise orgs
* AC-1807: Only show provider-eligible plans on Organization edit
* Thomas' feedback
* Matt's feedback
* Upgrade to SDK v8
* Provide application properties
* Test adjustments
* Clean up tests
* Ensure project name is set
* Add a 'v' for Git tagging support
* Upgraded old 2019 plans to have the same features as 2020 and beyond
* Removed redundant test and moved additional test cases to GetByOrgIdAsync_SmNoneFreePlans_ReturnsNull
* Fixed issue where feature flag wasn't returning correct plans
* Resolved issue where getting plans would return a value that LINQ previously cached when feature flag was in a different state
---------
Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
* Add Organization_ReadOwnerEmailAddresses SPROC
* Add IOrganizationRepository.GetOwnerEmailAddressesById
* Add SendInvoiceUpcoming overload for multiple emails
* Update InvoiceUpcoming handler to send multiple emails
* Cy's feedback
* Updates from testing
Hardened against missing entity IDs in Stripe events in the StripeEventService. Updated ValidateCloudRegion to not use a refresh/expansion for the customer because the invoice.upcoming event does not have an invoice.Id. Updated the StripeController's handling of invoice.upcoming to not use a refresh/expansion for the subscription because the invoice does not have an ID.
* Fix broken test
* Add ability to fetch events by service account
* Extract GetDateRange into ApiHelpers util
* Add dapper implementation
* Add EF repo implementation
* Add authz handler case
* unit + integration tests for controller
* swap to read check
* Adding comments
* Fix integration tests from merge
* Enabled SM events controller for self-hosting
* Manually move finalization migrations
* Rename the migrations to adhere to current EDD process
* Updated future migration for dropping UnknownDeviceVerificationEnabled column on User
* Moving src/Sql/dbo_future to src/Sql/dbo
* Delete files asking to be deleted
* Fix tab
* Updated migration for User tables update store procedures
* Fix formatting
* Fix User.sql table end comma
* Remove the future scripts that were added back in as finalization scripts by https://github.com/bitwarden/server/pull/3192/files
---------
Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
Co-authored-by: Hinton <hinton@users.noreply.github.com>
* [PM-3779] Added IOrganizationDomainRepository.GetDomainByIdAndOrganizationIdAsync and SQL stored procedure
* [PM-3779] Changed GetOrganizationDomainByIdQuery to also take OrgId as a parameter. Updated existing unit tests and added new. Updated controller to match command changes
* [PM-3779] Removed type from url routes
* [PM-3779] Renamed IGetOrganizationDomainByIdAndOrganizationIdQuery to IGetOrganizationDomainByIdOrganizationIdQuery
* [PM-3779] Renamed GetOrganizationDomainByIdOrganizationIdQueryTests file and added more tests
* [AC-1654] Added IOrganizationConnectionRepository.GetByIdOrganizationIdAsync and modified OrganizationConnectionsController to use it to get a connection matching both Id and OrganizationId
* [AC-1654] Fixed unit tests
* Rename DbScripts_future and DbScripts_data_migrations
* Rename embeded folder name
* Remove new files from stale PR
---------
Co-authored-by: Michał Chęciński <mchecinski@bitwarden.com>
Co-authored-by: Michał Chęciński <michal.checinski@outlook.com>
* [SG-966] [SG-967] Add new cipher properties, update DB objects and create migrations (#2681)
* Updated cipher entity with two new columns
* Added sqlserver mifgration and updated applicable stored procedures and table
* Added EF Migrations
* Made changes to response model to include new column properties
* Fixed formatting
* Modified scripts to reflect suggestions made on PR
* Added column to cipher table using default
* Include constraint in create cipher table script
* Added key and forcerotatekey property to request model (#2716)
* Added key update on the Cipher_UpdateWithCollection stored procedure, ef (#2855)
* Added key and forceKeyRotation to BuildCiphersTable method (#2893)
* [PM-2211] Remove forceKeyRotation column (#2921)
* Removed forceKeyRotation column
* Adjusted date for migrtaion file
* Passed key column to update cipher script to update cipher key when it is rotated (#2967)
* [PM-2448] Update CipherDetails_Update SP to update attachment column (#2992)
* Updated the cipherdetails_update stored procedure to update the attachement column when encrypted with the cipher key
* Moved migration and renamed old migration file
* Fixed lint issues
* Fixed lint issues
* renamed sqlserver migration to have a more recent date
* [PM-2548] Added validation to edit and add attachments methods (#3130)
* PM-2548 Added validation to edit and add attachments methods
* PM-2548 Moved the validation to a private method
* PM-2548 Minor refactor
* Bumped up minimum version
* Bumped up minimum version
* Changed version for tests purposes
* Bumped up minimum version
* Updated encryption minimum version to match clients for QA.
* PM-3976 Passed Key column to update cipher on bulk edit (#3299)
* Updated minimum client version in preparation for release.
* Renamed migration with current date. (#3303)
---------
Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
Co-authored-by: gbubemismith <gsmithwalter@gmail.com>
Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
Co-authored-by: Carlos Gonçalves <carlosmaccam@gmail.com>