mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 17:42:49 -05:00
Turn on file scoped namespaces (#2225)
This commit is contained in:
@ -4,53 +4,52 @@ using Bit.Core.Settings;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
namespace Bit.Core.Services;
|
||||
|
||||
public class NoopLicensingService : ILicensingService
|
||||
{
|
||||
public class NoopLicensingService : ILicensingService
|
||||
public NoopLicensingService(
|
||||
IWebHostEnvironment environment,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
public NoopLicensingService(
|
||||
IWebHostEnvironment environment,
|
||||
GlobalSettings globalSettings)
|
||||
if (!environment.IsDevelopment() && globalSettings.SelfHosted)
|
||||
{
|
||||
if (!environment.IsDevelopment() && globalSettings.SelfHosted)
|
||||
{
|
||||
throw new Exception($"{nameof(NoopLicensingService)} cannot be used for self hosted instances.");
|
||||
}
|
||||
}
|
||||
|
||||
public Task ValidateOrganizationsAsync()
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task ValidateUsersAsync()
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task<bool> ValidateUserPremiumAsync(User user)
|
||||
{
|
||||
return Task.FromResult(user.Premium);
|
||||
}
|
||||
|
||||
public bool VerifyLicense(ILicense license)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public byte[] SignLicense(ILicense license)
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
public Task<OrganizationLicense> ReadOrganizationLicenseAsync(Organization organization)
|
||||
{
|
||||
return Task.FromResult<OrganizationLicense>(null);
|
||||
}
|
||||
|
||||
public Task<OrganizationLicense> ReadOrganizationLicenseAsync(Guid organizationId)
|
||||
{
|
||||
return Task.FromResult<OrganizationLicense>(null);
|
||||
throw new Exception($"{nameof(NoopLicensingService)} cannot be used for self hosted instances.");
|
||||
}
|
||||
}
|
||||
|
||||
public Task ValidateOrganizationsAsync()
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task ValidateUsersAsync()
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task<bool> ValidateUserPremiumAsync(User user)
|
||||
{
|
||||
return Task.FromResult(user.Premium);
|
||||
}
|
||||
|
||||
public bool VerifyLicense(ILicense license)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public byte[] SignLicense(ILicense license)
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
public Task<OrganizationLicense> ReadOrganizationLicenseAsync(Organization organization)
|
||||
{
|
||||
return Task.FromResult<OrganizationLicense>(null);
|
||||
}
|
||||
|
||||
public Task<OrganizationLicense> ReadOrganizationLicenseAsync(Guid organizationId)
|
||||
{
|
||||
return Task.FromResult<OrganizationLicense>(null);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user