* Renamed ProductType to ProductTierType
* Renamed Product properties to ProductTier
* Moved ProductTierType to Bit.Core.Billing.Enums namespace from Bit.Core.Enums
* Moved PlanType enum to Bit.Core.Billing.Enums
* Moved StaticStore to Bit.Core.Billing.Models.StaticStore namespace
* Added ProductType enum
* dotnet format
* Add authz handling for secret access policy reads
* Add the ability to fetch secret access polices from the repository
* refactor response models
* Add new endpoint
* inital changes
* add provider GatewayType migrations
* db provider migrations
* removed duo migrations added v2 metadata to duo response
* removed helper scripts
* remove signature from org duo
* added backward compatibility for Duo v2
* added tests for duo request + response models
* refactors to TwoFactorController
* updated test methods to be compartmentalized by usage
* fix organization add duo
* Assert.Empty() fix for validator
* Removed prorationDate as it wasn't used, and wasn't needed
* Fixed logic to detect if a subscription was sponsored
* Moved OrganizationSponsorshipsController.cs to Billing folder
* Refactored GET provider subscription
Refactoring this endpoint and its associated tests in preparation for the addition of more endpoints that share similar patterns
* Replaced StripePaymentService call in AccountsController, OrganizationsController
This was made in error during a previous PR. Since this is not related to Consolidated Billing, we want to try not to include it in these changes.
* Removing GetPaymentInformation call from ProviderBillingService
This method is a good call for the SubscriberService as we'll want to extend the functionality to all subscriber types
* Refactored GetTaxInformation to use Billing owned DTO
* Add UpdateTaxInformation to SubscriberService
* Added GetTaxInformation and UpdateTaxInformation endpoints to ProviderBillingController
* Added controller to manage creation of Stripe SetupIntents
With the deprecation of the Sources API, we need to move the bank account creation process to using SetupIntents. This controller brings both the creation of "card" and "us_bank_account" SetupIntents
under billing management.
* Added UpdatePaymentMethod method to SubscriberService
This method utilizes the SetupIntents created by the StripeController from the previous commit when a customer adds a card or us_bank_account payment method (Stripe). We need to cache the most recent SetupIntent for the subscriber so that we know which PaymentMethod is their most recent even when it hasn't been confirmed yet.
* Refactored GetPaymentMethod to use billing owned DTO and check setup intents
* Added GetPaymentMethod and UpdatePaymentMethod endpoints to ProviderBillingController
* Re-added GetPaymentInformation endpoint to consolidate API calls on the payment method page
* Added VerifyBankAccount endpoint to ProviderBillingController in order to finalize bank account payment methods
* Updated BitPayInvoiceRequestModel to support providers
* run dotnet format
* Conner's feedback
* Run dotnet format'
* Add check to verify the vault state for rotation is not obviously desynced (empty)
* Add unit test for key rotation guardrail
* Move de-synced vault detection to validators
* Add tests
* Define a model for updating many auth requests
In order to facilitate a command method that can update many auth
requests at one time a new model must be defined that accepts valid
input for the command's needs. To achieve this a new file has been
created at
`Core/AdminConsole/OrganizationAuth/Models/OrganizationAuthRequestUpdateCommandModel.cs`
that contains a class of the same name. It's properties match those that
need to come from any calling API request models to fulfill the request.
* Declare a new command interface method
Calling API functions of the `UpdateOrganizationAuthRequestCommand` need
a function that can accept many auth request response objects and
process them as approved or denied. To achieve this a new function has
been added to `IUpdateOrganizationAuthRequestCommand` called
`UpdateManyAsync()` that accepts an
`IEnumberable<OrganizationAuthRequest>` and returns a `Task`.
Implementations of this interface method will be used to bulk process
auth requests as approved or denied.
* Stub out method implementation for unit testing
To facilitate a bulk device login request approval workflow in the admin
console `UpdateOrganizationAuthRequestCommand` needs to be updated to
include an `UpdateMany()` method. It should accept a list of
`OrganizationAuthRequestUpdateCommandModel` objects, perform some simple
data validation checks, and then pass those along to
`AuthRequestRepository` for updating in the database.
This commit stubs out this method for the purpose of writing unit tests.
At this stage the method throws a `NotImplementedException()`. It will
be expand after writing assertions.
* Inject `IAuthRequestRepository` into `UpdateOrganizationAuthCommand`
The updates to `UpdateOrganizationAuthRequestCommand` require a new
direct dependency on `IAuthRequestRepository`. This commit simply
registers this dependency in the `UpdateOrganizationAuthRequest`
constructor for use in unit tests and the `UpdateManyAsync()`
implementation.
* Write tests
* Rename `UpdateManyAsync()` to `UpdateAsync`
* Drop the `CommandModel` suffix
* Invert business logic update filters
* Rework everything to be more model-centric
* Bulk send push notifications
* Write tests that validate the command as a whole
* Fix a test that I broke by mistake
* Swap to using await instead of chained methods for processing
* Seperate a function arguement into a variable declaration
* Ungeneric-ify the processor
* Adjust ternary formatting
* Adjust naming of methods regarding logging organization events
* Throw an exception if Process is called with no auth request loaded
* Rename `_updates` -> `_update`
* Rename email methods
* Stop returning `this`
* Allow callbacks to be null
* Make some assertions about the state of a processed auth request
* Be more terse about arguements in happy path test
* Remove unneeded null check
* Expose an endpoint for bulk processing of organization auth requests (#4077)
---------
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
* Add new stored procedure for reading reset password details for multiple organization user IDs
* Add method IOrganizationUserRepository.GetManyResetPasswordDetailsByOrganizationUserAsync
* Add new API endpoint for getting reset password details for multiple organization users
* Add unit tests for bulk OrganizationUsersController.GetResetPasswordDetails
* Add alias to sql query result column
* Add constructor for automatic mapping
* Fix http method type for endpoint
* dotnet format
* Simplify the constructor in the OrganizationUserResetPasswordDetails
* Refactor stored procedure and repository method names for retrieving account recovery details
* Add integration tests for GetManyAccountRecoveryDetailsByOrganizationUserAsync
* Lock endpoint behind BulkDeviceApproval feature flag
* Update feature flag key value
* 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>
* For SM Trial orgs, now scaling PM seat count with SM seat count adjustments
* Split Billing related organization endpoints into billing owned controller
* Updated billing organizations controller to use a primary constructor to reduce boilerplate
* Fixed error where ID couldn't be mapped to subscription endpoint guid param
* Updated billing OrganizationController endpoints to not manually create the GUID from the string ID
* Banished magic string back to the pit from whence it came
* Resolved errors in unit tests
* [AC-2274] Introduce CanEditAnyCiphersAsAdminAsync helper to replace EditAnyCollection usage
* [AC-2274] Add unit tests for CanEditAnyCiphersAsAdmin helper
* [AC-2274] Add Jira ticket
* [AC-1707] Add feature flag
* [AC-1707] Update CanEditAnyCiphersAsAdmin to fail for providers when the feature flag is enabled
* [AC-2274] Undo change to purge endpoint
* [AC-2274] Update admin checks to account for unassigned ciphers
* [AC-1707] Fix provider auth checks after merge with main
* [AC-1707] Fix tests after merge
* [AC-1707] Adjust CanEditCipherAsAdmin method to properly account for admin user types
- Fix associated unit tests
* [AC-1707] Formatting
* Add new models
* Update repositories
* Add new authz handler
* Add new query
* Add new command
* Add authz, command, and query to DI
* Add new endpoint to controller
* Add query unit tests
* Add api unit tests
* Add api integration tests
* Add the ability to get multi projects access
* Add access policy helper + tests
* Add new data/request models
* Add access policy operations to repo
* Add authz handler for new operations
* Add new controller endpoints
* add updating service account revision
* Fix issue where ManageUsers custom permission could not
grant access to collections
* Split ModifyAccess operation to ModifyUserAccess and
ModifyGroupAccess to reflect more granular operations
* update OrganizationUsersController PUT and POST
* enforces new collection access checks when updating members
* refactor BulkCollectionAuthorizationHandler to avoid repeated db calls
* [PM-3176] Extract IOrganizationService.SaveUserAsync to a command
* [PM-3176] Enabled nullable on command
* [PM-3176] Removed check that was not working
* Add new endpoint for creating client organizations in consolidated billing
* Create empty org and then assign seats for code re-use
* Fixes made from debugging client side
* few more small fixes
* Vincent's feedback
* Restrict admins from adding themselves to groups
Updated OrganizationUsersController only, GroupsController to be updated
separately
* Delete unused api method