mirror of
https://github.com/bitwarden/server.git
synced 2025-04-23 14:05:10 -05:00

* Added the ability to create a JWT on an organization license that contains all license properties as claims * Added the ability to create a JWT on a user license that contains all license properties as claims * Added ability to consume JWT licenses * Resolved generic type issues when getting claim value * Now validating the jwt signature, exp, and iat * Moved creation of ClaimsPrincipal outside of licenses given dependecy on cert * Ran dotnet format. Resolved identity error * Updated claim types to use string constants * Updated jwt expires to be one year * Fixed bug requiring email verification to be on the token * dotnet format * Patch build process --------- Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
26 lines
883 B
C#
26 lines
883 B
C#
using System.Security.Claims;
|
|
using Bit.Core.AdminConsole.Entities;
|
|
using Bit.Core.Entities;
|
|
using Bit.Core.Models.Business;
|
|
|
|
namespace Bit.Core.Services;
|
|
|
|
public interface ILicensingService
|
|
{
|
|
Task ValidateOrganizationsAsync();
|
|
Task ValidateUsersAsync();
|
|
Task<bool> ValidateUserPremiumAsync(User user);
|
|
bool VerifyLicense(ILicense license);
|
|
byte[] SignLicense(ILicense license);
|
|
Task<OrganizationLicense> ReadOrganizationLicenseAsync(Organization organization);
|
|
Task<OrganizationLicense> ReadOrganizationLicenseAsync(Guid organizationId);
|
|
ClaimsPrincipal GetClaimsPrincipalFromLicense(ILicense license);
|
|
|
|
Task<string> CreateOrganizationTokenAsync(
|
|
Organization organization,
|
|
Guid installationId,
|
|
SubscriptionInfo subscriptionInfo);
|
|
|
|
Task<string> CreateUserTokenAsync(User user, SubscriptionInfo subscriptionInfo);
|
|
}
|