diff --git a/LibMatrix.Federation/AuthenticatedFederationClient.cs b/LibMatrix.Federation/AuthenticatedFederationClient.cs
index b66d2cb..6f8d44b 100644
--- a/LibMatrix.Federation/AuthenticatedFederationClient.cs
+++ b/LibMatrix.Federation/AuthenticatedFederationClient.cs
@@ -3,6 +3,7 @@
namespace LibMatrix.Federation;
public class AuthenticatedFederationClient : FederationClient {
+
public class AuthenticatedFederationConfiguration {
}
@@ -11,4 +12,9 @@ public class AuthenticatedFederationClient : FederationClient {
}
+ // public async Task<UserDeviceListResponse> GetUserDevicesAsync(string userId) {
+ // var response = await GetAsync<UserDeviceListResponse>($"/_matrix/federation/v1/user/devices/{userId}", accessToken);
+ // return response;
+ // }
+
}
\ No newline at end of file
diff --git a/LibMatrix.Federation/XMatrixAuthorizationScheme.cs b/LibMatrix.Federation/XMatrixAuthorizationScheme.cs
index 5025434..fc402b7 100644
--- a/LibMatrix.Federation/XMatrixAuthorizationScheme.cs
+++ b/LibMatrix.Federation/XMatrixAuthorizationScheme.cs
@@ -1,5 +1,6 @@
using System.Net;
using System.Net.Http.Headers;
+using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using ArcaneLibs.Extensions;
using Microsoft.Extensions.Primitives;
@@ -28,7 +29,7 @@ public class XMatrixAuthorizationScheme {
Error = $"Expected authentication scheme of {Scheme}, got {header.Scheme}",
ErrorCode = MatrixException.ErrorCodes.M_UNAUTHORIZED
};
-
+
if (string.IsNullOrWhiteSpace(header.Parameter))
throw new LibMatrixException() {
Error = $"Expected authentication header to have a value.",
@@ -36,8 +37,7 @@ public class XMatrixAuthorizationScheme {
};
var headerValues = new StringValues(header.Parameter);
- foreach (var value in headerValues)
- {
+ foreach (var value in headerValues) {
Console.WriteLine(headerValues.ToJson());
}
@@ -51,4 +51,21 @@ public class XMatrixAuthorizationScheme {
public string ToHeaderValue() => $"{Scheme} origin=\"{Origin}\", destination=\"{Destination}\", key=\"{Key}\", sig=\"{Signature}\"";
}
+
+ public class XMatrixRequestSignature {
+ [JsonPropertyName("method")]
+ public required string Method { get; set; }
+
+ [JsonPropertyName("uri")]
+ public required string Uri { get; set; }
+
+ [JsonPropertyName("origin")]
+ public required string OriginServerName { get; set; }
+
+ [JsonPropertyName("destination")]
+ public required string DestinationServerName { get; set; }
+
+ [JsonPropertyName("content"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
+ public JsonObject? Content { get; set; }
+ }
}
\ No newline at end of file
|