1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-13 09:08:17 -05:00

145 Commits

Author SHA1 Message Date
Federico Maccaroni
6f60d24f5a
Email verification for new devices ()
* PS-56 Added Email 2FA on login with new devices that don't have any 2FA enabled

* PS-56 Fixed wrong argument in VerifyTwoFactor call
2022-04-01 17:08:47 -03:00
Oscar Hinton
cd61c826f9
[BEEEP] Add explicit error message when uploading the wrong license type () 2022-02-07 09:43:00 +01:00
Oscar Hinton
ac8ca46f0f
Remove the u2f lib () 2022-01-24 12:14:04 +01:00
Justin Baur
5268f2781e
Start Migration from Newtonsoft.Json to System.Text.Json ()
* Start switch to System.Text.Json

* Work on switching to System.Text.Json

* Main work on STJ refactor

* Fix build errors

* Run formatting

* Delete unused file

* Use legacy for two factor providers

* Run formatter

* Add TokenProviderTests

* Run formatting

* Fix merge issues

* Switch to use JsonSerializer

* Address PR feedback

* Fix formatting

* Ran formatter

* Switch to async

* Ensure Enums are serialized as strings

* Fix formatting

* Enqueue single items as arrays

* Remove CreateAsync method on AzureQueueService
2022-01-21 09:36:25 -05:00
Oscar Hinton
e4a10aae27
Split out repositories to Infrastructure.Dapper / EntityFramework () 2022-01-11 10:40:51 +01:00
Oscar Hinton
6008715abc
Add check to ensure admins or owners arn't enrolled in key connector () 2021-11-18 21:56:13 +01:00
Oscar Hinton
f866b25e43
Key Connector feature toggle () 2021-11-17 11:46:35 +01:00
Oscar Hinton
fd37cb5a12
Add support for Key Connector OTP and account migration ()
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2021-11-09 16:37:32 +01:00
Kyle Spearrin
7cc7b84eaf
use fixed-time comparison of secrets () 2021-11-08 15:55:42 -05:00
Oscar Hinton
c5d5601464
Add support for crypto agent () 2021-10-25 15:09:14 +02:00
Oscar Hinton
79447b6671
Remove Business Portal () 2021-10-06 10:39:13 +02:00
Thomas Rittson
66629b2f1c
Refactor policy checks ()
* Move policy checking logic inside PolicyService

* Refactor to use currentContext.ManagePolicies

* Make orgUser status check more semantic

* Fix single org user checks

* Use CoreHelper implementation to deserialize json

* Refactor policy checks to use db query

* Use new db query for enforcing 2FA Policy

* Add Policy_ReadByTypeApplicableToUser

* Stub out EF implementations

* Refactor: use PolicyRepository only

* Refactor tests

* Copy SQL queries to proj and update sqlproj file

* Refactor importCiphersAsync to use new method

* Add EF implementations and tests

* Refactor SQL to remove unnecessary operations
2021-09-28 06:54:28 +10:00
Oscar Hinton
c22e48c1b4
Resolve error when deleting an account connected to a provider () 2021-09-15 20:34:06 +02:00
Vincent Salucci
f2520ed7be
[Reset Password] Enable force password reset () 2021-08-31 14:23:06 -05:00
Addison Beck
824645250e
toggled the force password reset flow off ()
* toggled the force password reset flow off

* Update UserService.cs
2021-08-12 13:09:08 -04:00
Vincent Salucci
53a93ffcea
[Reset Password v1] Updated force password reset models () 2021-08-05 13:00:24 -05:00
Vincent Salucci
46fa6f6673
[Reset Password v1] Update Temporary Password API ()
* [Reset Password v1] Update Temporary Password API

* Fixed Noop interface
2021-07-22 09:20:14 -05:00
Thomas Rittson
86a12efa76
[send.key] Update send.key when account encryption key is rotated ()
* Rotate send.key with account encryption key

* Update tests

* Improve and refactor style, fix typo

* Use null instead of empty lists

* Revert "Use null instead of empty lists"

This reverts commit 775a52ca568ce7eb2b5dd85a33a3b38dcab339e4.

