Bernd Schoolmann
dfa4c3a12b
Fix test
2025-12-04 13:29:31 +01:00
Bernd Schoolmann
3b83307d21
Tests
2025-12-02 18:06:11 +01:00
Maciej Zieniuk
6324f692b8
[PM-23249] Prevent log-out when changing KDF settings ( #6349 )
...
* Prevent log-out when changing KDF settings with feature flag.
* validate salt unchanged for user to throw bad request (400), not internal server error (500)
* change kdf integration tests
* failing tests
* iuncorrect tests wording
* conditional logout
* log out reason as enum
* explicit naming
2025-10-21 19:03:25 +02:00
Bernd Schoolmann
4bf7cf956b
[PM-21034] Feature Branch - "User Crypto V2" ( #5982 )
...
* [PM-21034] Database changes for signature keypairs (#5906 )
* Add signing key repositories, models, and sql migration scripts
* Rename UserSigningKeys table to UserSigningKey
* Rename signedpublickeyownershipclaim to signedpublickey
* Move signedPublicKey to last parameter
* Add newline at end of file
* Rename to signature key pair
* Further rename to signaturekeypair
* Rename to UserSignatureKeyPairRepository
* Add newline
* Rename more instances to UserSignatureKeyPair
* Update parameter order
* Fix order
* Add more renames
* Cleanup
* Fix sql
* Add ef migrations
* Fix difference in SQL SP compared to migration SP
* Fix difference in SQL SP vs migration
* Fix difference in SQL SP vs migration
* Attempt to fix sql
* Rename migration to start later
* Address feedback
* Move UserSignatureKeyPair to KM codeownership
* Fix build
* Fix build
* Fix build
* Move out entitytypeconfiguration
* Use view for reading usersignaturekeypairs
* Fix migration script
* Fix migration script
* Drop view if exists
* Enable nullable
* Replace with create or alter view
* Switch go generatecomb
* Switch to generatecomb
* Move signature algorithm
* Move useresignaturekeypairentitytypeconfiguration to km ownership
* Move userSignatureKeyPair model
* Unswap file names
* Move sql files to km ownership
* Add index on userid for signature keys
* Fix wrong filename
* Remove string length limit
* Regenerate EF migrations
* Undo changes to program.cs
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Rename dbset to plural
* Update src/Infrastructure.EntityFramework/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
---------
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* [PM-21034] Implement api changes to retreive signing keys (#5932 )
* Add signing key repositories, models, and sql migration scripts
* Rename UserSigningKeys table to UserSigningKey
* Rename signedpublickeyownershipclaim to signedpublickey
* Move signedPublicKey to last parameter
* Add newline at end of file
* Rename to signature key pair
* Further rename to signaturekeypair
* Rename to UserSignatureKeyPairRepository
* Add newline
* Rename more instances to UserSignatureKeyPair
* Update parameter order
* Fix order
* Add more renames
* Cleanup
* Fix sql
* Add ef migrations
* Fix difference in SQL SP compared to migration SP
* Fix difference in SQL SP vs migration
* Fix difference in SQL SP vs migration
* Attempt to fix sql
* Rename migration to start later
* Address feedback
* Move UserSignatureKeyPair to KM codeownership
* Fix build
* Fix build
* Fix build
* Move out entitytypeconfiguration
* Use view for reading usersignaturekeypairs
* Fix migration script
* Fix migration script
* Add initial get keys endpoint
* Add sync response
* Cleanup
* Add query and fix types
* Add tests and cleanup
* Fix test
* Drop view if exists
* Add km queries
* Cleanup
* Enable nullable
* Cleanup
* Cleanup
* Enable nullable
* Fix incorrect namespace
* Remove unused using
* Fix test build
* Fix build error
* Fix build
* Attempt to fix tests
* Attempt to fix tests
* Replace with create or alter view
* Attempt to fix tests
* Attempt to fix build
* Rename to include async suffix
* Fix test
* Rename repo
* Attempt to fix tests
* Cleanup
* Test
* Undo test
* Fix tests
* Fix test
* Switch go generatecomb
* Switch to generatecomb
* Move signature algorithm
* Move useresignaturekeypairentitytypeconfiguration to km ownership
* Move userSignatureKeyPair model
* Unswap file names
* Move sql files to km ownership
* Add index on userid for signature keys
* Fix wrong filename
* Fix build
* Remove string length limit
* Regenerate EF migrations
* Undo changes to program.cs
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Rename dbset to plural
* Update src/Infrastructure.EntityFramework/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Controllers/UsersController.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Cleanup and move query to core
* Fix test
* Fix build
* Fix tests
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Switch away from primary constructor
* Use argumentNullException
* Add test
* Pass user account keys directly to profileresponsemodel
* Move registration to core
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Remove empty line
* Apply suggestions
* Fix tests
* Fix tests
---------
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* [PM-22384] Implement key-rotation based enrollment to user-crypto v2 (#5934 )
* Add signing key repositories, models, and sql migration scripts
* Rename UserSigningKeys table to UserSigningKey
* Rename signedpublickeyownershipclaim to signedpublickey
* Move signedPublicKey to last parameter
* Add newline at end of file
* Rename to signature key pair
* Further rename to signaturekeypair
* Rename to UserSignatureKeyPairRepository
* Add newline
* Rename more instances to UserSignatureKeyPair
* Update parameter order
* Fix order
* Add more renames
* Cleanup
* Fix sql
* Add ef migrations
* Fix difference in SQL SP compared to migration SP
* Fix difference in SQL SP vs migration
* Fix difference in SQL SP vs migration
* Attempt to fix sql
* Rename migration to start later
* Address feedback
* Move UserSignatureKeyPair to KM codeownership
* Fix build
* Fix build
* Fix build
* Move out entitytypeconfiguration
* Use view for reading usersignaturekeypairs
* Fix migration script
* Fix migration script
* Add initial get keys endpoint
* Add sync response
* Cleanup
* Add query and fix types
* Add tests and cleanup
* Fix test
* Drop view if exists
* Add km queries
* Cleanup
* Enable nullable
* Cleanup
* Cleanup
* Enable nullable
* Fix incorrect namespace
* Remove unused using
* Fix test build
* Fix build error
* Fix build
* Attempt to fix tests
* Attempt to fix tests
* Replace with create or alter view
* Attempt to fix tests
* Attempt to fix build
* Rename to include async suffix
* Fix test
* Rename repo
* Attempt to fix tests
* Cleanup
* Test
* Undo test
* Fix tests
* Fix test
* Switch go generatecomb
* Switch to generatecomb
* Move signature algorithm
* Move useresignaturekeypairentitytypeconfiguration to km ownership
* Move userSignatureKeyPair model
* Unswap file names
* Move sql files to km ownership
* Add index on userid for signature keys
* Fix wrong filename
* Fix build
* Remove string length limit
* Regenerate EF migrations
* Undo changes to program.cs
* Cleanup
* Add migration to user encryption v2
* Fix build
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Rename dbset to plural
* Cleanup
* Cleanup
* Fix build
* Fix test
* Add validation
* Fix test
* Apply fixes
* Fix tests
* Improve tests
* Add tests
* Add error message validation
* Fix tests
* Fix tests
* Fix test
* Add test
* Fix tests and errors
* Update src/Infrastructure.EntityFramework/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Controllers/UsersController.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Cleanup and move query to core
* Fix test
* Fix build
* Fix tests
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Switch away from primary constructor
* Use argumentNullException
* Add test
* Pass user account keys directly to profileresponsemodel
* Fix build
* Fix namespace
* Make signedpublickey optional
* Remove unused file
* Fix cases for request data conversion
* Revert constructor change
* Undo comments change
* Apply fixes
* Move registration to core
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Remove empty line
* Apply suggestions
* Fix tests
* Fix tests
* Fix build of integration tests
* Attempt to fix tests
* Add test
* Move v2 encryption user async below public functions
* Add todo
* Rename to have async suffix
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Address feedback
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test coverage
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Split up validation from rotation
* Fix tests
* Increase test coverage
* Rename tests
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test for no signature keypair data
* Fix build
* Enable nullable
* Fix build
* Clean up data model
* Fix tests
* Cleanup
---------
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Fix build
* [PM-22862] Account security version (#5995 )
* Add signing key repositories, models, and sql migration scripts
* Rename UserSigningKeys table to UserSigningKey
* Rename signedpublickeyownershipclaim to signedpublickey
* Move signedPublicKey to last parameter
* Add newline at end of file
* Rename to signature key pair
* Further rename to signaturekeypair
* Rename to UserSignatureKeyPairRepository
* Add newline
* Rename more instances to UserSignatureKeyPair
* Update parameter order
* Fix order
* Add more renames
* Cleanup
* Fix sql
* Add ef migrations
* Fix difference in SQL SP compared to migration SP
* Fix difference in SQL SP vs migration
* Fix difference in SQL SP vs migration
* Attempt to fix sql
* Rename migration to start later
* Address feedback
* Move UserSignatureKeyPair to KM codeownership
* Fix build
* Fix build
* Fix build
* Move out entitytypeconfiguration
* Use view for reading usersignaturekeypairs
* Fix migration script
* Fix migration script
* Add initial get keys endpoint
* Add sync response
* Cleanup
* Add query and fix types
* Add tests and cleanup
* Fix test
* Drop view if exists
* Add km queries
* Cleanup
* Enable nullable
* Cleanup
* Cleanup
* Enable nullable
* Fix incorrect namespace
* Remove unused using
* Fix test build
* Fix build error
* Fix build
* Attempt to fix tests
* Attempt to fix tests
* Replace with create or alter view
* Attempt to fix tests
* Attempt to fix build
* Rename to include async suffix
* Fix test
* Rename repo
* Attempt to fix tests
* Cleanup
* Test
* Undo test
* Fix tests
* Fix test
* Switch go generatecomb
* Switch to generatecomb
* Move signature algorithm
* Move useresignaturekeypairentitytypeconfiguration to km ownership
* Move userSignatureKeyPair model
* Unswap file names
* Move sql files to km ownership
* Add index on userid for signature keys
* Fix wrong filename
* Fix build
* Remove string length limit
* Regenerate EF migrations
* Undo changes to program.cs
* Cleanup
* Add migration to user encryption v2
* Fix build
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Rename dbset to plural
* Cleanup
* Cleanup
* Fix build
* Fix test
* Add validation
* Fix test
* Apply fixes
* Fix tests
* Improve tests
* Add tests
* Add error message validation
* Fix tests
* Fix tests
* Fix test
* Add test
* Fix tests and errors
* Update src/Infrastructure.EntityFramework/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Controllers/UsersController.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Cleanup and move query to core
* Fix test
* Fix build
* Fix tests
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Switch away from primary constructor
* Use argumentNullException
* Add test
* Pass user account keys directly to profileresponsemodel
* Fix build
* Fix namespace
* Make signedpublickey optional
* Remove unused file
* Fix cases for request data conversion
* Revert constructor change
* Undo comments change
* Apply fixes
* Move registration to core
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Remove empty line
* Apply suggestions
* Fix tests
* Fix tests
* Fix build of integration tests
* Attempt to fix tests
* Add test
* Move v2 encryption user async below public functions
* Add todo
* Rename to have async suffix
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Address feedback
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test coverage
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Split up validation from rotation
* Fix tests
* Increase test coverage
* Rename tests
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test for no signature keypair data
* Fix build
* Enable nullable
* Fix build
* Clean up data model
* Fix tests
* Merge branch 'km/signing-upgrade-rotation' into km/account-security-version
* Add security state to rotation
* Update tests
* Update tests and check for security state in v2 model
* Cleanup
* Add tests
* Add security state data to integration test
* Re-sort and remove limit
* Update migrations
* Fix sql
* Fix sql
* Fix sql
* Fix fixture
* Fix test
* Fix test
* Fix test
---------
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* [PM-22853] Add feature flag (#6090 )
* Add signing key repositories, models, and sql migration scripts
* Rename UserSigningKeys table to UserSigningKey
* Rename signedpublickeyownershipclaim to signedpublickey
* Move signedPublicKey to last parameter
* Add newline at end of file
* Rename to signature key pair
* Further rename to signaturekeypair
* Rename to UserSignatureKeyPairRepository
* Add newline
* Rename more instances to UserSignatureKeyPair
* Update parameter order
* Fix order
* Add more renames
* Cleanup
* Fix sql
* Add ef migrations
* Fix difference in SQL SP compared to migration SP
* Fix difference in SQL SP vs migration
* Fix difference in SQL SP vs migration
* Attempt to fix sql
* Rename migration to start later
* Address feedback
* Move UserSignatureKeyPair to KM codeownership
* Fix build
* Fix build
* Fix build
* Move out entitytypeconfiguration
* Use view for reading usersignaturekeypairs
* Fix migration script
* Fix migration script
* Add initial get keys endpoint
* Add sync response
* Cleanup
* Add query and fix types
* Add tests and cleanup
* Fix test
* Drop view if exists
* Add km queries
* Cleanup
* Enable nullable
* Cleanup
* Cleanup
* Enable nullable
* Fix incorrect namespace
* Remove unused using
* Fix test build
* Fix build error
* Fix build
* Attempt to fix tests
* Attempt to fix tests
* Replace with create or alter view
* Attempt to fix tests
* Attempt to fix build
* Rename to include async suffix
* Fix test
* Rename repo
* Attempt to fix tests
* Cleanup
* Test
* Undo test
* Fix tests
* Fix test
* Switch go generatecomb
* Switch to generatecomb
* Move signature algorithm
* Move useresignaturekeypairentitytypeconfiguration to km ownership
* Move userSignatureKeyPair model
* Unswap file names
* Move sql files to km ownership
* Add index on userid for signature keys
* Fix wrong filename
* Fix build
* Remove string length limit
* Regenerate EF migrations
* Undo changes to program.cs
* Cleanup
* Add migration to user encryption v2
* Fix build
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Rename dbset to plural
* Cleanup
* Cleanup
* Fix build
* Fix test
* Add validation
* Fix test
* Apply fixes
* Fix tests
* Improve tests
* Add tests
* Add error message validation
* Fix tests
* Fix tests
* Fix test
* Add test
* Fix tests and errors
* Update src/Infrastructure.EntityFramework/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Controllers/UsersController.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Cleanup and move query to core
* Fix test
* Fix build
* Fix tests
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Switch away from primary constructor
* Use argumentNullException
* Add test
* Pass user account keys directly to profileresponsemodel
* Fix build
* Fix namespace
* Make signedpublickey optional
* Remove unused file
* Fix cases for request data conversion
* Revert constructor change
* Undo comments change
* Apply fixes
* Move registration to core
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Remove empty line
* Apply suggestions
* Fix tests
* Fix tests
* Fix build of integration tests
* Attempt to fix tests
* Add test
* Move v2 encryption user async below public functions
* Add todo
* Rename to have async suffix
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Address feedback
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test coverage
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Split up validation from rotation
* Fix tests
* Increase test coverage
* Rename tests
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test for no signature keypair data
* Fix build
* Enable nullable
* Fix build
* Clean up data model
* Fix tests
* Merge branch 'km/signing-upgrade-rotation' into km/account-security-version
* Add security state to rotation
* Update tests
* Add feature flag
* Update tests and check for security state in v2 model
* Cleanup
* Add tests
* Add security state data to integration test
* Re-sort and remove limit
* Update migrations
* Fix sql
* Fix sql
* Fix sql
* Fix fixture
* Fix test
* Fix test
* Fix test
---------
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* [PM-23222] Update revision date on key rotation (#6038 )
* Add signing key repositories, models, and sql migration scripts
* Rename UserSigningKeys table to UserSigningKey
* Rename signedpublickeyownershipclaim to signedpublickey
* Move signedPublicKey to last parameter
* Add newline at end of file
* Rename to signature key pair
* Further rename to signaturekeypair
* Rename to UserSignatureKeyPairRepository
* Add newline
* Rename more instances to UserSignatureKeyPair
* Update parameter order
* Fix order
* Add more renames
* Cleanup
* Fix sql
* Add ef migrations
* Fix difference in SQL SP compared to migration SP
* Fix difference in SQL SP vs migration
* Fix difference in SQL SP vs migration
* Attempt to fix sql
* Rename migration to start later
* Address feedback
* Move UserSignatureKeyPair to KM codeownership
* Fix build
* Fix build
* Fix build
* Move out entitytypeconfiguration
* Use view for reading usersignaturekeypairs
* Fix migration script
* Fix migration script
* Add initial get keys endpoint
* Add sync response
* Cleanup
* Add query and fix types
* Add tests and cleanup
* Fix test
* Drop view if exists
* Add km queries
* Cleanup
* Enable nullable
* Cleanup
* Cleanup
* Enable nullable
* Fix incorrect namespace
* Remove unused using
* Fix test build
* Fix build error
* Fix build
* Attempt to fix tests
* Attempt to fix tests
* Replace with create or alter view
* Attempt to fix tests
* Attempt to fix build
* Rename to include async suffix
* Fix test
* Rename repo
* Attempt to fix tests
* Cleanup
* Test
* Undo test
* Fix tests
* Fix test
* Switch go generatecomb
* Switch to generatecomb
* Move signature algorithm
* Move useresignaturekeypairentitytypeconfiguration to km ownership
* Move userSignatureKeyPair model
* Unswap file names
* Move sql files to km ownership
* Add index on userid for signature keys
* Fix wrong filename
* Fix build
* Remove string length limit
* Regenerate EF migrations
* Undo changes to program.cs
* Cleanup
* Add migration to user encryption v2
* Fix build
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update util/Migrator/DbScripts/2025-06-01_00_AddSignatureKeyPairTable.sql
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Rename dbset to plural
* Cleanup
* Cleanup
* Fix build
* Fix test
* Add validation
* Fix test
* Apply fixes
* Fix tests
* Improve tests
* Add tests
* Add error message validation
* Fix tests
* Fix tests
* Fix test
* Add test
* Fix tests and errors
* Update src/Infrastructure.EntityFramework/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Controllers/UsersController.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Cleanup and move query to core
* Fix test
* Fix build
* Fix tests
* Update src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Switch away from primary constructor
* Use argumentNullException
* Add test
* Pass user account keys directly to profileresponsemodel
* Fix build
* Fix namespace
* Make signedpublickey optional
* Remove unused file
* Fix cases for request data conversion
* Revert constructor change
* Undo comments change
* Apply fixes
* Move registration to core
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/Startup.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Remove empty line
* Apply suggestions
* Fix tests
* Fix tests
* Fix build of integration tests
* Attempt to fix tests
* Add test
* Move v2 encryption user async below public functions
* Add todo
* Rename to have async suffix
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Address feedback
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test coverage
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Split up validation from rotation
* Fix tests
* Increase test coverage
* Rename tests
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Update src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Add test for no signature keypair data
* Fix build
* Enable nullable
* Fix build
* Clean up data model
* Fix tests
* Merge branch 'km/signing-upgrade-rotation' into km/account-security-version
* Add security state to rotation
* Update tests
* Update revision date on key rotation
* Update tests and check for security state in v2 model
* Cleanup
* Add tests
* Add security state data to integration test
* Re-sort and remove limit
* Update migrations
* Fix sql
* Fix sql
* Fix sql
* Fix fixture
* Fix test
* Fix test
* Fix test
* Add test for change date
---------
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
* Fix signing keys
* Update sql migrations
* Fix tests
* Add keys to identity token response
* Fix tests
* Fix tests
* Fix formatting
* Update src/Infrastructure.EntityFramework/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Infrastructure.Dapper/KeyManagement/Repositories/UserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Controllers/UsersController.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Models/Requests/SignatureKeyPairRequestModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Api/KeyManagement/Models/Requests/PublicKeyEncryptionKeyPairRequestModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Entities/UserSignatureKeyPair.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Repositories/IUserSignatureKeyPairRepository.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Queries/UserAccountKeysQuery.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Data/PublicKeyEncryptionKeyPairData.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Entities/UserSignatureKeyPair.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Data/RotateUserAccountKeysData.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Data/SignatureKeyPairData.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Data/SecurityStateData.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Data/UserAccountKeysData.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Request/SecurityStateModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Response/PrivateKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Response/PublicKeysResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Response/PublicKeyEncryptionKeyPairResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Queries/Interfaces/IUserAcountKeysQuery.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Update src/Core/KeyManagement/Models/Response/SignatureKeyPairResponseModel.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Remove unnecessary file
* Add eof spacing
* Move models
* Fix build
* Move models to API subdirectory
* Rename model
* Remove migrations
* Add new ef migrations
* Remove empty line
* Only query account keys if the user has keys
* Dotnet format
* Fix test
* Update test/Identity.Test/IdentityServer/BaseRequestValidatorTests.cs
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
* Apply suggestion
* Fix whitespace
* Force camel case on response models
* Address feedback for sql files
* Fix build
* Make index unique
* Add contstraints
* Fix sql
* Fix order
* Cleanup
* Fix build
* Update migrations
* Update EF migrations
* Change parameters to nvarchar
* Update to Varchar
* Apply feedback
* Move refresh view
* Attempt to fix build
* Undo sql changes
* Apply feedback about varchar
* Apply feedback about refresh view
* Apply feedback about new lines
* Address SQL feedback
* Re-sort columns
* Fix build
* Fix order
* Fix build
---------
Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com >
Co-authored-by: Maciej Zieniuk <167752252+mzieniukbw@users.noreply.github.com >
2025-10-20 12:51:08 +02:00
Bernd Schoolmann
ff092a031e
[PM-23229] Add extra validation to kdf changes + authentication data + unlock data ( #6121 )
...
* Added MasterPasswordUnlock to UserDecryptionOptions as part of identity response
* Implement support for authentication data and unlock data in kdf change
* Extract to kdf command and add tests
* Fix namespace
* Delete empty file
* Fix build
* Clean up tests
* Fix tests
* Add comments
* Cleanup
* Cleanup
* Cleanup
* Clean-up and fix build
* Address feedback; force new parameters on KDF change request
* Clean-up and add tests
* Re-add logger
* Update logger to interface
* Clean up, remove Kdf Request Model
* Remove kdf request model tests
* Fix types in test
* Address feedback to rename request model and re-add tests
* Fix namespace
* Move comments
* Rename InnerKdfRequestModel to KdfRequestModel
---------
Co-authored-by: Maciej Zieniuk <mzieniuk@bitwarden.com >
2025-09-23 16:10:46 -04:00
Todd Martin
79ad1dbda0
fix(2fa): [PM-22323] Do not show 2FA warning for 2FA setup and login emails
...
* Added configuration to not display 2FA setup instruction
* Refactored to new service.
* Linting.
* Dependency injection
* Changed to scoped to have access to ICurrentContext.
* Inverted logic for EmailTotpAction
* Fixed tests.
* Fixed tests.
* More tests.
* Fixed tests.
* Linting.
* Added tests at controller level.
* Linting
* Fixed error in test.
* Review updates.
* Accidentally deleted imports.
2025-07-07 10:56:59 -04:00
Bernd Schoolmann
34580f0472
Remove key rotation v1 ( #5939 )
2025-06-24 16:32:38 +02:00
Thomas Rittson
a1b22e66e5
[PM-14613] Remove account deprovisioning feature flag ( #5676 )
...
* Remove flag
* Remove old tests
* Remove old xmldoc referencing the flag
* Remove old emails
2025-05-13 07:17:54 +10:00
Ike
3f95513d11
[PM-19029][PM-19203] Addressing UserService tech debt around ITwoFactorIsEnabledQuery ( #5754 )
...
* fix : split out the interface from the TwoFactorAuthenticationValidator into separate file.
* fix: replacing IUserService.TwoFactorEnabled with ITwoFactorEnabledQuery
* fix: combined logic for both bulk and single user look ups for TwoFactorIsEnabledQuery.
* fix: return two factor provider enabled on CanGenerate() method.
* tech debt: modfifying MFA providers to call the database less to validate if two factor is enabled.
* tech debt: removed unused service from AuthenticatorTokenProvider
* doc: added documentation to ITwoFactorProviderUsers
* doc: updated comments for TwoFactorIsEnabled impl
* test: fixing tests for ITwoFactorIsEnabledQuery
* test: updating tests to have correct DI and removing test for automatic email of TOTP.
* test: adding better test coverage
2025-05-09 11:39:57 -04:00
Jared McCannon
dcd62f00ba
[PM-15420] Managed to Claimed ( #5594 )
...
* Renamed ManagedUserDomainClaimedEmails to ClaimedUserDomainClaimedEmails
* Renamed method to improve clarity and consistency.
Replaced `ValidateManagedUserDomainAsync` with `ValidateClaimedUserDomainAsync`.
* Rename `GetOrganizationsManagingUserAsync` to `GetOrganizationsClaimingUserAsync`.
This renaming clarifies the function's purpose, aligning its name with the concept of "claiming" rather than "managing" user associations.
* Refactor variable naming in ValidateClaimedUserDomainAsync
* Managed to claimed
* Managed to claimed
* Managed to claimed
* Managing to Claiming
* Managing to Claiming
* Managing to Claiming
* Managing to Claiming
* Renamed DeleteManagedOrganizationUserAccountCommand to DeleteClaimedOrganizationUserAccountCommand
* Renamed IDeleteManagedOrganizationUserAccountCommand to IDeleteClaimedOrganizationUserAccountCommand
* Updated variable name
* IsManagedBy to IsClaimedBy
* Created new property. obsoleted old property and wired up for backward compatibility.
* More Managed to Claimed renames.
* Managed to Claimed
* Fixing tests... 🤦
* Got the rest of em
* missed the test 🤦
* fixed test.
2025-04-08 14:38:44 -05:00
Jonas Hendrickx
ac25ec4519
[PM-19002] Extract billing code from AccountsController ( #5477 )
2025-03-10 18:14:22 +01:00
Jimmy Vo
6ca98df721
Ac/pm 17449/add managed user validation to email token ( #5437 )
2025-02-24 10:42:04 -05:00
Jimmy Vo
06c96a96c5
[PM-17449] Add logic to handle email updates for managed users. ( #5422 )
2025-02-20 15:38:59 -05:00
Bernd Schoolmann
58d2a7ddaa
[PM-17210] Prevent unintentionally corrupting private keys ( #5285 )
...
* Prevent unintentionally corrupting private keys
* Deny key update only when replacing existing keys
* Fix incorrect use of existing user public/encrypted private key
* Fix test
* Fix tests
* Re-add test
* Pass through error for set-password
* Fix test
* Increase test coverage and simplify checks
2025-02-06 20:38:50 +00:00
Ike
a84ef0724c
[PM-15614] Allow Users to opt out of new device verification ( #5176 )
...
feat(NewDeviceVerification) :
* Created database migration scripts for VerifyDevices column in [dbo].[User].
* Updated DeviceValidator to check if user has opted out of device verification.
* Added endpoint to AccountsController.cs to allow editing of new User.VerifyDevices property.
* Added tests for new methods and endpoint.
* Updating queries to track [dbo].[User].[VerifyDevices].
* Updated DeviceValidator to set `User.EmailVerified` property during the New Device Verification flow.
2025-01-08 07:31:24 -08:00
Bernd Schoolmann
fae8692d2a
[PM-12607] Move key rotation & validators to km ownership ( #4941 )
...
* Move key rotation & validators to km ownership
* Fix build errors
* Fix build errors
* Fix import ordering
* Update validator namespace
* Move key rotation data to km ownership
* Fix linting
* Fix namespaces
* Fix namespace
* Fix namespaces
* Move rotateuserkeycommandtests to km ownership
2024-11-21 19:17:04 +01:00
Rui Tomé
4b76008245
[PM-11406] Account Management: Prevent a verified user from deleting their account ( #4878 )
...
* Add check for managed user before purging account
* Rename IOrganizationRepository.GetByClaimedUserDomainAsync to GetByVerifiedUserEmailDomainAsync and refactor to return a list. Remove ManagedByOrganizationId from ProfileResponseMode. Add ManagesActiveUser to ProfileOrganizationResponseModel
* Rename the property ManagesActiveUser to UserIsManagedByOrganization
* Remove whole class #nullable enable and add it to specific places
* [PM-11405] Account Deprovisioning: Prevent a verified user from changing their email address
* Remove unnecessary .ToList()
* Refactor IUserService methods GetOrganizationsManagingUserAsync and IsManagedByAnyOrganizationAsync to not return nullable objects. Update ProfileOrganizationResponseModel.UserIsManagedByOrganization to not be nullable
* Prevent deletion of accounts managed by an organization when Account Deprovisioning is enabled
* Add CannotDeleteManagedAccountViewModel and email templates
- Added CannotDeleteManagedAccountViewModel class to handle emails related to preventing deletion of accounts managed by an organization.
- Added HTML and text email templates for sending notifications about the inability to delete an account owned by an organization.
- Updated IMailService interface with a new method to send the cannot delete managed account email.
- Implemented the SendCannotDeleteManagedAccountEmailAsync method in HandlebarsMailService.
- Added a check in UserService to send the cannot delete managed account email if the user is managed by any organization.
- Added a no-op implementation for SendCannotDeleteManagedAccountEmailAsync in NoopMailService.
* Update error message when unable to purge vault for managed account
* Update error message when unable to change email for managed account
* Update error message when unable to delete account when managed by organization
* Update error message in test for deleting organization-owned accounts
2024-11-04 16:37:21 +00:00
Rui Tomé
c126fee296
[PM-11405] Account Management: Prevent a verified user from changing their email address ( #4875 )
...
* Add check for managed user before purging account
* Rename IOrganizationRepository.GetByClaimedUserDomainAsync to GetByVerifiedUserEmailDomainAsync and refactor to return a list. Remove ManagedByOrganizationId from ProfileResponseMode. Add ManagesActiveUser to ProfileOrganizationResponseModel
* Rename the property ManagesActiveUser to UserIsManagedByOrganization
* Remove whole class #nullable enable and add it to specific places
* [PM-11405] Account Deprovisioning: Prevent a verified user from changing their email address
* Remove unnecessary .ToList()
* Refactor IUserService methods GetOrganizationsManagingUserAsync and IsManagedByAnyOrganizationAsync to not return nullable objects. Update ProfileOrganizationResponseModel.UserIsManagedByOrganization to not be nullable
* Update error message when unable to purge vault for managed account
* Update error message when unable to change email for managed account
* Update expected error messages on unit tests
* Add TestFeatureService to Api.IntegrationTest.Helpers and use it on ApiApplicationFactory to be able to enable specific features for each test
* Add CreateVerifiedDomainAsync method to OrganizationTestHelpers
* Add tests to AccountsControllerTest to prevent changing email for managed accounts
* Remove setting the feature flag value in ApiApplicationFactory and set it on AccountsControllerTest
* Remove TestFeatureService class from Api.IntegrationTest.Helpers
2024-10-28 16:12:13 +00:00
Bernd Schoolmann
ce185eb3df
[PM-5963] Fix tde offboarding vault corruption ( #4144 )
...
* Attempt to fix tde to mp flow
* Move tde offboarding to dedicated flag
* Add tde offboarding password request
* Validate tde offboarding input
* Correctly check whether tde is active when building trusted device options
* Refactor Tde offboarding into a separate command
* Add unit tests for tde offboarding
* Update tde offboarding request model
* Fix tests
* Fix further tests
* Fix documentation
* Add validation for updatetdepasswordasync key/newmasterpassword
* Add comment explaining test
* Remove unrelated changes
2024-07-23 14:53:08 -04:00
Jared Snider
29b47f72ca
Auth/PM-3833 - Remove Deprecated Register and Prelogin endpoints from API ( #4206 )
...
* PM-3833 - API - AccountsController.cs && AccountsController.cs - remove prelogin and register endpoints.
* PM-3833 - Move Request and Response models that were used for Prelogin and PostRegister from API to Identity.
* PM-3833 - FIX LINT
* PM-3833 - Fix issues after merge conflict fixes.
* PM-3833 - Another test fix
2024-06-19 15:11:24 -04:00
Bernd Schoolmann
3ad4bc1cab
[PM-4371] Implement PRF key rotation ( #4157 )
...
* Send rotateable keyset on list webauthn keys
* Implement basic prf key rotation
* Add validator for webauthn rotation
* Fix accounts controller tests
* Add webauthn rotation validator tests
* Introduce separate request model
* Fix tests
* Remove extra empty line
* Remove filtering in validator
* Don't send encrypted private key
* Fix tests
* Implement delegated webauthn db transactions
* Add backward compatibility
* Fix query not working
* Update migration sql
* Update dapper query
* Remove unused helper
* Rename webauthn to WebAuthnLogin
* Fix linter errors
* Fix tests
* Fix tests
2024-06-17 20:46:57 +02:00
Alex Morask
06910175e2
[AC-2576] Replace Billing commands and queries with services ( #4070 )
...
* Replace SubscriberQueries with SubscriberService
* Replace OrganizationBillingQueries with OrganizationBillingService
* Replace ProviderBillingQueries with ProviderBillingService, move to Commercial
* Replace AssignSeatsToClientOrganizationCommand with ProviderBillingService, move to commercial
* Replace ScaleSeatsCommand with ProviderBillingService and move to Commercial
* Replace CancelSubscriptionCommand with SubscriberService
* Replace CreateCustomerCommand with ProviderBillingService and move to Commercial
* Replace StartSubscriptionCommand with ProviderBillingService and moved to Commercial
* Replaced RemovePaymentMethodCommand with SubscriberService
* Formatting
* Used dotnet format this time
* Changing ProviderBillingService to scoped
* Found circular dependency'
* One more time with feeling
* Formatting
* Fix error in remove org from provider
* Missed test fix in conflit
* [AC-1937] Server: Implement endpoint to retrieve provider payment information (#4107 )
* Move the gettax and paymentmethod from stripepayment class
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
* Add the method to retrieve the tax and payment details
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
* Add unit tests for the paymentInformation method
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
* Add the endpoint to retrieve paymentinformation
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
* Add unit tests to the SubscriberService
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
* Remove the getTaxInfoAsync update reference
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
---------
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
---------
Signed-off-by: Cy Okeke <cokeke@bitwarden.com >
Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com >
2024-05-23 10:17:00 -04:00
Alex Morask
ffd988eeda
[AC-1904] Implement endpoint to retrieve Provider subscription ( #3921 )
...
* Refactor Core.Billing prior to adding new logic
* Add ProviderBillingQueries.GetSubscriptionData
* Add ProviderBillingController.GetSubscriptionAsync
2024-03-28 08:46:12 -04:00
Alex Morask
59fa6935b4
[AC-1608] Send offboarding survey response to Stripe on subscription cancellation ( #3734 )
...
* Added offboarding survey response to cancellation when FF is on.
* Removed service methods to prevent unnecessary upstream registrations
* Forgot to actually remove the injected command in the services
* Rui's feedback
* Add missing summary
* Missed [FromBody]
2024-02-09 11:58:37 -05:00
Todd Martin
2763345e9e
[PM-3777[PM-3633] Update minimum KDF iterations when creating new User record ( #3687 )
...
* Updated minimum iterations on new Users to the default.
* Fixed test I missed.
2024-01-25 10:59:53 -05:00
Matt Bishop
974d23efdd
Establish IFeatureService as scoped ( #3679 )
...
* Establish IFeatureService as scoped
* Lint
* Feedback around injection
2024-01-18 09:47:34 -05:00
Jake Fink
b77ee017e3
[PM-3797 Part 5] Add reset password keys to key rotation ( #3445 )
...
* Add reset password validator with tests
* add organization user rotation methods to repository
- move organization user TVP helper to admin console ownership
* rename account recovery to reset password
* formatting
* move registration of RotateUserKeyCommand to Core and make internal
* add admin console ValidatorServiceCollectionExtensions
2023-12-14 15:05:19 -05:00
Jake Fink
ca8e3f496e
[PM-3797 Part 4] Add Sends to new Key Rotation ( #3442 )
...
* add send validation
* add send repo methods
* add send rotation to delegate list
* add success test
2023-12-12 11:58:34 -05:00
Jake Fink
4b2bd6cee6
[PM-3797 Part 3] Add vault domains to key rotation ( #3436 )
...
## Type of change
<!-- (mark with an `X`) -->
```
- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
```
## Objective
<!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding-->
Previous PR: #3434
Adds ciphers and folders to the new key rotation.
## Code changes
<!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes-->
<!--Also refer to any related changes or PRs in other repositories-->
* **file.ext:** Description of what was changed and why
## Before you submit
- Please check for formatting errors (`dotnet format --verify-no-changes`) (required)
- If making database changes - make sure you also update Entity Framework queries and/or migrations
- Please add **unit tests** where it makes sense to do so (encouraged but not required)
- If this change requires a **documentation update** - notify the documentation team
- If this change has particular **deployment requirements** - notify the DevOps team
2023-12-06 08:46:36 -05:00
Jake Fink
989603ddd3
[Pm 3797 Part 2] Add emergency access rotations ( #3434 )
...
## Type of change
<!-- (mark with an `X`) -->
```
- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
```
## Objective
<!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding-->
See #3425 for part 1 and background.
This PR adds emergency access to the rotation. All new code is hidden behind a feature flag.
The Accounts controller has also been moved to Auth ownership.
## Code changes
<!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes-->
<!--Also refer to any related changes or PRs in other repositories-->
* **file.ext:** Description of what was changed and why
* **AccountsController.cs:** Moved to Auth ownership. Emergency access validation was added (as well as initializing empty lists to avoid errors).
* **EmergencyAccessRotationValidator.cs:** Performs validation on the provided list of new emergency access keys.
* **EmergencyAccessRepository.cs:** Adds a method to rotate encryption keys. This is added to a list in the `RotateUserKeyCommand` that the `UserRepository` calls so it doesn't have to know about all the domains.
## Before you submit
- Please check for formatting errors (`dotnet format --verify-no-changes`) (required)
- If making database changes - make sure you also update Entity Framework queries and/or migrations
- Please add **unit tests** where it makes sense to do so (encouraged but not required)
- If this change requires a **documentation update** - notify the documentation team
- If this change has particular **deployment requirements** - notify the DevOps team
2023-12-05 12:05:51 -05:00