wiki.trwnh.com/content/tech/spec/activitypub/actor.md
2023-04-26 17:31:11 -05:00

4 KiB

+++ +++

Actor

an actor is just something that has inbox and outbox. it represents an entity that can perform activities.

{{}}

implementations

mastodon

mastodon only understands Person / Group / Organization / Application / Service due to being overly strict -- mastodon/mastodon#22322

pleroma

ostensibly pleroma is also limited in the same way? https://git.pleroma.social/pleroma/pleroma/-/blob/develop/lib/pleroma/constants.ex#L57

other references in code:

misskey

the isActor check only validates if one of the five types

the interface requires inbox, outbox so that's fine, it should just drop the type hardcoded check

22ccb0fa71/packages/backend/src/core/activitypub/type.ts (L150-L176)

export const validActor = ['Person', 'Service', 'Group', 'Organization', 'Application'];


export const isActor = (object: IObject): object is IActor =>
	validActor.includes(getApType(object));


export interface IActor extends IObject {
	type: 'Person' | 'Service' | 'Organization' | 'Group' | 'Application';
	name?: string;
	preferredUsername?: string;
	manuallyApprovesFollowers?: boolean;
	discoverable?: boolean;
	inbox: string;
	sharedInbox?: string;	// 後方互換性のため
	publicKey?: {
		id: string;
		publicKeyPem: string;
	};
	followers?: string | ICollection | IOrderedCollection;
	following?: string | ICollection | IOrderedCollection;
	featured?: string | IOrderedCollection;
	outbox: string | IOrderedCollection;
	endpoints?: {
		sharedInbox?: string;
	};
	'vcard:bday'?: string;
	'vcard:Address'?: string;
}

gotosocial

d445c60a26/internal/federation/dereferencing/account.go (L412-L478)

seems to have a switch-case for Application Group Organization Person Service, but the comment above dereferenceAccountable() says this only (currently?) works for Person Application Service

peertube

https://github.com/Chocobozzz/PeerTube/blob/develop/shared/models/activitypub/activitypub-actor.ts

seems to have required fields type id following followers inbox outbox preferredUsername url name endpoints.sharedInbox summary attributedTo publicKey publicKey.id publicKey.owner publicKey.publicKeyPem [whew that's a lot!]

other code spots:

5070a99560/server/helpers/custom-validators/activitypub/actor.ts

sanitizeAndCheckActorObject() does the following:

  • actor exists
  • id is valid AP url
  • inbox is valid AP url
  • preferredUsername is valid
  • url is valid AP url
  • publicKey is valid public key object
  • endpoints is valid endpoints object
  • either no outbox, or outbox is valid AP url
  • either no following, or following is valid AP url
  • either no followers, or followers is valid AP url
  • set valid attributedTo
  • set valid description [summary???]
  • either type is not Group, or [if type is Group] then attributedTo has at least 1 item