mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-21 18:45:36 +02:00
Arbitrary Webhook for NotificationConnectors
Backend only deals in REST Webhooks The API has custom Endpoints for Ntfy, Gotify, Lunasea that create pre-formatted Webhooks #297 #259
This commit is contained in:
16
API/APIEndpointRecords/LunaseaRecord.cs
Normal file
16
API/APIEndpointRecords/LunaseaRecord.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record LunaseaRecord(string id)
|
||||
{
|
||||
private static Regex validateRex = new(@"(?:device|user)\/[0-9a-zA-Z\-]+");
|
||||
public bool Validate()
|
||||
{
|
||||
if (id == string.Empty)
|
||||
return false;
|
||||
if (!validateRex.IsMatch(id))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user