* Fix style (use AddRange instead of reassignment)
2021-07-02 06:27:03 +10:00
Vincent Salucci
c56dd04096
[Reset Password] Email template () 2021-05-26 16:54:25 -05:00
Vincent Salucci
d7f3507d44
[Reset Password] Added new event type for admin password reset () 2021-05-26 15:51:54 -05:00
Vincent Salucci
c7f88ae430
[Reset Password] Get/Post Org Keys and API updates ()
* [Reset Password] Organization Keys APIs

* Updated details response to include private key and added more security checks for reset password methods

* Added org type and policy security checks to the enrollment api

* Updated based on PR feedback

* Added org user type permission checks

* Added TODO for email to user

* Removed unecessary policyRepository object
2021-05-19 09:40:32 -05:00
Oscar Hinton
a47b86a995
Remove U2F APIs again ()
* Revert "U2F ()"

This reverts commit ce4f025a0c2f24c051d4e3d6baeeaeb69b45b730.

* Avoid removing WebAuthn fixes
2021-05-12 19:48:00 +02:00
Oscar Hinton
cb9ed50248
Discourage user verification on WebAuthn enroll () 2021-05-12 18:46:35 +02:00
Oscar Hinton
ce4f025a0c
U2F ()
* Delete U2F tokens alongside WebAuthn

* Bring back u2f apis
2021-05-05 16:14:49 +02:00
Vincent Salucci
477f679fc6
[Reset Password] Admin reset actions ()
* [Reset Password] Admin reset actions

* Updated thrown except for permission collision

* Updated GET/PUT password reset to use orgUser.Id for db operations
2021-04-20 16:58:57 -05:00
Oscar Hinton
07f37d1f74
WebAuthn () 2021-03-22 23:21:43 +01:00
Matt Gibson
5537470703
Use sas token for attachment downloads ()
* Get limited life attachment download URL

This change limits url download to a 1min lifetime.
This requires moving to a new container to allow for non-public blob
access.

Clients will have to call GetAttachmentData api function to receive the download
URL. For backwards compatibility, attachment URLs are still present, but will not
work for attachments stored in non-public access blobs.

* Make GlobalSettings interface for testing

* Test LocalAttachmentStorageService equivalence

* Remove comment

* Add missing globalSettings using

* Simplify default attachment container

* Default to attachments containe for existing methods

A new upload method will be made for uploading to attachments-v2.
For compatibility for clients which don't use these new methods, we need
to still use the old container. The new container will be used only for
new uploads

* Remove Default MetaData fixture.

* Keep attachments container blob-level security for all instances

* Close unclosed FileStream

* Favor default value for noop services
2021-02-22 15:35:16 -06:00
Matt Gibson
edd4bc2623
Add disable send policy ()
* Add Disable Send policy

* Test DisableSend policy

* PR Review

* Update tests for using CurrentContext

This required making an interface for CurrentContext and mocking out
the members used. The interface can be expanded as needed for tests.

I moved CurrentContext to a folder, which changes the namespace
and causes a lot of file touches, but most are just adding a reference

* Fix failing test

* Update exemption to include all exempt users

* Move all CurrentContext usages to ICurrentContext

* PR review. Match messaging with Web
2021-02-04 12:54:21 -06:00
Addison Beck
25a9991908
Implement User-based API Keys ()
* added column ApiKey to dbo.User

* added dbo.User.ApiKey to User_Update

* added dbo.User.ApiKey to User_Create

* wrote migration script for implementing dbo.User.ApiKey

* Added ApiKey prop to the User table model

* Created AccountsController method for getting a user's API Key

* Created AccountsController method for rotating a user API key

* Added support to ApiClient for passed-through ClientSecrets when the request comes from the cli

* Added a new conditional to ClientStore to account for user API keys

* Wrote unit tests for new user API Key methods

* Added a refresh of dbo.UserView to new migration script for ApiKey

* Let client_credentials grants into the custom token logic

* Cleanup for ApiKey auth in the CLI feature

* Created user API key on registration

* Removed uneeded code for user API keys

* Changed a .Contains() to a .StartsWith() in ClientStore

* Changed index that an array is searched on

* Added more claims to the user apikey clients

* Moved some claim finding logic to a helper method
2020-11-10 15:15:29 -05:00
Vincent Salucci
50cf16a3fb
[SSO] New user provision flow ()
* Initial commit of accept user during set password flow

* changed new org user from accepted to invited // moved another check to token accept function

* Revised some white space // Moved business logic to UserService

* Fixed UserServiceTest

* Removed some white-space

* Removed more white-space

