From d9c0be5da3a90411f333932a5a58ae1c7762af45 Mon Sep 17 00:00:00 2001 From: defnotken Date: Thu, 4 Sep 2025 10:54:52 -0500 Subject: [PATCH 1/4] Unban work --- LightlessSyncAPI/Routes/LightlessAuth.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LightlessSyncAPI/Routes/LightlessAuth.cs b/LightlessSyncAPI/Routes/LightlessAuth.cs index 3414bbd..7f8fbf2 100644 --- a/LightlessSyncAPI/Routes/LightlessAuth.cs +++ b/LightlessSyncAPI/Routes/LightlessAuth.cs @@ -12,6 +12,9 @@ public class LightlessAuth public const string OAuth_GetDiscordOAuthEndpoint = "getDiscordOAuthEndpoint"; public const string OAuth_GetUIDs = "getUIDs"; public const string OAuth_GetDiscordOAuthToken = "getDiscordOAuthToken"; + public const string User = "/user"; + public const string User_Unban_Discord = "unbanDiscord"; + public const string User_Unban_Uid = "unbanUID"; public static Uri AuthFullPath(Uri baseUri) => new Uri(baseUri, Auth + "/" + Auth_CreateIdent); public static Uri AuthWithOauthFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_CreateOAuth); public static Uri RenewTokenFullPath(Uri baseUri) => new Uri(baseUri, Auth + "/" + Auth_RenewToken); -- 2.49.1 From 4918a2c4e321a79c8320e1b31aec36ddceacbb45 Mon Sep 17 00:00:00 2001 From: defnotken Date: Fri, 5 Sep 2025 13:28:48 -0500 Subject: [PATCH 2/4] Ban Route --- LightlessSyncAPI/Routes/LightlessAuth.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/LightlessSyncAPI/Routes/LightlessAuth.cs b/LightlessSyncAPI/Routes/LightlessAuth.cs index 7f8fbf2..03f2361 100644 --- a/LightlessSyncAPI/Routes/LightlessAuth.cs +++ b/LightlessSyncAPI/Routes/LightlessAuth.cs @@ -15,6 +15,7 @@ public class LightlessAuth public const string User = "/user"; public const string User_Unban_Discord = "unbanDiscord"; public const string User_Unban_Uid = "unbanUID"; + public const string Ban_Uid = "ban"; public static Uri AuthFullPath(Uri baseUri) => new Uri(baseUri, Auth + "/" + Auth_CreateIdent); public static Uri AuthWithOauthFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_CreateOAuth); public static Uri RenewTokenFullPath(Uri baseUri) => new Uri(baseUri, Auth + "/" + Auth_RenewToken); -- 2.49.1 From d73dea87061ea296fc4554815fc1531539b94377 Mon Sep 17 00:00:00 2001 From: defnotken Date: Fri, 5 Sep 2025 16:32:33 -0500 Subject: [PATCH 3/4] Add new DTOs --- LightlessSyncAPI/Dto/User/BanRequest.cs | 5 +++++ LightlessSyncAPI/Dto/User/UnbanRequest.cs | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 LightlessSyncAPI/Dto/User/BanRequest.cs create mode 100644 LightlessSyncAPI/Dto/User/UnbanRequest.cs diff --git a/LightlessSyncAPI/Dto/User/BanRequest.cs b/LightlessSyncAPI/Dto/User/BanRequest.cs new file mode 100644 index 0000000..fd727f6 --- /dev/null +++ b/LightlessSyncAPI/Dto/User/BanRequest.cs @@ -0,0 +1,5 @@ +using MessagePack; +namespace LightlessSync.API.Dto.User; + +[MessagePackObject(keyAsPropertyName: true)] +public record BanRequest(string UID); diff --git a/LightlessSyncAPI/Dto/User/UnbanRequest.cs b/LightlessSyncAPI/Dto/User/UnbanRequest.cs new file mode 100644 index 0000000..719ee2d --- /dev/null +++ b/LightlessSyncAPI/Dto/User/UnbanRequest.cs @@ -0,0 +1,9 @@ +using MessagePack; + +namespace LightlessSync.API.Dto.User; +[MessagePackObject(keyAsPropertyName: true)] +public record UnbanRequest(string? Uid, string? DiscordId) +{ + public bool IsValid => !string.IsNullOrEmpty(Uid) || !string.IsNullOrEmpty(DiscordId); +} + -- 2.49.1 From 4ce70bee8354d0c96d73e65312d39a826810dc60 Mon Sep 17 00:00:00 2001 From: defnotken Date: Fri, 5 Sep 2025 16:36:14 -0500 Subject: [PATCH 4/4] quick change --- LightlessSyncAPI/Dto/User/BanRequest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LightlessSyncAPI/Dto/User/BanRequest.cs b/LightlessSyncAPI/Dto/User/BanRequest.cs index fd727f6..ea7d468 100644 --- a/LightlessSyncAPI/Dto/User/BanRequest.cs +++ b/LightlessSyncAPI/Dto/User/BanRequest.cs @@ -2,4 +2,4 @@ namespace LightlessSync.API.Dto.User; [MessagePackObject(keyAsPropertyName: true)] -public record BanRequest(string UID); +public record BanRequest(string Uid); -- 2.49.1