4 Commits

Author SHA1 Message Date
defnotken
4ce70bee83 quick change 2025-09-05 16:36:14 -05:00
defnotken
d73dea8706 Add new DTOs 2025-09-05 16:32:33 -05:00
defnotken
4918a2c4e3 Ban Route 2025-09-05 13:28:48 -05:00
defnotken
d9c0be5da3 Unban work 2025-09-04 10:54:52 -05:00
3 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
using MessagePack;
namespace LightlessSync.API.Dto.User;
[MessagePackObject(keyAsPropertyName: true)]
public record BanRequest(string Uid);

View File

@@ -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);
}

View File

@@ -12,6 +12,10 @@ 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 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);