mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix file extractor tests
This commit is contained in:
parent
4f39eaca17
commit
59724f2247
38
Wabbajack.Server/Controllers/SiteIntegration.cs
Normal file
38
Wabbajack.Server/Controllers/SiteIntegration.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Wabbajack.Common;
|
||||
using Wabbajack.Lib.Downloaders;
|
||||
|
||||
namespace Wabbajack.BuildServer.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Authorize(Roles = "User")]
|
||||
[Route("/site-integration")]
|
||||
public class SiteIntegration : ControllerBase
|
||||
{
|
||||
private ILogger<SiteIntegration> _logger;
|
||||
|
||||
public SiteIntegration(ILogger<SiteIntegration> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
private HashSet<string> Allowed = new HashSet<string>
|
||||
{ "loverslabcookies", "deadlystream", "tesall", "tesalliance", "vectorplexus"};
|
||||
[Route("auth-info/{site}")]
|
||||
public async Task<IActionResult> GetAuthInfo(string site)
|
||||
{
|
||||
if (!Allowed.Contains(site))
|
||||
{
|
||||
return BadRequest("No key found");
|
||||
}
|
||||
|
||||
return Ok(Encoding.UTF8.GetString(await Utils.FromEncryptedData(site)));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user