DomainBlock (domain, severity, reject-media, public and private comment)
covers the domain and its subdomains. Admins manage them under
/clientapi/admin/domainblocks/{list,insert,delete}; the set is kept in
memory, reloaded on every change and at most five minutes stale.
A suspended domain is refused by FederationHttp.IsAllowed, so nothing is
fetched from it and no job delivers to it, and the inbox drops its
activities with a 202 before fetching any key. Reject-media strips the
attachments of posts from that domain. Silence is recorded for the
timelines and notifications that arrive in P1.2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using PrivaPub.ClientModels.Resources;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace PrivaPub.ClientModels.Admin
|
|
{
|
|
public class DomainBlockForm
|
|
{
|
|
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
|
StringLength(253, MinimumLength = 3, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource))]
|
|
public string Domain { get; set; }
|
|
|
|
public bool Suspend { get; set; } = true;
|
|
public bool RejectMedia { get; set; }
|
|
|
|
[StringLength(1000, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
|
public string PublicComment { get; set; }
|
|
|
|
[StringLength(1000, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))]
|
|
public string PrivateComment { get; set; }
|
|
}
|
|
|
|
public class ViewDomainBlock
|
|
{
|
|
public string Id { get; set; }
|
|
public string Domain { get; set; }
|
|
public string Severity { get; set; }
|
|
public bool RejectMedia { get; set; }
|
|
public string PublicComment { get; set; }
|
|
public string PrivateComment { get; set; }
|
|
public DateTime CreatedAt { get; set; }
|
|
}
|
|
}
|