mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update ActivityPubFetchService, fix authorized_fetch support
This commit is contained in:
parent
763ce19a0a
commit
b89c4f1cdc
3 changed files with 110 additions and 3 deletions
|
@ -25,7 +25,61 @@ class InstanceActorController extends Controller
|
|||
public function outbox()
|
||||
{
|
||||
$res = json_encode([
|
||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||
"@context" => [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
"https://w3id.org/security/v1",
|
||||
[
|
||||
"manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
|
||||
"toot" => "http://joinmastodon.org/ns#",
|
||||
"featured" => [
|
||||
"@id" => "toot:featured",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"featuredTags" => [
|
||||
"@id" => "toot:featuredTags",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"alsoKnownAs" => [
|
||||
"@id" => "as:alsoKnownAs",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"movedTo" => [
|
||||
"@id" => "as:movedTo",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"schema" => "http://schema.org#",
|
||||
"PropertyValue" => "schema:PropertyValue",
|
||||
"value" => "schema:value",
|
||||
"discoverable" => "toot:discoverable",
|
||||
"Device" => "toot:Device",
|
||||
"Ed25519Signature" => "toot:Ed25519Signature",
|
||||
"Ed25519Key" => "toot:Ed25519Key",
|
||||
"Curve25519Key" => "toot:Curve25519Key",
|
||||
"EncryptedMessage" => "toot:EncryptedMessage",
|
||||
"publicKeyBase64" => "toot:publicKeyBase64",
|
||||
"deviceId" => "toot:deviceId",
|
||||
"claim" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:claim"
|
||||
],
|
||||
"fingerprintKey" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:fingerprintKey"
|
||||
],
|
||||
"identityKey" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:identityKey"
|
||||
],
|
||||
"devices" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:devices"
|
||||
],
|
||||
"messageFranking" => "toot:messageFranking",
|
||||
"messageType" => "toot:messageType",
|
||||
"cipherText" => "toot:cipherText",
|
||||
"suspended" => "toot:suspended"
|
||||
]
|
||||
],
|
||||
'id' => config('app.url') . '/i/actor/outbox',
|
||||
'type' => 'OrderedCollection',
|
||||
'totalItems' => 0,
|
||||
|
|
|
@ -23,7 +23,61 @@ class InstanceActor extends Model
|
|||
public function getActor()
|
||||
{
|
||||
return [
|
||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||
"@context" => [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
"https://w3id.org/security/v1",
|
||||
[
|
||||
"manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
|
||||
"toot" => "http://joinmastodon.org/ns#",
|
||||
"featured" => [
|
||||
"@id" => "toot:featured",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"featuredTags" => [
|
||||
"@id" => "toot:featuredTags",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"alsoKnownAs" => [
|
||||
"@id" => "as:alsoKnownAs",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"movedTo" => [
|
||||
"@id" => "as:movedTo",
|
||||
"@type" => "@id"
|
||||
],
|
||||
"schema" => "http://schema.org#",
|
||||
"PropertyValue" => "schema:PropertyValue",
|
||||
"value" => "schema:value",
|
||||
"discoverable" => "toot:discoverable",
|
||||
"Device" => "toot:Device",
|
||||
"Ed25519Signature" => "toot:Ed25519Signature",
|
||||
"Ed25519Key" => "toot:Ed25519Key",
|
||||
"Curve25519Key" => "toot:Curve25519Key",
|
||||
"EncryptedMessage" => "toot:EncryptedMessage",
|
||||
"publicKeyBase64" => "toot:publicKeyBase64",
|
||||
"deviceId" => "toot:deviceId",
|
||||
"claim" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:claim"
|
||||
],
|
||||
"fingerprintKey" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:fingerprintKey"
|
||||
],
|
||||
"identityKey" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:identityKey"
|
||||
],
|
||||
"devices" => [
|
||||
"@type" => "@id",
|
||||
"@id" => "toot:devices"
|
||||
],
|
||||
"messageFranking" => "toot:messageFranking",
|
||||
"messageType" => "toot:messageType",
|
||||
"cipherText" => "toot:cipherText",
|
||||
"suspended" => "toot:suspended"
|
||||
]
|
||||
],
|
||||
'id' => $this->permalink(),
|
||||
'type' => 'Application',
|
||||
'inbox' => $this->permalink('/inbox'),
|
||||
|
|
|
@ -19,7 +19,6 @@ class ActivityPubFetchService
|
|||
|
||||
$baseHeaders = [
|
||||
'Accept' => 'application/activity+json, application/ld+json',
|
||||
'User-Agent' => '(Pixelfed/'.config('pixelfed.version').'; +'.config('app.url').')'
|
||||
];
|
||||
|
||||
$headers = HttpSignature::instanceActorSign($url, false, $baseHeaders);
|
||||
|
|
Loading…
Reference in a new issue