All 384 routes, the Mastodon API, the client API and the frozen federation paths, are read from one class with one nested class per controller. Their values are unchanged, checked one by one against the old literals; decePubClient keeps its own APIs class. Checked against GoToSocial in the pasture: 64 passed, 0 failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4YtEJrgxG12Pc39Fai8Bd
This commit is contained in:
1 parent
0f73f69239
commit
739a1603ca
47 files changed
+952
-373
No files matched your search
@@ -34,7 +34,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
const int MaxWeeks = 260;
|
||||
|
||||
|
||||
[HttpGet("/api/privapub/v1/statuses/{id}/provenance"), Scope("read:statuses", requiresUser: false), AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Provenance.GET_M_Status), Scope("read:statuses", requiresUser: false), AllowAnonymous]
|
||||
public async Task<IActionResult> Status(string id, CancellationToken token)
|
||||
{
|
||||
var post = await dbEntities.Posts.Match(p => p.ID == id).Match(VisibilityPolicy.IsShown).ExecuteFirstAsync(token);
|
||||
@@ -53,7 +53,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
return Json(Describe(post, record, instance, beforeCdn));
|
||||
}
|
||||
|
||||
[HttpGet("/api/privapub/v1/instances/{host}"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Provenance.GET_M_Instance), Scope("read", requiresUser: false), AllowAnonymous]
|
||||
public async Task<IActionResult> Instance(string host, CancellationToken token)
|
||||
{
|
||||
var described = await Describe(new[] { host }, token);
|
||||
@@ -61,11 +61,11 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
}
|
||||
|
||||
//up to MaxHosts at once (host[]=...), in the order asked; hosts this server does not know are left out
|
||||
[HttpGet("/api/privapub/v1/instances"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Provenance.GET_Instances), Scope("read", requiresUser: false), AllowAnonymous]
|
||||
public async Task<IActionResult> Instances(CancellationToken token) => Json(await Describe(Params.List("host"), token));
|
||||
|
||||
//the server's weekly snapshots, newest first (weeks=, at most MaxWeeks): its place as shown publicly, its CDN, its size
|
||||
[HttpGet("/api/privapub/v1/instances/{host}/history"), Scope("read", requiresUser: false), AllowAnonymous]
|
||||
[HttpGet(ApiPaths.Provenance.GET_M_History), Scope("read", requiresUser: false), AllowAnonymous]
|
||||
public async Task<IActionResult> History(string host, CancellationToken token)
|
||||
{
|
||||
host = host?.Trim().ToLowerInvariant();
|
||||
|
||||
Reference in new issue
Block a user