1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-23 20:41:04 -05:00

1040 Commits

Author SHA1 Message Date
tangowithfoxtrot
88159d16bb
Merge branch 'main' into test-container-workflow-changes 2025-05-21 07:27:59 -07:00
tangowithfoxtrot
6d9739f1cb
build: update migrator to use simpler build; apply consistent spacing 2025-05-19 13:45:06 -07:00
tangowithfoxtrot
8e399b8396
fmt: apply consistent spacing and rm redundant WORKDIR directive 2025-05-19 13:43:58 -07:00
tangowithfoxtrot
50df44ba87
fix: add missing build args to remaining images 2025-05-19 13:42:24 -07:00
tangowithfoxtrot
9d4a96b078
build: restore previous method for getting the GIT_HASH 2025-05-19 11:20:42 -07:00
tangowithfoxtrot
30369d9a8a
build: optimize for simpler builds over caching 2025-05-19 10:52:07 -07:00
Brandon Treston
81bff5e5cf
[PM-11622] use organization domains (#5560)
* DBO changes

* Add migration scripts

* wip

* wip

* wip

* add EF migrations

* run dotnet format

* cleanup

* revert business logic

* wip

* add update statement to mssql migration script

* fix user service tests

* increment license, add UseOrganizationDomains

* add migration helpers to seed initial value from UseSso

* clean up

* cleanup

* fix mssql migrations

* fix license version and test

* fix file names

* fix license json

* add missing property to license test

* rename file

* fix migrations

* fix migration

* add WHERE to helper scripts

* separate schema/data migrations

* restore comment

* Merge conflict

* fix migrations

* add new property to migration

* wip

* fix file names

* fix file name
2025-05-15 10:42:51 -04:00
cyprain-okeke
e4359f071c
[PM-21097] Fix: Prevent admin-added sponsored families from appearing in individual vault settings (#5767)
* Changes to resolve sponsorship showing in individual vault

* Resolve the failing unit test

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the failing test

* Resolve the failing test

* Resolve the failing test

* fix make IsAdminInitiated nullable

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Add the isAdminInitiated property

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the database error

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the failing unit test

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the scan error

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>

* Resolve the database issue

* resolve the database build error

* Resolve the database build error

* Resolve the synchronization issue

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2025-05-12 18:21:07 +01:00
Todd Martin
80e7a0afd6
chore(captcha): [PM-15162] Remove captcha enforcement and issuing of bypass token
* Remove captcha enforcement and issuing/verification of bypass token

* Removed more captcha logic.

* Removed logic to enforce failed login attempts

* Linting.

* Fixed order of initialization.

* Fixed merge conflicts

* Renamed registration finish response for clarity

* Remove unnecessary mailService references.
2025-05-09 10:44:38 -04:00
Oscar Hinton
5f7e2b8a81
[PM-21075] Initial database seeder (#5703)
Adds a database seeder which can be used standalone using a CLI for seeding your local development environment, or used in unit tests to seed complex scenarios.

---------

Co-authored-by: Robert Y <rkac@bitwarden.com>
2025-05-09 15:00:26 +02:00
tangowithfoxtrot
136f32ec7b
remove missing error message in log 2025-05-07 14:14:18 -07:00
tangowithfoxtrot
50e2db716d
re-add error log for installation id 2025-05-07 14:12:54 -07:00
tangowithfoxtrot
e2da4cc541
remove unused code 2025-05-07 14:11:03 -07:00
Justin Baur
5fedad91a3
Revert "Use IHttpClientFactory in more places"
This reverts commit 284501a4932b819b093406e0bcdf76def22b6eea.
2025-05-07 16:53:31 -04:00
Justin Baur
b1efa88c6d
Remove X509ChainCustomization activation code 2025-05-06 13:39:10 -04:00
tangowithfoxtrot
05e58cb9e4
fix: add SSL_CERT_DIR to remaining images 2025-05-06 10:22:32 -07:00
tangowithfoxtrot
b6322dd764
fix: try using .net core certificate handling 2025-05-06 10:12:23 -07:00
tangowithfoxtrot
0ad1f2f5fb
fix: missing gosu command for rootful mode 2025-05-05 13:25:45 -07:00
Justin Baur
2ec431557c
Add IConfiguration 2025-05-05 15:54:07 -04:00
Justin Baur
acae59429b
Add other services 2025-05-03 14:10:28 -04:00
Justin Baur
49ad409999
Fix my build error 2025-05-02 16:50:41 -04:00
Justin Baur
69082bab8a
Add SelfHosted GlobalSettings for Setup 2025-05-02 16:18:58 -04:00
tangowithfoxtrot
b30edc5416
fix: compatibility with existing run.sh script 2025-05-02 08:39:43 -07:00
tangowithfoxtrot
948a79952f
fix: compatibility with the existin run.sh script 2025-05-02 08:39:22 -07:00
Justin Baur
284501a493
Use IHttpClientFactory in more places 2025-05-01 08:59:15 -04:00
tangowithfoxtrot
7a99f5dc5d
Revert "build: we don't need to copy the .git dir"
This reverts commit 32c2f6236a894534de09ffe847ffff064a7174bd.
2025-04-30 13:35:38 -07:00
tangowithfoxtrot
32c2f6236a
build: we don't need to copy the .git dir 2025-04-30 13:28:09 -07:00
tangowithfoxtrot
761e794f7f
Merge branch 'main' into feat/pm-14496-non-root-self-hosted-images 2025-04-30 12:44:44 -07:00
Shane Melton
92701d8cd0
[PM-20550] Add JSON validation to Cipher Delete/Update attachment sprocs (#5656)
* Add JSON validation to Cipher Delete/Update attachment sprocs

* Remove [Attachment] assignment from cipher create/update sprocs

* Add additional validation and use JSON_PATH_EXISTS for delete sproc check

* Update migration script date
2025-04-30 08:43:39 -07:00
Conner Turnbull
7ebf312b84
Updated seat count logic to ensure that only the correct sponsorships are counted towards the seat count (#5711) 2025-04-30 07:19:28 -04:00
renovate[bot]
75c49f5cbc
[deps] DbOps: Pin dependencies (#5715)
* [deps] DbOps: Pin dependencies

* You don't pin .NET tools

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2025-04-28 22:04:00 -04:00
Conner Turnbull
8a2012bb83
[PM-17777] sponsorships consume seats (#5694)
* Admin initiated sponsorships now use seats similarly to inviting an organization user

* Updated f4e endpoint to not expect a user ID, and instead just send a boolean

* Fixed failing tests

* Updated OrganizationUserReadOccupiedSeatCountByOrganizationIdQuery to ensure both left and right sides are selecting the same columns
2025-04-24 10:53:34 -04:00
tangowithfoxtrot
5bd7d2fa4a
feat: allow images to run as non-root user 2025-04-23 13:45:09 -07:00
tangowithfoxtrot
3e48c6318d
feat: allow custom app-id.json location for rootless
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2025-04-23 11:28:23 -07:00
Nick Krantz
6809709628
[PM-20064] Add cascade deletion for cipher with tasks (#5690)
* add cascade deletion for cipher tasks

* add migrations for cascade delete on ciphers and security tasks

* remove trailing comma

* add SQL migration for PasswordHealthReportApplication

- Allow cascade delete when an organization is deleted
2025-04-23 13:16:29 -05:00
Matt Bishop
f336d959c7
Cascade deletion for organization integration configurations (#5695)
* Cascade deletion for organization integration configurations

* I always forget to format
2025-04-22 14:13:10 -07:00
MtnBurrit0
2644efc2b7
Add env variable to override /installations domain (#5669)
* Add env variable to override /installations domain
2025-04-22 11:21:19 -06:00
Jared McCannon
dc758c5176
[PM-19128] - Optimize Update Collections (#5626)
* added data clean up to test

* Added indices and edited sproc to avoid merge commands

* Forgot GO

* Adding some more GOs
2025-04-18 11:51:50 -05:00
cyprain-okeke
60e7db7dbb
[PM-17823]Add feature toggle for admin sponsored families to admin portal (#5595)
* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Add `Notes` column to `OrganizationSponsorships` table

* Add feature flag to `CreateAdminInitiatedSponsorshipHandler`

* Unit tests for `CreateSponsorshipHandler`

* More tests for `CreateSponsorshipHandler`

* Forgot to add `Notes` column to `OrganizationSponsorships` table in the migration script

* `CreateAdminInitiatedSponsorshipHandler` unit tests

* Fix `CreateSponsorshipCommandTests`

* Encrypt the notes field

* Wrong business logic checking for invalid permissions.

* Wrong business logic checking for invalid permissions.

* Remove design patterns

* duplicate definition in Constants.cs

* Add the admin sponsored families to admin portal

* Add a feature flag

* Rename the migration file name

* Resolve the existing conflict and remove added file

* Add a migration for the change

* Remove the migration Because is already added

* Resolve the failing migration

---------

Co-authored-by: Jonas Hendrickx <jhendrickx@bitwarden.com>
2025-04-17 14:58:29 +01:00
Conner Turnbull
ca29cda9ed
[PM-17830] Force Admin Initiated Sponsorships migration script to run in QA (#5662)
* Copy and pasted scripts for admin initiated sponsorship to force migration in QA

* Include idempotency to ensure columns are correct if prior version of this script added them already without default value

* Ensure this script works if the default constraints already exist
2025-04-17 08:45:05 -04:00
Jonas Hendrickx
c182b37347
[PM-17830] Backend changes for admin initiated sponsorships (#5531)
* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Add `Notes` column to `OrganizationSponsorships` table

* Add feature flag to `CreateAdminInitiatedSponsorshipHandler`

* Unit tests for `CreateSponsorshipHandler`

* More tests for `CreateSponsorshipHandler`

* Forgot to add `Notes` column to `OrganizationSponsorships` table in the migration script

* `CreateAdminInitiatedSponsorshipHandler` unit tests

* Fix `CreateSponsorshipCommandTests`

* Encrypt the notes field

* Wrong business logic checking for invalid permissions.

* Wrong business logic checking for invalid permissions.

* Remove design patterns

* duplicate definition in Constants.cs

* Allow rollback

* Fix stored procedures & type

* Fix stored procedures & type

* Properly encapsulating this PR behind its feature flag

* Removed comments

* Updated ValidateSponsorshipCommand to validate admin initiated requirements

---------

Co-authored-by: Conner Turnbull <133619638+cturnbull-bitwarden@users.noreply.github.com>
Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
2025-04-16 11:27:58 -04:00
Matt Bishop
7139effa94
Organization integration database / repository logic (#5602)
* Organization integration creation, update, and deletion database logic

* Additional procs and entity tweaks

* Use check

* Couple newlines

* Forgot to script the two org procs
2025-04-07 07:20:18 -07:00
Jared McCannon
0d7363c6af
[PM-16811] - SCIM Invite Users Optimizations (#5398)
* WIP changes for Invite User optimization from Scim

* feature flag string

* Added plan validation to PasswordManagerInviteUserValidation. Cleaned up a few things.

* Added Secrets Manager Validations and Tests.

* Added bulk procedure for saving users, collections and groups from inviting. Added test to validate Ef and Sproc

* Created SendOrganizationInvitesCommand and moved some tests from OrgServiceTests. Fixed some tests in org service in relation to moving out SendOrgInviteCommand code.

Added side effects to InviteOrganizationUsersCommand

* First test of new command.

* Added test to verify valid request with a user calls db method and sends the invite

* Added more tests for the updates

* Added integration test around enabling feature and sending invite via scim. Did a bit of refactoring on the SM validation. Fixed couple bugs found.

* Switching over to a local factory.

* created response model and split interface out.

* switched to initialization block

* Moved to private method. Made ScimInvite inherit the single invite base model. Moved create methods to constructors. A few more CR changes included.

* Moved `FromOrganization` mapper method to a constructor

* Updated to use new pricing client. Supressed null dereference errors.

* Fixing bad merge.

* Rename of OrgDto

* undoing this

* Moved into class

* turned into a switch statement

* Separated into separate files.

* Renamed dto and added ctor

* Dto rename. Moved from static methods to ctors

* Removed unused request model

* changes from main

* missed value

* Fixed some compilation errors.

* Fixed some changes.

* Removed comment

* fixed compiler warning.

* Refactored to use new ValidationResult pattern. added mapping method.

* Added throwing of Failure as the previous implementation would have.

* Cleaned up return.

* fixing test.

* Made HasSecretsManagerStandalone return if org doesn't have sm. Added overload for lighter weight model and moved common code to private method.

* Fixed tests.

* Made public method private. added some comments.

* Refactor validation parameter to improve clarity and consistency. Added XML doc

* fixed test

* Removed test only constructor from InviteOrganization

* Separated old and new code explicitly. Moved old code checks down into new code as well. Added error and mapper to Failure<T>

* Variable/Field/Property renames

* Renamed InviteUsersValidation to InviteUsersValidator

* Rename for InvitingUserOrganizationValidation to InvitingUserOrganizationValidator

* PasswordManagerInviteUserValidation to PasswordManagerInviteUserValidator

* Moved XML comment. Added check to see if additional seats are needed.

* Fixing name.

* Updated names.

* Corrected double negation.

* Added groups and collection and users checks.

* Fixed comment. Fixed multiple enumeration. Changed variable name.

* Cleaned up DTO models. Moved some validation steps around. A few quick fixes to address CR concerns. Still need to move a few things yet.

* Fixed naming in subscription update models.

* put back in the request for now.

* Quick rename

* Added provider email addresses as well.

* Removed valid wrapper to pass in to validation methods.

* fix tests

* Code Review changes.

* Removed unused classes

* Using GetPlanOrThrow instead.

* Switches to extension method

* Made Revert and Adjust Sm methods consistent. Corrected string comparer. Added comment for revert sm.

* Fixing compiler complaint.

* Adding XML docs

* Calculated seat addition for SM.

* Fixing compiler complaints.

* Renames for organization.

* Fixing comparison issue.

* Adding error and aligning message.

* fixing name of method.

* Made extension method.

* Rearranged some things. Fixed the tests.

* Added test around validating the revert.

* Added test to validate the provider email is sent if org is managed by a provider.

* Created new errors and removed references in business code to ErrorMessages property. This aligns Invite User code to use Errors instead of ErrorMessages

* Delayed the hasSecretsManagerStandalone call as long as possible.

* Corrected model name. Corrected SM seat calculation. Added test for it.

* Corrected logic and added more tests.
2025-04-07 09:14:10 -05:00
Shane Melton
d4a3cd00be
[PM-17563] Add missing TaskId and HubHelper for PendingSecurityTasks (#5591)
* [PM-17563] Add case for PushType.PendingSecurityTasks

* [PM-17563] Add missing TaskId property to NotificationStatusDetails and NotificationResponseModel

* [PM-17563] Add migration script to re-create NotificationStatusDetailsView to include TaskId column

* [PM-17563] Select explicit columns for NotificationStatusDetailsView and fix migration script
2025-04-02 13:44:59 -07:00
Jared McCannon
786b0edceb
[PM-18527] - Fix allowing restored user to own multiple free orgs (#5444)
* Moved RestoreUserAsync and RestoreUsersAsync to Command.

* Fixing the bug.

* Added test for bulk method.

* Fixing sonar cube warning.

* SonarQube warning fix.

* Excluding org users we already have.

* Fixed misspelling. Added integration test for method.

* test had the misspelling as well 🤦

* Split out interface. Added admin and confirmed constraints.

* fixed queries and added xml comments and tests.
2025-03-31 08:33:57 -05:00
Matt Bishop
6e81cee221
Introduce organization integration configuration details (#5568) 2025-03-28 09:20:35 -07:00
Matt Bishop
d4b0058372
Organization integrations and configuration database schemas (#5553)
* Organization integrations and configuration database schemas

* Format EF files
2025-03-26 11:44:05 -04:00
Rui Tomé
bb3ec6aca1
[PM-16888] Refactor OrganizationUser status update procedure to use a GuidIdArray parameter and remove JSON parsing logic (#5237)
* Refactor OrganizationUser status update procedure to use a GuidIdArray parameter and remove JSON parsing logic

* Fix OrganizationUser_SetStatusForUsersById procedure and bump script date

* Restore OrganizationUser_SetStatusForUsersById for possible server version rollback. Add new version with the name OrganizationUser_SetStatusForUsersByGuidIdArray

* Add migration script to add stored procedure OrganizationUser_SetStatusForUsersByGuidIdArray to update user status by GUID array
2025-03-19 11:01:06 +00:00
Vince Grassia
7f0dd6d1c3
Update FROM directive in Dockerfile (#5522) 2025-03-18 20:02:39 +00:00
Vince Grassia
0153d9dfd9
Update DockerCompose template to point to ghcr.io registry (#5491) 2025-03-11 13:01:23 -07:00