* 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
* Added feature flag constant
* Wrapped Automatic Tax logic behind feature flag
* Only getting customer if feature is anabled.
* Enabled feature flag in unit tests
* Made IPaymentService scoped
* Added missing StripeFacade calls
* Removed TaxRate logic when creating or updating a Stripe subscription and replaced it with AutomaticTax enabled flag
* Updated Stripe webhook to update subscription to automatically calculate tax
* Removed TaxRate unit tests since Stripe now handles tax
* Removed test proration logic
* Including taxInfo when updating payment method
* Adding the address to the upgrade free org flow if it doesn't exist
* Fixed failing tests and added a new test to validate that the customer is updated
* Initial commit
* Fix the failing text
* Fix the unpaid invoice issue
* fix the unpaid invoice issue
* Changes for the threshold amount
* remove the billing threshold
* Add some comments to the old method
* Fixing issues on secret manager test
* import missing package
* Resolve pr comments
* Refactor PreviewUpcomingInvoiceAndPayAsync method
* Resolve some pr comments
* Resolving the comment around constant
* Resolve pr comment
* Add new class
* Resolve pr comments
* Change the prorateThreshold from 5 to 500 dollars
* Fix the failing test
* Fix the server returns a 500 error with the banner
* refactor the plan and create new objects
* initial commit
* Add new plan types
* continue the refactoring by adding new plantypes
* changes for plans
* Refactoring continues
* making changes for plan
* Fixing the failing test
* Fixing whitespace
* Fix some in correct values
* Resolve the plan data
* rearranging the plan
* Make the plan more immutable
* Resolve the lint errors
* Fix the failing test
* Add custom plan
* Fix the failing test
* Fix the failing test
* resolve the failing addons after refactoring
* Refactoring
* Merge branch 'master' into ac-1451/refactor-staticstore-plans-and-consuming-logic
* merge from master
* Merge branch 'master' into ac-1451/refactor-staticstore-plans-and-consuming-logic
* format whitespace
* resolve the conflict
* Fix some pr comments
* Fixing some of the pr comments
* fixing some of the pr comments
* Resolve some pr comments
* Resolve pr comments
* Resolves some pr comments
* Resolving some or comments
* Resolve a failing test
* fix the failing test
* Resolving some pr comments
* Fix the failing test
* resolve pr comment
* add a using statement fir a failing test
---------
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
* [AC-1423] Add AddonProduct and BitwardenProduct properties to BillingSubscriptionItem (#3037)
* [AC-1423] Add AddonProduct and BitwardenProduct properties to BillingSubscriptionItem
* [AC-1423] Add helper to StaticStore.cs to find a Plan by StripePlanId
* [AC-1423] Use the helper method to set SubscriptionInfo.BitwardenProduct
* Add SecretsManagerBilling feature flag to Constants
* [AC 1409] Secrets Manager Subscription Stripe Integration (#3019)
* [AC-1418] Add missing SecretsManagerPlan property to OrganizationResponseModel (#3055)
* [AC 1460] Update Stripe Configuration (#3070)
* [AC 1410] Secrets Manager subscription adjustment back-end changes (#3036)
* Create UpgradeSecretsManagerSubscription command
* [AC-1495] Extract UpgradePlanAsync into a command (#3081)
* This is a pure lift & shift with no refactors
* [AC-1503] Fix Stripe integration on organization upgrade (#3084)
* Fix SM parameters not being passed to Stripe
* [AC-1504] Allow SM max autoscale limits to be disabled (#3085)
* [AC-1488] Changed SM Signup and Upgrade paths to set SmServiceAccounts to include the plan BaseServiceAccount (#3086)
* [AC-1510] Enable access to Secrets Manager to Organization owner for new Subscription (#3089)
* Revert changes to ReferenceEvent code (#3091)
This will be done in AC-1481
* Add UsePasswordManager to sync data (#3114)
* [AC-1522] Fix service account check on upgrading (#3111)
* [AC-1521] Address checkmarx security feedback (#3124)
* Reinstate target attribute but add noopener noreferrer
* Update date on migration script
---------
Co-authored-by: Shane Melton <smelton@bitwarden.com>
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
Co-authored-by: cyprain-okeke <cokeke@bitwarden.com>
Co-authored-by: Rui Tomé <108268980+r-tome@users.noreply.github.com>
Co-authored-by: Conner Turnbull <cturnbull@bitwarden.com>
Co-authored-by: Rui Tome <rtome@bitwarden.com>
* Added region to customer metadata
* Updated webhook to filter out events for other DCs
* Flipped ternary to be positive, fixed indentation
* Updated to allow for unit testing andupdated tests
---------
Co-authored-by: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com>
* Adding the Secret manager to the Plan List
* Adding the unit test for the StaticStoreTests class
* Fix whitespace formatting
* Fix whitespace formatting
* Price update
* Resolving the PR comments
* Resolving PR comments
* Fixing the whitespace
* only password manager plans are return for now
* format whitespace
* Resolve the test issue
* Fixing the failing test
* Refactoring the Plan separation
* add a unit test for SingleOrDefault
* Fix the whitespace format
* Separate the PM and SM plans
* Fixing the whitespace
* Remove unnecessary directive
* Fix imports ordering
* Fix imports ordering
* Resolve imports ordering
* Fixing imports ordering
* Fix response model, add MaxProjects
* Fix filename
* Fix format
* Fix: seat price should match annual/monthly
* Fix service account annual pricing
* Name the sm service account planId properly
* Update the secrets manager plan
* correcting the wrong amount for the seats
---------
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
* Adding discount coupon on provider org creation
* Change the provider discount Id
* Fixing the whitespace format
* Remove discount at subscription and apply to customer
* resolving a failing test
* Remove white spaces
* Adding organization name on subscription and update
* Changes after running dotnet format -v diag
* Change the OrganizationName to GetName
* Change GetName to OwnerName
* Change the OwnerName to SubscriberName
* Reverting the changes made by dotnet format-v diag
* Removing extract space
* resolve the lint issue
* Fix whitespace formatting issue
* Resolving pr comment on changing organization
* Fixing the failing test
* Using the ISubscriber interface for consistent
* fixing the whitescapes
* Resolving the PR comments
* resolving the whitespace format
* Remove unnecessary directive
* Resolving the whitespace issue
* changes for organization instead of subscriber
* resolving the failing test
* Resolve lint issue by removing unnecessary directive
* Resolve the PR comment
* remove these blank lines
* Fixing whitespace formatting
* Update ProviderService tests
* Use BitAutoData in CipherService tests
* Simplify UserCipher fixture
Because we use a single customizer for all ciphers, they all have the same userId.
* Clean up more cipher fixtures
* Swap Cipher Fixtures to BitCustomizeAttribute
* Clean up collection fixtures
* Clean up GroupFixtures
* Move SendService Tests to BitAutoData
* Clean up Organization Fixtures
TODO: The customize attributes should not be customizing more than one class
* Name files after the class they contain
* Clear up usage of CustomAutoDataAttribute in tests
* Clean up usages of InlineCustomAutoData
* format
* Manually merge with file-scoped-namespace changes
* 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
Following the paradigms illustrated in "Working Effectively with Legacy
Code", this commit introduces at least one test for each service class
implementation. This test is a simple construction test -- we just
create each service and assert that it exists. Each test suite includes
a comment instructing the developer who comes next to remove the
constructor test. We don't want to keep these tests as the codebase
matures, as they aren't useful in the longterm. They only prove that we
have that class under test.
Where test suites failed to construct their associated classes, we skip
the test but leave behind the implementation. This is by design, so that
as the constructors for those classes change, we are forced to keep the
test suite current by leaning on the compiler.