aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Messaging/API/Controllers/ConversationsController.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-10-06 08:41:00 -0500
committerGitHub <noreply@github.com>2022-10-06 08:41:00 -0500
commitfb6350e107bd5f850a13c8c2065e341241967ab2 (patch)
tree73e1aaa9e197df71f28accec82121581774a1aad /src/slskd/Messaging/API/Controllers/ConversationsController.cs
parentb879d7109ccde713b17258dc6d1e89624fdb6603 (diff)
parent55db59a4ef022befd503cee7247e5f4f5e403ef8 (diff)
downloadslskd-fb6350e107bd5f850a13c8c2065e341241967ab2.tar.gz
Merge pull request #681 from slskd/fix-auth
Add authorization policies
Diffstat (limited to 'src/slskd/Messaging/API/Controllers/ConversationsController.cs')
-rw-r--r--src/slskd/Messaging/API/Controllers/ConversationsController.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/slskd/Messaging/API/Controllers/ConversationsController.cs b/src/slskd/Messaging/API/Controllers/ConversationsController.cs
index 492340f0..17c55a10 100644
--- a/src/slskd/Messaging/API/Controllers/ConversationsController.cs
+++ b/src/slskd/Messaging/API/Controllers/ConversationsController.cs
@@ -66,7 +66,7 @@ namespace slskd.Messaging.API
/// A conversation with the specified username, or a message matching the specified id could not be found.
/// </response>
[HttpPut("{username}/{id}")]
- [Authorize]
+ [Authorize(Policy = AuthPolicy.Any)]
[ProducesResponseType(200)]
[ProducesResponseType(404)]
public async Task<IActionResult> Acknowledge([FromRoute]string username, [FromRoute]int id)
@@ -90,7 +90,7 @@ namespace slskd.Messaging.API
/// <response code="200">The request completed successfully.</response>
/// <response code="404">A conversation with the specified username could not be found.</response>
[HttpPut("{username}")]
- [Authorize]
+ [Authorize(Policy = AuthPolicy.Any)]
[ProducesResponseType(200)]
[ProducesResponseType(404)]
public async Task<IActionResult> AcknowledgeAll([FromRoute]string username)
@@ -124,7 +124,7 @@ namespace slskd.Messaging.API
/// <response code="204">The request completed successfully.</response>
/// <response code="404">A conversation with the specified username could not be found.</response>
[HttpDelete("{username}")]
- [Authorize]
+ [Authorize(Policy = AuthPolicy.Any)]
[ProducesResponseType(404)]
[ProducesResponseType(204)]
public IActionResult Delete([FromRoute]string username)
@@ -145,7 +145,7 @@ namespace slskd.Messaging.API
/// <returns></returns>
/// <response code="200">The request completed successfully.</response>
[HttpGet("")]
- [Authorize]
+ [Authorize(Policy = AuthPolicy.Any)]
[ProducesResponseType(typeof(Dictionary<string, List<PrivateMessageResponse>>), 200)]
public IActionResult GetAll()
{
@@ -166,7 +166,7 @@ namespace slskd.Messaging.API
/// <response code="200">The request completed successfully.</response>
/// <response code="404">A matching search was not found.</response>
[HttpGet("{username}")]
- [Authorize]
+ [Authorize(Policy = AuthPolicy.Any)]
[ProducesResponseType(typeof(List<PrivateMessageResponse>), 200)]
[ProducesResponseType(404)]
public IActionResult GetByUsername([FromRoute]string username)
@@ -192,7 +192,7 @@ namespace slskd.Messaging.API
/// <response code="201">The request completed successfully.</response>
/// <response code="400">The specified message is null or empty.</response>
[HttpPost("{username}")]
- [Authorize]
+ [Authorize(Policy = AuthPolicy.Any)]
[ProducesResponseType(201)]
[ProducesResponseType(400)]
public async Task<IActionResult> Send([FromRoute]string username, [FromBody]string message)