From cd6874b3dd54c6b3e501439d308d591e4b2aada5 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 5 Oct 2022 18:30:31 -0500 Subject: add auth policies --- src/slskd/Shares/API/Controllers/SharesController.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/slskd/Shares/API/Controllers') diff --git a/src/slskd/Shares/API/Controllers/SharesController.cs b/src/slskd/Shares/API/Controllers/SharesController.cs index 5f87f900..d07e8eed 100644 --- a/src/slskd/Shares/API/Controllers/SharesController.cs +++ b/src/slskd/Shares/API/Controllers/SharesController.cs @@ -32,7 +32,6 @@ namespace slskd.Shares.API [Produces("application/json")] [Consumes("application/json")] [Route("api/v{version:apiVersion}/[controller]")] - [Authorize] public class SharesController : ControllerBase { /// @@ -53,7 +52,7 @@ namespace slskd.Shares.API /// The request completed successfully. /// [HttpGet("")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(typeof(IEnumerable), 200)] public async Task List() { @@ -87,7 +86,7 @@ namespace slskd.Shares.API /// The requested share could not be found. /// [HttpGet("{id}")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(typeof(SummarizedShare), 200)] [ProducesResponseType(404)] public async Task Get(string id) @@ -122,7 +121,7 @@ namespace slskd.Shares.API /// /// The request completed successfully. [HttpGet("contents")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(typeof(IEnumerable), 200)] public async Task BrowseAll() { @@ -137,6 +136,7 @@ namespace slskd.Shares.API /// The request completed successfully. /// The requested share could not be found. [HttpGet("{id}/contents")] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(typeof(IEnumerable), 200)] [ProducesResponseType(404)] public async Task BrowseShare(string id) @@ -161,7 +161,7 @@ namespace slskd.Shares.API /// A share scan is already in progress. [HttpPut] [Route("")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(204)] [ProducesResponseType(409)] public IActionResult RescanSharesAsync() @@ -186,7 +186,7 @@ namespace slskd.Shares.API /// A share scan was not in progress. [HttpDelete] [Route("")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(204)] [ProducesResponseType(404)] public IActionResult CancelShareScan() -- cgit v1.2.3