1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
Commit Graph

3710 Commits

Author SHA1 Message Date
Oscar Hinton
9ea520e038
Move CI testing to Ubuntu (#2638)
Change the CI for testing job from Windows to Ubuntu
2023-01-30 11:07:20 +01:00
Kyle Spearrin
2646d9200c
apply trailing slash to attachments location (#2639) 2023-01-27 10:32:26 -05:00
Jared Snider
b412a01d2a
Defect/SG-992 ProviderOrgs Missing Plan Type & EC-591/SG-996 - Provider Org Autoscaling Email Invites Working (#2596)
* SG-992 - Provider receives free org prompt when trying to auto scale org seats because plan type was missing and defaulting to free. PlanType has now been added to provider orgs returned as part of the profile sync.

* SG-992 - Updated Stored proc name to match convention

* EC-591 / SG-996 - (1) Update ProviderUserRepo.GetManyDetailsByProviderAsync to accept optional ProviderUserStatusType (2) Update OrganizationService.cs autoscaling user logic to check if an org is a provider org and send owner emails to the confirmed provider users instead of the managed org owners. Prevents scenario where newly created, managed orgs would not have an owner yet, and ownerEmails would be null and the email service would explode.

* EC-591 / SG-996 - Remove comments

* EC-591 / SG-996 - ES lint fix.

* SG-996 - SQL files must have SQL extensions.

* SG-996 / EC-591 - Update alter sql to be actually backwards compatible

* SG-996 - Make Status actually optional and backwards compatible for ProviderUserUserDetails_ReadByProvider.sql

* SG-992 - Update migrations to meet standards - (1) use CREATE OR ALTER and (2) Update view metadata after change if necessary

* EC-591 / SG-996 - Update Stored Proc migration to use proper standards: (1) Remove unnecessary code and (2) Use CREATE OR ALTER instead of just ALTER

* SG-992 / EC-591 / SG-996 - Refactor separate migrations into single migrations file per PR feedback

* SG-992/SG-996 - Add SyncControllerTests.cs with basic test suite + specific test suite to ensure provider orgs have plan type mapped to output product type properly.

* Fix lint issues by removing unnecessary using statements

* SG-992 - Refresh of view metadata has to target the stored procs that reference the view -- not the view itself.
2023-01-26 11:51:26 -05:00
Thomas Rittson
6dfbd06e8f
[EC-1043] Fix syntax error in ReadKdfByEmail query (#2631) 2023-01-26 15:34:18 +10:00
Kyle Spearrin
7c55d56561
fix lint issues and sql csproj (#2627) 2023-01-25 12:44:32 -05:00
Jake Fink
64c15ed8cd
[EC-1032] if name is Empty, set to null before saving (#2619) 2023-01-25 11:07:33 -05:00
Bernd Schoolmann
cb1ba50ce2
[PS-2267] Add KdfMemory and KDFParallelism fields (#2583)
* Add KdfMemory and KDFParallelism fields

* Revise argon2 support

This pull request makes the new attribues for argon2, kdfMemory and
kdfParallelism optional. Furthermore it adds checks for the argon2
parametrs and improves the database migration script.

* Add validation for argon2 in RegisterRequestModel

* update validation messages

* update sql scripts

* register data protection with migration factories

* add ef migrations

* update kdf option validation

* adjust validation

* Centralize and Test KDF Validation

Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com>
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2023-01-25 07:56:54 -05:00
Oscar Hinton
59f5285c88
[SM-460] Isolate SecretsManager files (#2616)
Move SecretsManager files to directories called SecretsManager and add CodeOwners
2023-01-24 19:57:28 +01:00
Vince Grassia
4041d7f009
Remove old Digital Ocean Marketplace files (#2622) 2023-01-24 13:26:21 -05:00
Vince Grassia
fe2fda5776
Update README example commands for self-host scripts (#2620) 2023-01-24 13:05:36 -05:00
Matt Bishop
0e32cb944a
Upgrade Swagger (#2611) 2023-01-24 12:10:00 -05:00
Thomas Avery
aa9f859306
[SM-382] Service Account access policy checks (#2603)
The purpose of this PR is to add access policy checks to service account endpoints.
2023-01-24 09:50:04 -06:00
Oscar Hinton
bdea036c1f
[SM-454] Refresh OrganizationView (#2605) 2023-01-23 18:03:45 +01:00
Rui Tomé
68989442c8
[EC-427] Add provider types (MSP/Reseller) to Provider table (#2518)
* [EC-427] Add columns 'Type' and 'BillingPhone' to Provider table

* [EC-427] Provider table Type and BillingPhone MySql migrations

* [EC-427] Provider table Type and BillingPhone Postgres migrations

* [EC-427] Add mysql migration script

* [EC-427] Add mysql migration script

* [EC-427] Updated Provider sql script to include default column value

* [EC-427] Removed default value from Provider.Type column

* [EC-427] Changed migration script to include a default value constraint instead of updating the null type

* [EC-427] Updated Sql project Provider table script

* [EC-427] Changed migration script to use 'Create OR Alter' for views and sprocs

* [EC-427] Added default values for 'BillingPhone' and 'Type' fields on sprocs [dbo].[Provider_Create] and [dbo].[Provider_Update]

* [EC-427] Adjusting metadata in migration script

* [EC-427] Updated Provider sprocs SQL script files

* [EC-427] Fixed migration script

* [EC-427] Added sqlite migration

* [EC-427] Add missing Provider_Update sproc default value

* [EC-427] Added missing GO action to migration script

* [EC-428] Redirect to Edit after creating Provider

* Revert "[EC-428] Redirect to Edit after creating Provider"

This reverts commit 6347bca1ed.
2023-01-23 16:08:05 +00:00
Rui Tomé
c6c0f95ed7
[EC-741 Single Organization policy exception when an Invited status user is also in the Revoked status (#2568)
* [EC-741] Check that OrganizationUsers to be removed have a UserId

* [EC-741] Filtering Revoked users in query for users to remove from organization
2023-01-23 16:05:12 +00:00
Dane Powell
266d426c80
Quotes break adminSettings__admins (#2572) 2023-01-22 16:02:08 -05:00
Daniel James Smith
76ed711f89
Remove gravatar.com from CSP rules (#2526) 2023-01-21 02:12:56 +01:00
Brandon Maharaj
862ce01bf4
[SG-927] Pull the user's selected avatar color from the state store and display on Emergency Contacts page (#2582)
* work: backend changes

* fix: lets not mix up Grantor and Grantee

* work: update view
2023-01-20 13:11:16 -05:00
Jake Fink
7b4c9b0e59
[EC-943] remove deprecated permissions (#2578) 2023-01-20 11:36:17 -05:00
Justin Baur
6cb236ebcb
Add Tool For Adding EF Migrations (#2576)
* Add Tool For Adding EF Migrations

* Update dev/ef_migrate.ps1

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
2023-01-20 11:28:24 -05:00
Oscar Hinton
5cd571df64
[SM-380] Access checks for listing projects (#2496)
* Add project access checks for listing
2023-01-20 16:33:11 +01:00
Oscar Hinton
a7c2ff9dbf
Remove workflow_run (#2606) 2023-01-20 16:31:41 +01:00
Thomas Avery
53ba2eeb18
[SM-390] Project Access Policies (#2507)
The purpose of this PR is to create server endpoints for creating, reading, updating, and deleting access policies for projects.
2023-01-19 17:31:19 -06:00
Kyle Spearrin
ae647bbf44
move from sudo to exec setpriv (#2600) 2023-01-19 17:11:52 -05:00
Thomas Avery
41d1e48823
Use response models in Api integration tests (#2592) 2023-01-19 15:20:59 -06:00
Matt Gibson
01b4a4d1d8
Provide webfonts (#2570) 2023-01-19 18:49:16 +00:00
Matt Bishop
352b42b535
Upgrade FIDO2 library usage out of beta (#2579) 2023-01-19 11:06:51 -05:00
Andreas Coroiu
354caa3063
[EC-647] OAVR v2 Feature Branch Merge (#2588)
* [EC-19] Move SSO Identifier to Org SSO endpoint (#2184)

* [EC-19] Move SSO identifier to Org SSO config endpoint

* [EC-19] Add Jira tech debt issue reference

* [EC-542] Update email communications (#2348)

* [EC-73] Add users alongside groups for collection details (#2358)

* [EC-73] feat: add new stored procedures

* [EC-73] feat: add migration

* [EC-73] chore: rename collection group details

* [EC-73] fix: migration

* [EC-73] feat: return users from dapper repo

* [EC-73] feat: EF support for collection users

* [EC-73] feat: implement updating users in EF

* [EC-73] feat: new collections with users in EF

* [EC-73] feat: create with users in dapper

* [EC-73] feat: update with users in dapper

* [EC-73] fix: collection service tests

* [EC-73] fix: lint

* [EC-73] feat: add new data model and rename for clarity

* [EC-73] chore: add future migrations

* [EC-16 / EC-86] Implement Groups Table Endpoints (#2280)

* [EC-16] Update Group endpoints/repositories to include necessary collection info

* [EC-16] Add delete many groups endpoint and command

* [EC-16] Add DeleteGroupCommand unit tests

* [EC-16] Update migration script

* [EC-16] Formatting

* [EC-16] Support modifying users via Post Group endpoint

- Add optional Users property to GroupRequestModel
- Add users parameter to the GroupService.SaveAsync() method
- Use the users argument to update the Group via the GroupRepository if present.

* [EC-16] Add/update Sprocs for bulk group deletion

- Add a new bump account revision date by multiple org ids sproc to be used by the delete many group sproc.
- Update the delete many group sproc to no longer require the organization Id as authorization is a business concern.

* [EC-16] No longer require org Id in delete many GroupRepository

The group repository should not care about which organization a group belongs to when being deleted. That is a business logic concern and is not necessary at the repository level.

* [EC-16] Remove org Id from delete many group command

- Remove the organization Id from the delete many method.
- Require Group entities instead of just group Ids so that group retrieval is completed outside the command.
- No longer return deleted groups as they are now being passed into the command.
- Update unit tests

* [EC-16] Remove org id from bulk delete group endpoint

- Remove the Org Id from the endpoint and make use of the updated delete many command

* [EC-16] Rename delete many groups sproc

* [EC-16] Update migration script

* [EC-16] Fix typo in migration script

* [EC-16] Fix order of operations in Group_DeleteByIds sproc

* [EC-16] Formatting

* [EC-86] Fix DeleteManyAsync parameter name

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

* [EC-16] Add missing sproc to sqlproj file

* [EC-16] Improve GroupRepository method performance

Use GroupBy before marrying Groups and Collections to avoid iterating over all collections for every group)

* [EC-16] Use ToListAsync() to be consistent in the repository

* [EC-16] Fix collection grouping in the EF repository

* [EC-16] Adjust DeleteGroup command namespace to be less verbose

* [EC-16] Cleanup DeleteGroupCommandTests

* [EC-16] Formatting

* [EC-16] Ensure a non-null group collection list is provided

* [EC-16] Add bulk GroupEvents method to EventService

- Use the new method in the DeleteGroups command

* [EC-16] Remove bulk delete group Api response

The response is unnecessary and not used by the client

* [EC-16] Log OrganizationUser_UpdateGroups event in GroupService

Events are logged for users during both Group creation (all added users) and modification (only changed users).

* [EC-16] Fix failing unit test

* [EC-16] Rename newUsers variable per feedback

* [EC-16] Assert delete many group log events

Explicitly check for the event type and groups that are logged to the event service.

* [EC-16] Update DeleteManyAsync signature

Use ICollection<> instead of IEnumerable<> to avoid ambiguity of possible multiple enumeration

* [EC-16] Increment migration script name

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

* Add missing GO command to EC-73 migration script (#2433)

* [EC-15] Members Grid Api Support (#2485)

* [EC-15] Update OrganizationUser models to support list of collections and groups

* [EC-15] Add sprocs to query GroupUser and CollectionUser entities

* [EC-15] Update the OrganizationUserRepository to optionally fetch groups/collections

* [EC-15] Formatting

* [EC-15] Remove leftover repository method

* [EC-15] Fix table identifier inconsistency in sproc/migration

* Formatting

* [EC-14]: Server changes for Collection rows in Vault (#2360)

* [EC-14] add collection management methods to repo
- delete many, get many by ids, and get many with groups by org

* [EC-14] connection command tests had wrong folder name

* [EC-14] add collection repo methods to interface

* [EC-14] create DeleteCollectionCommand

* [EC-14] add getManyWithDetails collections endpoint

* [EC-14] add GetManyWithGroupsByUserId

* [EC-14] add call to interface

* [EC-14] add GetOrganizationCollectionsWIthGroups
- gets groups with collections
- add tests as well

* [EC-14] add call to interface

* [EC-14] add new coll call to controller
- gets collections with groups

* [EC-14] use new delete collection command

* [EC-14] add CollectionBulkDeleteRequestModel

* [EC-14] remove org from delete collection cmd
- move all permission checks to controller
- add tests to controller
- remove org check from repository method

* [EC-14] add migration and sprocs

* [EC-14] formatting

* [EC-14] revert delete permission check changes

* [EC-14] rename SelectionReadOnly to CollectionAccessSelection

* [EC-14] move GetOrganizationCollectionsWithGroups to controller
- there's no reason to have this logic in the service layer
- we can still test the permission check in the controller
- also renamed repo methods and changed return types

* [EC-14] include users in collection access details

* [EC-14] fix migration names

* [EC-14] bumpAccountRevisionDate when deleting collections

* [EC-14] new line in collection service

* [EC-14] formatting and add .sql to proc file

* [EC-14] more formatting

* [EC-14] formatting

* [EC-14] fix whitespace

* [EC-14] add datetime to event log of single delete

* [EC-14] remove ToList() from enumerables not returned

* [EC-14] fix permissions on "Create new collection"
- a custom user with "Create new collections" should see all collections

* [EC-14] add bulk events for collections

* [EC-14] group collections from db before iterating

* [EC-14] sql formatting and missing GO

* [EC-14] fix tests

* [EC-14] add null handling to repo methods

* [EC-14] fix account revision call

* [EC-14] formatting

* [EC-548] Member Details Group Tab (#2508)

* [EC-548] Update models to support groups

* [EC-548] Include groups in invite and save organization user methods

* [EC-548] Pass groups to service methods in member/user controllers

* [EC-548] Fix failing tests

* [EC-548] Add option to include groups for GET org user query

* Formatting

* [EC-887] Server fix for managers seeing options to edit/delete Collections they aren't assigned to (#2542)

* [EC-887] Add Assigned property to CollectionResponseModel

A new property to determine if a collection is assigned to the acting user; as some users, have the view all collections permission, but cannot see every collection's items

* [EC-887] Update logic for retrieving GET all collection details

- Only need to check the ViewAllCollections permission
- Calculate new Assigned response property based on the assignedOrgCollections list

* Formatting

* [EC-887] Update unit tests

Co-authored-by: Shane Melton <smelton@bitwarden.com>
Co-authored-by: Jacob Fink <jfink@bitwarden.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
2023-01-19 11:00:54 -05:00
juliokele
9e75f65a2d
PostgreSQL EF Contains() in SQL Query is strpos(), witch is case-sensitive (#2512)
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
2023-01-19 10:15:37 -05:00
Kyle Spearrin
6f04298e17
Data protection for user columns at rest (#2571)
* ServerProtectedData for user entity

* remove using statements

* formatting

* use data protection libs

* no async

* add data protection to ef user repo

* switch to `SetApplicationName` per ASPNET docs

* null checks

* cleanup

* value converter for EF

* new line at eof

* fix using

* remove folder ref

* restore ctor

* fix lint

* use global constant

* UseApplicationServiceProvider for integration tests

* implement constant for DatabaseFieldProtectedPrefix

* Fix EF IntegrationTest

* restore original values after protect and save

* lint fixes

* Use Constants

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
2023-01-18 13:16:57 -05:00
Rui Tomé
22201bf30a
[EC-619] Exceeding seat limit results in vague "Unhandled server error" message (#2558)
* [EC-619] Added 'AggregateException' type to ExceptionHandlerFilter to return error messages in response

* [EC-619] Updated ExceptionHandlerFilterAttribute to return multiple errors using ErrorResponseModel internal property
2023-01-18 09:56:08 +00:00
Rui Tomé
119c815c16
[EC-912] Updated IdentityServerTests to reinitialize the database on constructor (#2538)
* [EC-912] Updated IdentityServerTests to reinitialize the database on constructor

* [EC-912] dotnet format
2023-01-17 15:21:36 +00:00
Justin Baur
c6e2db1ff5
Remove Unused Auto Properties (#2580)
* Correct Auto Navigation Property

* Add Needed Migration
2023-01-13 14:24:58 -05:00
Oscar Hinton
504395a4e1
Fix linting errors (#2577)
* Fix linting errors

* Use microsoft.Data.SqlClient
2023-01-13 17:02:44 +01:00
Oscar Hinton
1f0fc43278
[SM-394] Secrets Manager (#2164)
Long lived feature branch for Secrets Manager

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
Co-authored-by: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com>
Co-authored-by: CarleyDiaz-Bitwarden <103955722+CarleyDiaz-Bitwarden@users.noreply.github.com>
Co-authored-by: Thomas Avery <tavery@bitwarden.com>
Co-authored-by: Colton Hurst <colton@coltonhurst.com>
2023-01-13 15:02:53 +01:00
Matt Gibson
09e524c9a2
Include SQLite in migrations (#2559) 2023-01-12 07:59:00 -06:00
Kyle Spearrin
e06323d94b
add missing connectors to nginx template (#2569) 2023-01-12 08:47:02 -05:00
Matt Bishop
503630497e
[PS-2185] Update defaults for SQL Server to trust the server certificate (#2563)
* Update defaults for SQL Server to trust the server certificate

* Use an explicit
2023-01-10 17:13:33 -05:00
Matt Bishop
df2edcfb8c
Migrate to Microsoft.Data.SqlClient (#2548) 2023-01-10 15:58:41 -05:00
github-actions[bot]
4c6354cd5b
Bump version to 2023.1.0 (#2562)
Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com>
2023-01-10 13:11:56 -07:00
Todd Martin
145071d499
Remove EF migration scripts (#2550)
* Removed Scripts folders

* Removed .csproj references.

* Added back HelperScripts

* Added back additional helper scripts.

* Fixed extra ItemGroup
2023-01-10 13:46:19 -05:00
Matt Bishop
ea9e30c35f
Upload and process test results as an artifact and report (#2555) 2023-01-10 10:58:19 -05:00
Kyle Spearrin
97b5a7e55d
add sqlite migrations for avatar color (#2543)
* add sqlite migrations for avatar color

* lint fix
2023-01-10 07:50:34 -05:00
cyprain-okeke
e7958609b6
[PS 2020] Fixing value cannot be null, parameter source (#2554)
* Fixing value cannot be null, parameter source

* Running the dotnet format -v diag
2023-01-09 14:51:34 +01:00
Oscar Hinton
b1dfbe7519
[SM-412] Remove postgres timezone legacy behavior (#2547) 2023-01-09 11:53:47 +01:00
Matt Bishop
452891b39e
Upgrade to the latest System.Data.SqlClient (#2546) 2023-01-06 14:36:12 -05:00
Kyle Spearrin
e800219d73
change unified to debian images (#2514)
* change to debian images

* add back sqlite connectionstring

* add back sqlite connection string

* Update docker-unified/entrypoint.sh

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

* Update docker-unified/entrypoint.sh

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

* update settings

* uid requires #

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2023-01-05 09:27:28 -05:00
Mathijs van Veluw
3e07d0bd32
Fix Inactive two-step login check (#2523)
It looks like 2fa.directory has changed it's API endpoint.
According to https://2fa.directory/api/ it now uses `api.2fa.directory` instead of `2fa.directory/api`.

This PR fixes the URL's where needed.
A fix for the client side is also created.
2023-01-03 19:57:53 +01:00
Brandon Maharaj
aa1f443530
[SG-58] Avatar color selector (#2330)
* chore: backend work

* changed typing to match efc

* Update User_Update.sql

* fix: script cleanup

* fix: adjust max length

* fix: adjust max length

* fix: added missing script changes

* fix: use short form for creating objects

* add: mysql migrations

* chore: add mysql script

* chore: posgres migrations

* chore: postgres migrations

* fix: lint

* Update 20221115034053_AvatarColor.cs

* fix: removed gravatar inline (#2447)

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
2023-01-01 11:28:59 -05:00
mimartin12
90ef8d863a
Remove deprecated workflow (#2525) 2022-12-30 13:52:48 -06:00