aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Relay/API/Controllers/RelayController.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-01-01 23:04:16 -0600
committerJP Dillingham <jp@dillingham.me>2023-01-01 23:04:16 -0600
commit775d21ecb2a48b09048773d5aa277e101e30de08 (patch)
treefdfbf4280136a2eac29b52c4db27e3175eef59d0 /src/slskd/Relay/API/Controllers/RelayController.cs
parente2f883a7cbf0317815d76ded74fe4dfbbce8a344 (diff)
downloadslskd-775d21ecb2a48b09048773d5aa277e101e30de08.tar.gz
use ApiKeyPolicy for relay endpoints
Diffstat (limited to 'src/slskd/Relay/API/Controllers/RelayController.cs')
-rw-r--r--src/slskd/Relay/API/Controllers/RelayController.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/slskd/Relay/API/Controllers/RelayController.cs b/src/slskd/Relay/API/Controllers/RelayController.cs
index 7e7f3e22..7183283f 100644
--- a/src/slskd/Relay/API/Controllers/RelayController.cs
+++ b/src/slskd/Relay/API/Controllers/RelayController.cs
@@ -57,7 +57,7 @@ namespace slskd.Relay
private IOptionsMonitor<Options> OptionsMonitor { get; }
[HttpPut("")]
- [Authorize(Policy = AuthPolicy.Any)]
+ [Authorize(Policy = AuthPolicy.JwtOnly)]
public async Task<IActionResult> Connect()
{
if (!OptionsAtStartup.Relay.Enabled || !new[] { RelayMode.Agent, RelayMode.Debug }.Contains(OperationMode))
@@ -70,7 +70,7 @@ namespace slskd.Relay
}
[HttpDelete("")]
- [Authorize(Policy = AuthPolicy.Any)]
+ [Authorize(Policy = AuthPolicy.JwtOnly)]
public async Task<IActionResult> Disconnect()
{
if (!OptionsAtStartup.Relay.Enabled || !new[] { RelayMode.Agent, RelayMode.Debug }.Contains(OperationMode))
@@ -83,7 +83,7 @@ namespace slskd.Relay
}
[HttpGet("downloads/{token}")]
- [Authorize(Policy = AuthPolicy.Any)]
+ [Authorize(Policy = AuthPolicy.ApiKeyOnly)]
public IActionResult DownloadFile([FromRoute]string token)
{
if (!OptionsAtStartup.Relay.Enabled || !new[] { RelayMode.Controller, RelayMode.Debug }.Contains(OperationMode))
@@ -132,7 +132,7 @@ namespace slskd.Relay
[RequestSizeLimit(10L * 1024L * 1024L * 1024L)]
[RequestFormLimits(MultipartBodyLengthLimit = 10L * 1024L * 1024L * 1024L)]
[DisableFormValueModelBinding]
- [Authorize(Policy = AuthPolicy.Any)]
+ [Authorize(Policy = AuthPolicy.ApiKeyOnly)]
public async Task<IActionResult> UploadFile(string token)
{
if (!OptionsAtStartup.Relay.Enabled || !new[] { RelayMode.Controller, RelayMode.Debug }.Contains(OperationMode))
@@ -217,7 +217,7 @@ namespace slskd.Relay
/// <param name="token">The unique identifier for the request.</param>
/// <returns></returns>
[HttpPost("shares/{token}")]
- [Authorize(Policy = AuthPolicy.Any)]
+ [Authorize(Policy = AuthPolicy.ApiKeyOnly)]
public async Task<IActionResult> UploadShares(string token)
{
if (!OptionsAtStartup.Relay.Enabled || !new[] { RelayMode.Controller, RelayMode.Debug }.Contains(OperationMode))