diff options
author | Rory& <root@rory.gay> | 2024-05-30 08:22:50 +0000 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-05-30 08:22:50 +0000 |
commit | 0fa768556aca00f4346ccd71917fad048def6323 (patch) | |
tree | e6835af94759eac7814aa6d1c718d98d37dfc4a9 /Tests/LibMatrix.HomeserverEmulator/Controllers/KeysController.cs | |
parent | Log warning if registering a duplicate type (diff) | |
download | LibMatrix-0fa768556aca00f4346ccd71917fad048def6323.tar.xz |
Move around some projects, further cleanup pending github/dev/project-cleanup dev/project-cleanup
Diffstat (limited to 'Tests/LibMatrix.HomeserverEmulator/Controllers/KeysController.cs')
-rw-r--r-- | Tests/LibMatrix.HomeserverEmulator/Controllers/KeysController.cs | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/Tests/LibMatrix.HomeserverEmulator/Controllers/KeysController.cs b/Tests/LibMatrix.HomeserverEmulator/Controllers/KeysController.cs deleted file mode 100644 index 7898a8c..0000000 --- a/Tests/LibMatrix.HomeserverEmulator/Controllers/KeysController.cs +++ /dev/null @@ -1,103 +0,0 @@ -// using System.Security.Cryptography; -// using System.Text.Json.Nodes; -// using System.Text.Json.Serialization; -// using LibMatrix.HomeserverEmulator.Services; -// using LibMatrix.Responses; -// using LibMatrix.Services; -// using Microsoft.AspNetCore.Mvc; -// -// namespace LibMatrix.HomeserverEmulator.Controllers; -// -// [ApiController] -// [Route("/_matrix/client/{version}/")] -// public class KeysController(ILogger<KeysController> logger, TokenService tokenService, UserStore userStore) : ControllerBase { -// [HttpGet("room_keys/version")] -// public async Task<RoomKeysResponse> GetRoomKeys() { -// var token = tokenService.GetAccessToken(HttpContext); -// if (token == null) -// throw new MatrixException() { -// ErrorCode = "M_MISSING_TOKEN", -// Error = "Missing token" -// }; -// -// var user = await userStore.GetUserByToken(token); -// if (user == null) -// throw new MatrixException() { -// ErrorCode = "M_UNKNOWN_TOKEN", -// Error = "No such user" -// }; -// -// if (user.RoomKeys is not { Count: > 0 }) -// throw new MatrixException() { -// ErrorCode = "M_NOT_FOUND", -// Error = "No keys found" -// }; -// -// return user.RoomKeys.Values.Last(); -// } -// -// [HttpPost("room_keys/version")] -// public async Task<RoomKeysResponse> UploadRoomKeys(RoomKeysRequest request) { -// var token = tokenService.GetAccessToken(HttpContext); -// if (token == null) -// throw new MatrixException() { -// ErrorCode = "M_MISSING_TOKEN", -// Error = "Missing token" -// }; -// -// var user = await userStore.GetUserByToken(token); -// if (user == null) -// throw new MatrixException() { -// ErrorCode = "M_UNKNOWN_TOKEN", -// Error = "No such user" -// }; -// -// var roomKeys = new RoomKeysResponse { -// Version = Guid.NewGuid().ToString(), -// Etag = Guid.NewGuid().ToString(), -// Algorithm = request.Algorithm, -// AuthData = request.AuthData -// }; -// user.RoomKeys.Add(roomKeys.Version, roomKeys); -// return roomKeys; -// } -// -// [HttpPost("keys/device_signing/upload")] -// public async Task<object> UploadDeviceSigning(JsonObject request) { -// var token = tokenService.GetAccessToken(HttpContext); -// if (token == null) -// throw new MatrixException() { -// ErrorCode = "M_MISSING_TOKEN", -// Error = "Missing token" -// }; -// -// var user = await userStore.GetUserByToken(token); -// if (user == null) -// throw new MatrixException() { -// ErrorCode = "M_UNKNOWN_TOKEN", -// Error = "No such user" -// }; -// -// return new { }; -// } -// } -// -// public class DeviceSigningRequest { -// public CrossSigningKey? MasterKey { get; set; } -// public CrossSigningKey? SelfSigningKey { get; set; } -// public CrossSigningKey? UserSigningKey { get; set; } -// -// public class CrossSigningKey { -// [JsonPropertyName("keys")] -// public Dictionary<string, string> Keys { get; set; } -// -// [JsonPropertyName("signatures")] -// public Dictionary<string, Dictionary<string, string>> Signatures { get; set; } -// -// [JsonPropertyName("usage")] -// public List<string> Usage { get; set; } -// -// [JsonPropertyName("user_id")] -// public string UserId { get; set; } -// } -// } \ No newline at end of file |