Every remote object keeps its raw form and how it reached us, for the client's details view
Build / Build (push) Successful in 36s
Build / Build (push) Successful in 36s
- ObjectRecord, one per stored remote object: the raw JSON (up to 256 KB, always hashed), delivered or fetched, refetched from origin or not, the activity that brought it (or caused the fetch), shared or personal inbox, the signature's key, algorithm and signed headers, received time, published and updated, the delivering activity's @context, and up to ten later revisions from Update. - Delivery details travel from InboxReceiver through the inbox job to the handlers as Arrival.Current. - A host is described from its NodeInfo when we first hear from it, at most weekly (DescribeInstance job), never when someone opens the details view. - GET /api/privapub/v1/statuses/:id/provenance and /api/privapub/v1/instances/:host, with the extensions an object used detected from its raw form (044f quotes, interaction policies, contexts, proofs, Misskey fields, MFM, FEP-8967 links, emoji, polls, language maps, url variants, Markdown content). Checked live: a GoToSocial reply shows as delivered to the shared inbox, signed hs2019 with GoToSocial's fragment-less key id, with its interaction policy detected, and gts.test is described as gotosocial 0.22.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
1 parent
bb9bd71391
commit
dcd024100a
21 files changed
+662
-16
No files matched your search
@@ -0,0 +1,50 @@
|
||||
using MongoDB.Entities;
|
||||
|
||||
namespace PrivaPub.Models.Federation
|
||||
{
|
||||
public class ObjectRecord : Entity
|
||||
{
|
||||
public string ObjectURI { get; set; }
|
||||
public string PostId { get; set; }
|
||||
public string ObjectType { get; set; }
|
||||
public string Host { get; set; }
|
||||
|
||||
public string Raw { get; set; }//the object exactly as it reached us, unless it was larger than MaxRawBytes
|
||||
public string RawHash { get; set; }//sha-256 of the raw bytes, hex
|
||||
public int RawBytes { get; set; }
|
||||
public bool RawTruncated { get; set; }
|
||||
public string ActivityContext { get; set; }//the delivering activity's @context, which an embedded object does not repeat
|
||||
|
||||
public ObjectPath Path { get; set; }
|
||||
public bool Refetched { get; set; }//delivered, but read again from its origin because it came embedded from another one
|
||||
public string ActivityId { get; set; }//the activity that brought it, or that caused the fetch
|
||||
public string ActivityType { get; set; }
|
||||
public string ActivityActorURI { get; set; }
|
||||
public string Inbox { get; set; }//"shared" or "personal" when delivered
|
||||
public string SignatureScheme { get; set; }
|
||||
public string KeyId { get; set; }
|
||||
public string Algorithm { get; set; }
|
||||
public List<string> SignedHeaders { get; set; } = new();
|
||||
|
||||
public DateTime ReceivedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? Published { get; set; }
|
||||
public DateTime? Updated { get; set; }
|
||||
public List<ObjectRevision> Revisions { get; set; } = new();
|
||||
}
|
||||
|
||||
public class ObjectRevision
|
||||
{
|
||||
public string Raw { get; set; }
|
||||
public string RawHash { get; set; }
|
||||
public bool RawTruncated { get; set; }
|
||||
public string ActivityId { get; set; }
|
||||
public DateTime? Updated { get; set; }
|
||||
public DateTime ReceivedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public enum ObjectPath
|
||||
{
|
||||
Delivered,
|
||||
Fetched
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,8 @@ namespace PrivaPub.Models.Jobs
|
||||
{
|
||||
Deliver,
|
||||
ProcessInbox,
|
||||
FetchAncestors
|
||||
FetchAncestors,
|
||||
DescribeInstance
|
||||
}
|
||||
|
||||
public enum JobState
|
||||
|
||||
@@ -10,5 +10,14 @@ namespace PrivaPub.Models.Jobs
|
||||
public DateTime? LastSuccessAt { get; set; }
|
||||
public DateTime? LastFailureAt { get; set; }
|
||||
public string LastError { get; set; }
|
||||
|
||||
public string Software { get; set; }//NodeInfo software.name: for display, never for deciding behaviour
|
||||
public string SoftwareVersion { get; set; }
|
||||
public string NodeName { get; set; }
|
||||
public List<string> Protocols { get; set; } = new();
|
||||
public bool? OpenRegistrations { get; set; }
|
||||
public string NodeInfo { get; set; }//the raw document, when small enough
|
||||
public DateTime? DescribedAt { get; set; }
|
||||
public string DescriptionError { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user