mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
fix docs
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Govor.Application.Interfaces.Infrastructure.Extensions;
|
||||
using Govor.Contracts.Requests;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@@ -9,9 +11,33 @@ namespace Govor.API.Controllers.Authentication;
|
||||
[Authorize(Roles = "Admin, User")]
|
||||
public class SessionKeysController : Controller
|
||||
{
|
||||
// GET
|
||||
public IActionResult Index()
|
||||
private readonly ILogger<SessionKeysController> _logger;
|
||||
private readonly ICurrentUserSessionService _currentSession;
|
||||
private readonly ICurrentUserService _currentUser;
|
||||
/*
|
||||
[HttpPost("keys")]
|
||||
public async Task<IActionResult> UploadSessionKeys([FromBody] UploadKeysRequest request)
|
||||
{
|
||||
return View();
|
||||
var sessionId = _currentSession.GetUserSessionId();
|
||||
|
||||
await _sessionKeyService.AttachKeysAsync(sessionId, request.PublicEncryptionKey, request.PublicSigningKey);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpGet("users/{userId}/keys")]
|
||||
public async Task<IActionResult> GetUserPublicKeys(Guid userId)
|
||||
{
|
||||
var requesterId = _currentUserService.UserId;
|
||||
|
||||
if (!await _friendshipService.AreFriendsAsync(requesterId, userId))
|
||||
return Forbid("You can only access keys of your friends");
|
||||
|
||||
var keys = await _sessionKeyService.GetAllActiveKeysAsync(userId);
|
||||
|
||||
return Ok(keys);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user