billing/pm-24665/license-file-generation-should-fail-for-unpaid-subscription#7444
Conversation
|
New Issues (4)Checkmarx found the following issues in this Pull Request
|
…uld-fail-for-unpaid-subscription
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7444 +/- ##
==========================================
+ Coverage 58.71% 58.74% +0.02%
==========================================
Files 2069 2070 +1
Lines 91207 91227 +20
Branches 8123 8127 +4
==========================================
+ Hits 53551 53587 +36
+ Misses 35742 35737 -5
+ Partials 1914 1903 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
amorask-bitwarden
left a comment
There was a problem hiding this comment.
What about premium?
…uld-fail-for-unpaid-subscription
|
|
||
| public static class SubscriptionLicenseValidator | ||
| { | ||
| public static void ValidateSubscriptionForLicenseGeneration(SubscriptionInfo subscriptionInfo) |
There was a problem hiding this comment.
❌ I don't think there's any reason for this to take a SubscriptionInfo when we can just pass in Subscription.
| { | ||
| public async Task<UserLicense> Run(User user) | ||
| { | ||
| var subscriptionInfo = await paymentService.GetSubscriptionAsync(user); |
There was a problem hiding this comment.
❌ This work should be done in the query itself and it should just use the StripeAdapter to get the subscription per the comment here: https://github.com/bitwarden/server/pull/7444/changes#r3081694476
| } | ||
|
|
||
| var subscriptionInfo = await GetSubscriptionAsync(organization); | ||
| SubscriptionLicenseValidator.ValidateSubscriptionForLicenseGeneration(subscriptionInfo); |
There was a problem hiding this comment.
See comment here: https://github.com/bitwarden/server/pull/7444/changes#r3081694476
…uld-fail-for-unpaid-subscription
|






🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-24665
📔 Objective
The PR adds validation to the license generation endpoint that blocks license file downloads when an organization's subscription is in any of these statuses:
Technical Implementation
Location: src/Core/Billing/Organizations/Queries/GetCloudOrganizationLicenseQuery.cs
Changes:
Test Coverage:
📸 Screenshots