* Final white-space issues
2020-10-13 15:00:33 -05:00
Vincent Salucci
c0e99d4047
Removed security stamp rotation during set-password SSO flow () 2020-09-14 14:27:30 -05:00
Addison Beck
59f8467f7c
Create sso user api ()
* facilitate linking/unlinking existing users from an sso enabled org

* added user_identifier to identity methods for sso

* moved sso user delete method to account controller

* fixed a broken test

* Update AccountsController.cs

* facilitate linking/unlinking existing users from an sso enabled org

* added user_identifier to identity methods for sso

* moved sso user delete method to account controller

* fixed a broken test

* added a token to the existing user sso link flow

* added a token to the existing user sso link flow

* fixed a typo

* added an event log for unlink ssoUser records

* fixed a merge issue

* fixed a busted test

* fixed a busted test

* ran a formatter over everything & changed .vscode settings in .gitignore

* chagned a variable to use string interpolation

* removed a blank line

* Changed TokenPurpose enum to a static class of strings

* code review cleanups

* formatting fix

* Changed parameters & logging for delete sso user

* changed th method used to get organization user for deleting sso user records

Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
2020-08-26 14:12:04 -04:00
Kyle Spearrin
2872bda6fe
tool to generate licenses ()
* tool to generate licenses

* code review feedback
2020-08-18 17:00:21 -04:00
Kyle Spearrin
d190c4bd0f
Update APIs to collect other set password info () 2020-08-17 10:40:35 -04:00
Kyle Spearrin
cd926ca8f6
allow user registration for sso () 2020-08-13 17:30:10 -04:00
Kyle Spearrin
783b4804ec
SSO support ()
* [SSO] Added change password API ()

* Created API for updating password with no current comparison

* Changed name of method and request // Added user has password error flow

* Updated user service method name // Updated string null/empty check

* Replaced hardcoded sso domain hints with config loader ()

* Replaced hardcoded sso domain hints with config loader

* use async/await for sso config loader

* Update AccountsController.cs

Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com>
Co-authored-by: Matt Portune <mportune@bitwarden.com>
Co-authored-by: Matt Portune <59324545+mportune-bw@users.noreply.github.com>
2020-08-12 17:03:09 -04:00
Chad Scharf
2742b414fd
reference event changes and cleanup () 2020-07-15 12:38:45 -04:00
Chad Scharf
7af50172e0
Reference event service implementation ()
* Reference event service implementation

* Fix IReferenceable implementation of Id

* add structure to event body
2020-07-07 12:01:34 -04:00
Chad Scharf
0f28ac45f9 Consistency on TaxInfo use in service params 2020-06-18 10:41:55 -04:00
Chad Scharf
b7a500eb63 combined tax updates with other operations 2020-06-17 19:49:27 -04:00
Kyle Spearrin
10a6e12d09
generate signin token for enterprise portal () 2020-05-12 15:36:33 -04:00
Chad Scharf
9800b752c0 Changed all C# control flow block statements to include space between keyword and open paren 2020-03-27 14:36:37 -04:00
Kyle Spearrin
71d9ffdd9d
CheckPoliciesOnTwoFactorRemoval for 2fa recovery () 2020-02-28 10:23:19 -05:00
Kyle Spearrin
621192b701
enable email 2fa if joining an org with policy () 2020-02-28 09:14:33 -05:00
Kyle Spearrin
f54ebfdc75
email user whenever they're removed from org because of 2fa policy () 2020-02-27 09:30:03 -05:00
Kyle Spearrin
81424a8526
Enforce 2fa policy () 2020-02-19 14:56:16 -05:00
Brian Becker
0be86072f7 Add email notification on Two Factor recovery use ()
* Add email notification on Two Factor recovery use

* A user who has lost their 2fa device can clear out the
  2fa settings using a recovery code.  When this happens
  it gets logged but no notification to the user occurs.
* Add a notification to be sent when 2fa recovery code is
  used

* Add email message templates
2019-12-23 15:26:39 -05:00
Kyle Spearrin
b72744eafc alloe sub cancellation when deleting account 2019-09-20 13:45:47 -04:00
Kyle Spearrin
e9174ba9f4 iap pre-purchase check 2019-09-19 08:46:26 -04:00
Kyle Spearrin
bed2a0ab7b no additional storage for premium 2019-09-18 10:52:53 -04:00