mirror of
https://github.com/bitwarden/server.git
synced 2025-02-24 03:11:22 +01:00
create jobs controller running system tasks
This commit is contained in:
parent
5c8c85680a
commit
94693ec408
38
src/Api/Controllers/JobsController.cs
Normal file
38
src/Api/Controllers/JobsController.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Api.Utilities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Bit.Core.Services;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
[Route("jobs")]
|
||||
[SelfHosted(SelfHostedOnly = true)]
|
||||
[AllowAnonymous]
|
||||
public class JobsController : Controller
|
||||
{
|
||||
private readonly ILicensingService _licensingService;
|
||||
private readonly IUserService _userService;
|
||||
|
||||
public JobsController(
|
||||
ILicensingService licensingService,
|
||||
IUserService userService)
|
||||
{
|
||||
_licensingService = licensingService;
|
||||
_userService = userService;
|
||||
}
|
||||
|
||||
[HttpPost("organization-license")]
|
||||
public async Task PostOrganizationLicense()
|
||||
{
|
||||
await _licensingService.ValidateOrganizationsAsync();
|
||||
}
|
||||
|
||||
[HttpPost("refresh-licenses")]
|
||||
public Task PostRefreshLicenses()
|
||||
{
|
||||
// TODO
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
}
|
||||
}
|
@ -37,8 +37,6 @@ namespace Bit.Core.IdentityServer
|
||||
|
||||
public async Task GetProfileDataAsync(ProfileDataRequestContext context)
|
||||
{
|
||||
await _licensingService.ValidateOrganizationsAsync();
|
||||
|
||||
var existingClaims = context.Subject.Claims;
|
||||
var newClaims = new List<Claim>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user