1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-07 11:40:31 -05:00

5907 Commits

Author SHA1 Message Date
Jared Snider
be8e7465be
PM-20532 - SendAccessGrantValidator.cs - password to password hash 2025-06-05 15:57:21 -04:00
Jared Snider
5a03ff45f7
PM-20532 - SendAccessGrantValidator.cs - replace incorrect error with TODO 2025-06-05 15:51:18 -04:00
Jared Snider
a58194c74c
PM-20532 - CurrentContext.cs - move clientId up 2025-06-03 11:02:54 -04:00
Jared Snider
553169724b
PM-20532 - Refactor name of input param in ISendPasswordHasher.cs 2025-06-02 20:02:06 -04:00
Jared Snider
af934a2bee
PM-20532 - SendClientBuilder.cs and GlobalSettings.cs - wire up SendAccessTokenLifetimeInMinutes as global setting and consume in send client builder 2025-06-02 18:07:24 -04:00
Jared Snider
bb15deda3d
PM-20532 - CurrentContext.cs - short circuit context building based on send type. 2025-06-02 17:57:14 -04:00
Jared Snider
4e4bca5c0e
PM-20532 - Clean up deprecated SameSendIdHandler commented out code 2025-06-02 17:34:02 -04:00
Jared Snider
8b93749d29
PM-20532 - Add comment 2025-06-02 14:51:04 -04:00
Jared Snider
0d3133233f
PM-20532 - Add first draft of ClaimsPrincipal extension GetSendId for getting send id in send claim protected controller methods. 2025-06-02 14:51:04 -04:00
Jared Snider
c89d96c772
PM-20532 - SendAccessGrantValidator.cs - (1) Use guid as sendId in claim (2) use SendPasswordHasher over direct passwordHasher use 2025-06-02 14:51:03 -04:00
Jared Snider
fe222b5299
PM-20532 - ServiceCollectionExtensions.cs - register SendPasswordServices 2025-06-02 14:51:03 -04:00
Jared Snider
b16ae11d9c
PM-20532 - Add KM SendPasswordHasher 2025-06-02 14:51:03 -04:00
Jared Snider
61a531c9bc
PM-20532 - ProfileService.cs - add todos & comments 2025-06-02 14:51:03 -04:00
Jared Snider
3a1851c6fe
PM-20532 - Remove TODO 2025-06-02 14:51:03 -04:00
Jared Snider
98ff19e5f2
PM-20532 - SendAccessGrantValidator.cs - integrate call to sendAuthenticationQuery 2025-06-02 14:51:03 -04:00
Jared Snider
4b870dab0b
PM-20532 - Update ProfileService.cs to add docs + add send client handling. 2025-06-02 14:51:03 -04:00
Jared Snider
da4f21d976
PM-20532 - ProfileService.cs - add todo to test. 2025-06-02 14:50:54 -04:00
Jared Snider
29f876b5a1
PM-20532 - Add TODO 2025-06-02 14:50:54 -04:00
Jared Snider
0766368ea2
PM-20532 - WIP on SendAccessGrantValidator.cs 2025-06-02 14:50:43 -04:00
Jared Snider
2d7da69392
PM-20532 - WIP 2025-06-02 14:50:43 -04:00
Jared Snider
0457d2aced
PM-20532 - Per discussion with Tools, deprecate SameSendIdHandler.cs and SameSendIdRequirement.cs and just require claim instead. We will write a extension method on the ClaimsPrincipal to get the send id instead of the HttpContext. 2025-06-02 14:50:30 -04:00
Jared Snider
07108135ed
PM-20532 - Add TODOs 2025-06-02 14:49:57 -04:00
Jared Snider
04a78ad9bb
PM-20532 - WIP on SameSendId Requirement and Handler - need more investigation on if required. 2025-06-02 14:49:21 -04:00
Jared Snider
b52deb7a08
PM-20532 - (1) Policies - Add new Policies.cs static class to avoid magic strings for policy use (2) API Startup.cs - Add send authorization policy. 2025-06-02 14:49:20 -04:00
Jared Snider
b5e3d39d06
PM-20532 - Identity - ServiceCollectionExtensions.cs - register Send ExtensionGrantValidator. 2025-06-02 14:49:20 -04:00
Jared Snider
f07626bf4c
PM-20532 - SendAccessGrantValidator - WIP 2025-06-02 14:49:20 -04:00
Jared Snider
ceb5d73305
PM-20532 - (1) Move ApiClient into new StaticClients folder (2) Create SendClientBuilder as don't need to use inheritance w/ client (3) Register new SendClient using builder in StaticClientStore (4) StaticClientStore - update name of clients list to not be ApiClients and instead just be Clients. 2025-06-02 14:49:20 -04:00
Jared Snider
95c03c3750
PM-20532 - Add new Send client type to BitwardenClient.cs and IdentityClientType.cs along with adding new scope and claim. 2025-06-02 14:49:19 -04:00
Henrik
8bac7f0145
[PM-14476] Avoid multiple lookups in dictionaries (#4973)
* Avoid multiple lookups in dictionaries

* Consistency in fallback to empty CollectionIds

* Readability at the cost of lines changed

* Readability

* Changes after running dotnet format
2025-06-02 11:18:28 -05:00
Jordan Aasen
2c4393cc16
[PM-22204] - update cipher/share endpoint to return revision date (#5900)
* return ciper response model in cipher share endpoint. add tests

* return dict instead of full cipher response. adjust specs

* rename vars

* rename vars

* rename vars

* reinsert braces

* add specs

* return CipherMiniResponseModel
2025-06-02 09:05:58 -07:00
Github Actions
8c14630481 Bumped version to 2025.6.0 2025-06-02 15:15:43 +00:00
Daniel James Smith
c7b1c7f6d5
[PM-22190] Remove gathering and reporting of ReferenceEvents (#5897)
* Remove gathering and reporting of ReferenceEvents

* Fix test that relied on reference events throwing

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2025-06-02 16:49:49 +02:00
Oscar Hinton
d7d90e7f3e
[PM-21079] Add support to integration tests for using sqlserver (#5823)
Adds a SqlServerApiApplicationFactory which allows you to run api tests using SqlServer. Currently a new database is create and destroyed for each test. In the future we'd like a more optimized way to do this.

The database logic is abstracted away in a ITestDatabase interface which handles the configuration, migration and teardown.
2025-06-02 11:06:16 +02:00
tangowithfoxtrot
20105b85aa
fix: failing builds; Setup is no longer a dll (#5901) 2025-05-30 13:28:16 -07:00
tangowithfoxtrot
63f5811aa9
feat: non-root self hosted images for standard deployment (#5701)
* Use IHttpMessageHandlerFactory For HTTP Communication

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

* feat: allow custom app-id.json location for rootless

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

* fix: new build context wont allow copying git context

* feat: allow images to run as non-root user

* fix: build failures caused by bad merge

* build: we don't need to copy the `.git` dir

* Revert "build: we don't need to copy the `.git` dir"

This reverts commit 32c2f6236a894534de09ffe847ffff064a7174bd.

* Use `IHttpClientFactory` in more places

* update build workflow

* fix: compatibility with the existin run.sh script

* fix: compatibility with existing run.sh script

* Add SelfHosted GlobalSettings for Setup

* Fix my build error

* Add other services

* Add IConfiguration

* fix: missing gosu command for rootful mode

* fix: try using .net core certificate handling

* fix: add `SSL_CERT_DIR` to remaining images

* Remove X509ChainCustomization activation code

* Revert "Use IHttpMessageHandlerFactory For HTTP Communication"

This reverts commit c93be6d52b12599040d3c3d8a7b3bc854c6c6802.

* Revert "fix: build failures caused by bad merge"

This reverts commit 3e4639489b6b6c06b5a977a069002fe0c0eb2057.

* Revert "Use `IHttpClientFactory` in more places"

This reverts commit 284501a4932b819b093406e0bcdf76def22b6eea.

* remove unused code

* re-add error log for installation id

* remove missing error message in log

* build: remove duplicate docker+qemu setup steps

Co-authored-by: Opeyemi <Alaoopeyemi101@gmail.com>

* build: optimize for simpler builds over caching

* build: restore previous method for getting the GIT_HASH

* fix: add missing build args to remaining images

* fix: rm extraneous source revision id arg

* fmt: apply consistent spacing and rm redundant WORKDIR directive

* build: update migrator to use simpler build; apply consistent spacing

* fix: merge conflicts; simplify changes

* fix: add publish branch check back

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
Co-authored-by: Opeyemi <Alaoopeyemi101@gmail.com>
2025-05-30 10:29:47 -07:00
Justin Baur
0b2b573bd3
Add DynamicClientStore (#5670)
* Add DynamicClientStore

* Formatting

* Fix Debug assertion

* Make Identity internals visible to its unit tests

* Add installation client provider tests

* Add internal client provider tests

* Add DynamicClientStore tests

* Fix namespaces after merge

* Format

* Add docs and remove TODO comments

* Use preferred prefix for API keys

---------

Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
2025-05-30 12:58:54 -04:00
sneakernuts
63f836a73a
SRE-1913 find & replace twitter w/ x (#5586) 2025-05-30 09:58:24 -06:00
Alex Morask
390b93f6ce
[PM-21250] Remove pm-18770-enable-organization-business-unit-conversion (#5848)
* Remove pm-18770-enable-organization-business-unit-conversion

* Run dotnet format
2025-05-30 09:58:36 -04:00
Jared McCannon
d50ad97e6e
Adding OptimizeNestedTraverse feature flag. moved custome role permissions to ac section. (#5853) 2025-05-29 09:57:50 -05:00
Michał Chęciński
3d02d6c4eb
[BRE-826] Update remaining DockerHub references to GitHub (#5877)
* Update README.md to replace Docker Hub links with GitHub Packages links

* Update README.md

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>

* Remove docker badge

---------

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2025-05-29 10:07:46 -04:00
cyprain-okeke
5972ac147e
[PM-21603]Invite Member sub text seat count does not account for sponsorships (#5889)
* Add Occupied Seats at part metadata

* resolve the failing test

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

---------

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
2025-05-29 15:06:25 +01:00
Brandon Treston
930fe29c82
replace owner/admins list with table (#5892) 2025-05-29 09:55:33 -04:00
Brant DeBow
6486354fbc
[PM-17562] Add Azure Service Bus support for event integration retries (#5880)
* [PM-17562] Add Azure Service Bus support for event integration retries

* Cleanup AzureServiceBusIntegrationListenerService.cs; add nullable

* Removed IntegrationHandlerBase* since it is no longer used (We removed the subclasses previously)

* Changed strategy to assume ApplyRetry always gives us a non-null DelayUntilDate; Added test to confirm as well
2025-05-29 08:22:11 -04:00
Rui Tomé
829ce86066
[PM-18238] Add RequireTwoFactorPolicyRequirement (#5840)
* Add RequireTwoFactorPolicyRequirement and its factory with unit tests

* Implemented RequireTwoFactorPolicyRequirement to enforce two-factor authentication policies.
* Created RequireTwoFactorPolicyRequirementFactory to generate policy requirements based on user status.
* Added unit tests for the factory to validate behavior with various user statuses and policy details.

* Enhance AcceptOrgUserCommand to use IPolicyRequirementQuery for two-factor authentication validation

* Update ConfirmOrganizationUserCommand to use RequireTwoFactorPolicyRequirement to check for 2FA requirement

* Implement CanAcceptInvitation and CanBeConfirmed methods in RequireTwoFactorPolicyRequirement; update tests to reflect new logic for two-factor authentication policy handling.

* Refactor AcceptOrgUserCommand to enforce two-factor authentication policy based on feature flag; update validation logic and tests accordingly.

* Enhance ConfirmOrganizationUserCommand to validate two-factor authentication policy based on feature flag; refactor validation logic and update related tests for improved policy handling.

* Remove unused method and its dependencies from OrganizationService.

* Implement CanBeRestored method in RequireTwoFactorPolicyRequirement to determine user restoration eligibility based on two-factor authentication status; add corresponding unit tests for various scenarios.

* Update RestoreOrganizationUserCommand to use IPolicyRequirementQuery for two-factor authentication policies checks

* Remove redundant vNext tests

* Add TwoFactorPoliciesForActiveMemberships property to RequireTwoFactorPolicyRequirement and corresponding unit tests for policy retrieval based on user status

* Refactor UserService to integrate IPolicyRequirementQuery for two-factor authentication policy checks

* Add XML documentation for TwoFactorPoliciesForActiveMemberships property in RequireTwoFactorPolicyRequirement to clarify its purpose and return value.

* Add exception documentation for ValidateTwoFactorAuthenticationPolicyAsync method in ConfirmOrganizationUserCommand to clarify error handling for users without two-step login enabled.

* Update comments in AcceptOrgUserCommand and ConfirmOrganizationUserCommand to clarify handling of two-step login and 2FA policy checks.

* Add RequireTwoFactorPolicyRequirementFactory to PolicyServiceCollectionExtensions

* Refactor two-factor authentication policy checks in AcceptOrgUserCommand and ConfirmOrganizationUserCommand to streamline validation logic and improve clarity. Update RequireTwoFactorPolicyRequirement to provide a method for checking if two-factor authentication is required for an organization. Adjust related unit tests accordingly.

* Add PolicyRequirements namespace

* Update comments in AcceptOrgUserCommand and ConfirmOrganizationUserCommand to clarify two-factor authentication policy requirements and exception handling.

* Refactor RequireTwoFactorPolicyRequirement to return tuples of (OrganizationId, OrganizationUserId) for active memberships requiring two-factor authentication. Update UserService and related tests to reflect this change.

* Refactor AcceptOrgUserCommand: delegate feature flag check to the ValidateTwoFactorAuthenticationPolicyAsync method

* Skip policy check if two-step login is enabled for the user

* Refactor ConfirmOrganizationUserCommand to streamline two-factor authentication policy validation logic

* Refactor AcceptOrgUserCommand to simplify two-factor authentication check by removing intermediate variable

* Update documentation in RequireTwoFactorPolicyRequirement to clarify the purpose of the IsTwoFactorRequiredForOrganization

* Refactor AcceptOrgUserCommandTests to remove redundant two-factor authentication checks and simplify test setup

* Refactor AcceptOrgUserCommand and ConfirmOrganizationUserCommand to streamline two-factor authentication checks by removing redundant conditions and simplifying logic flow.

* Rename removeOrgUserTasks variable in UserService

* Refactor RestoreOrganizationUserCommand to simplify two-factor authentication compliance checks by consolidating logic into a new method, IsTwoFactorRequiredForOrganizationAsync.

* Remove outdated two-factor authentication validation documentation from AcceptOrgUserCommand

* Invert two-factor compliance check in RestoreOrganizationUserCommand to ensure correct validation of organization user policies.

* Refactor UserService to enhance two-factor compliance checks by optimizing organization retrieval and logging when no organizations require two-factor authentication.
2025-05-29 07:40:30 +01:00
Thomas Rittson
c7b0c30370
Bump account revision date in OrgUserRepository (#5884)
Match equivalent MSSQL logic. Also ensures that the revision date
is bumped when the user is revoked.
2025-05-29 07:30:23 +10:00
Todd Martin
fe6181f55f
fix(identity): [PM-21975] Add Security Stamp claim to persisted grant
* Added Security Stamp claim to refresh_token

* Linting

* Added better comments.

* Added clarification to naming of new method.

* Updated comments.

* Added more comments.

* Misspelling
2025-05-28 16:44:18 -04:00
Shane Melton
9ad2d61303
[PM-22146] Remove reference to JSON_PATH_EXISTS for old migration scripts for SH instances running older SQL Server versions (#5894) 2025-05-28 11:31:07 -07:00
Shane Melton
e19bee4195
[PM-22146] Replace JSON_PATH_EXISTS with JSON_QUERY to support older MSSQL versions (#5891) 2025-05-28 10:21:55 -07:00
Github Actions
e241949601 Bumped version to 2025.5.2 2025-05-28 17:04:11 +00:00
aj-bw
1e7d02bca2
BRE-857/collect-code-references-fails-against-tags (#5885)
* update code-references file to also check tags

* fix line
2025-05-28 12:43:15 -04:00