diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-10-05 18:30:31 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-10-05 18:30:31 -0500 |
| commit | cd6874b3dd54c6b3e501439d308d591e4b2aada5 (patch) | |
| tree | c2641f61004527822b98aec8b1cd33436f71a78d /src/slskd/Search/API/Controllers/SearchesController.cs | |
| parent | fae0729152ff1db8c4fd25c0c7a667bb3b76962e (diff) | |
| download | slskd-cd6874b3dd54c6b3e501439d308d591e4b2aada5.tar.gz | |
add auth policies
Diffstat (limited to 'src/slskd/Search/API/Controllers/SearchesController.cs')
| -rw-r--r-- | src/slskd/Search/API/Controllers/SearchesController.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/slskd/Search/API/Controllers/SearchesController.cs b/src/slskd/Search/API/Controllers/SearchesController.cs index acae18e0..aadf01b2 100644 --- a/src/slskd/Search/API/Controllers/SearchesController.cs +++ b/src/slskd/Search/API/Controllers/SearchesController.cs @@ -54,7 +54,7 @@ namespace slskd.Search.API /// <response code="400">The specified <paramref name="request"/> was malformed.</response> /// <response code="500">The search terminated abnormally.</response> [HttpPost("")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] public async Task<IActionResult> Post([FromBody] SearchRequest request) { if (string.IsNullOrWhiteSpace(request.SearchText)) @@ -91,7 +91,7 @@ namespace slskd.Search.API /// <response code="200">The request completed successfully.</response> /// <response code="404">A matching search was not found.</response> [HttpGet("{id}")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] public async Task<IActionResult> GetById([FromRoute] Guid id, [FromQuery] bool includeResponses = false) { var search = await Searches.FindAsync(search => search.Id == id, includeResponses); @@ -112,7 +112,7 @@ namespace slskd.Search.API /// <response code="200">The request completed successfully.</response> /// <response code="404">A matching search was not found.</response> [HttpGet("{id}/responses")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] public async Task<IActionResult> GetResponsesById([FromRoute] Guid id) { var search = await Searches.FindAsync(search => search.Id == id, includeResponses: true); @@ -130,7 +130,7 @@ namespace slskd.Search.API /// </summary> /// <returns></returns> [HttpGet("")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] public async Task<IActionResult> GetAll() { var searches = await Searches.ListAsync(); @@ -145,7 +145,7 @@ namespace slskd.Search.API /// <response code="304">The search was not in progress.</response> /// <returns></returns> [HttpPut("{id}")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(200)] [ProducesResponseType(304)] public async Task<IActionResult> Cancel([FromRoute] Guid id) @@ -173,7 +173,7 @@ namespace slskd.Search.API /// <response code="404">A search with the specified id could not be found.</response> /// <returns></returns> [HttpDelete("{id}")] - [Authorize] + [Authorize(Policy = AuthPolicy.Any)] [ProducesResponseType(204)] [ProducesResponseType(404)] public async Task<IActionResult> Delete([FromRoute] Guid id) |
