Skip to content

Commit 00a7306

Browse files
committed
Use isEvaluation for license
1 parent 5b5c8bd commit 00a7306

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/ServiceControl.UnitTests/API/APIApprovals.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using ServiceBus.Management.Infrastructure.Settings;
2020
using ServiceControl.Infrastructure.Api;
2121
using ServiceControl.Infrastructure.WebApi;
22+
using ServiceControl.Monitoring.HeartbeatMonitoring;
2223

2324
[TestFixture]
2425
class APIApprovals
@@ -33,7 +34,8 @@ public async Task RootPathValue()
3334
var controller = new RootController(new ConfigurationApi(
3435
new ActiveLicense(null) { IsValid = true },
3536
new Settings(),
36-
null
37+
null,
38+
new MassTransitConnectorHeartbeatStatus()
3739
)
3840
)
3941
{

src/ServiceControl/Licensing/ActiveLicense.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
namespace Particular.ServiceControl.Licensing
22
{
3-
using System.Threading.Tasks;
4-
using System.Threading;
53
using System;
4+
using System.Threading;
5+
using System.Threading.Tasks;
66
using global::ServiceControl.LicenseManagement;
77
using global::ServiceControl.Persistence;
88
using NServiceBus.Logging;
99

1010
public class ActiveLicense(ITrialLicenseDataProvider trialLicenseDataProvider)
1111
{
1212
public bool IsValid { get; set; }
13+
public bool IsEvaluation { get; set; }
1314

1415
public LicenseDetails Details { get; set; }
1516

@@ -22,6 +23,8 @@ public async Task Refresh(CancellationToken cancellationToken)
2223
Details = await ValidateTrialLicense(detectedLicense.Details, trialLicenseDataProvider, cancellationToken);
2324

2425
IsValid = !Details.HasLicenseExpired();
26+
27+
IsEvaluation = detectedLicense.IsEvaluationLicense;
2528
}
2629

2730
internal static async Task<LicenseDetails> ValidateTrialLicense(LicenseDetails licenseDetails, ITrialLicenseDataProvider trialLicenseDataProvider, CancellationToken cancellationToken)

src/ServiceControl/Licensing/LicenseController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task<ActionResult<LicenseInfo>> License(bool refresh, string client
3333
LicenseStatus = activeLicense.Details.Status,
3434
LicenseExtensionUrl = connectorHeartbeatStatus.LastHeartbeat == null
3535
? $"https://particular.net/extend-your-trial?p={clientName}"
36-
: $"https://particular.net/license/mt?p={clientName}&t={(activeLicense.Details.IsTrialLicense ? 0 : 1)}"
36+
: $"https://particular.net/license/mt?p={clientName}&t={(activeLicense.IsEvaluation ? 0 : 1)}"
3737
};
3838

3939
return licenseInfo;

0 commit comments

Comments
 (0)