From d6981b51065d35263b302e839f2782d777b781c9 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 21 Jan 2019 11:10:17 -0500 Subject: [PATCH] Remove legacy code --- src/Actors/Actor.php | 93 ------------------------------------- src/Actors/ActorService.php | 87 ---------------------------------- src/Actors/Inbox.php | 51 -------------------- src/Actors/Outbox.php | 51 -------------------- 4 files changed, 282 deletions(-) delete mode 100644 src/Actors/Actor.php delete mode 100644 src/Actors/ActorService.php delete mode 100644 src/Actors/Inbox.php delete mode 100644 src/Actors/Outbox.php diff --git a/src/Actors/Actor.php b/src/Actors/Actor.php deleted file mode 100644 index e68279c..0000000 --- a/src/Actors/Actor.php +++ /dev/null @@ -1,93 +0,0 @@ -object = $object; - $this->keypair = $keypair; - $this->inbox = new Inbox( $this, $object['inbox'] ); - $this->outbox = new Outbox( $this, $object['outbox'] ); - } - - /** - * Returns the actor's inbox - * - * @return Inbox - */ - public function inbox() - { - return $this->inbox; - } - - /** - * Returns the actor's outbox - * - * @return Outbox - */ - public function outbox() - { - return $this->outbox; - } - - /** - * Returns the actor's keypair - * - * @return RsaKeypair - */ - public function keypair() - { - return $this->keypair; - } -} -?> diff --git a/src/Actors/ActorService.php b/src/Actors/ActorService.php deleted file mode 100644 index 65bbc10..0000000 --- a/src/Actors/ActorService.php +++ /dev/null @@ -1,87 +0,0 @@ -objectService = $objectService; - $this->entityManager = $entityManager; - } - - /** - * Creates a new Actor object - * - * Also creates the actor's collections - inbox, outbox, following, - * followers, and liked - and the actor's public/private keypair. - * The collections will have ids generated by appending / - * to the end of the actor's id, e.g. /inbox, /outbox, etc. The public key - * will have its id generated by appending #main-key to the end of the actor's - * id. The private key will be persisted and associated with the actor object. - * - * @param array $fields The actor's fields. The id and type fields are required - * @return Actor The created Actor object - */ - public function createActor( $fields ) - { - $requiredFields = array( 'id', 'type' ); - if ( ! Util::arrayKeysExist( $fields, $requiredFields ) ) { - throw new InvalidArgumentException( 'Actors require id and type fields' ); - } - $actorId = rtrim( $fields['id'], '/' ); - - // Create keypair - $keypair = RsaKeypair::generate(); - $entityManager->persist( $keypair ); - $publicKeyField = array( - 'id' => "${actorId}#main-key", - 'owner' => $actorId, - 'publicKeyPem' => $keypair->getPublicKey(), - ); - $fields['publicKey'] = $publicKeyField; - - // Create collections - - // Persist actor ActivityPubObject - } - - /** - * Returns the actor identified by $id - * - * @param string $id The actor's id - * @return ActivityPubActor The actor - */ - public function getActor( $id ) - { - - } - - /** - * Deletes the actor identified by $id by replacing it with a Tombstone object - * - * Also deletes the actor's collections - inbox, outbox, following, - * followers, and liked - and the actor's public/private keypair. - * @param string $id The actor's id - * @return ActivityPubObject The Tombstone that the actor was replaced with - */ - public function deleteActor( $id ) - { - - } -} -?> diff --git a/src/Actors/Inbox.php b/src/Actors/Inbox.php deleted file mode 100644 index c414f6f..0000000 --- a/src/Actors/Inbox.php +++ /dev/null @@ -1,51 +0,0 @@ -actor = $actor; - $this->object = $object; - } - - /** - * Receives a new activity to the inbox, verifying the provided signature. - * - * @param ActivityPubObject $activity The received activity - * @param string $signature A valid signature for the activity, signed with - * the the private key of the actor who created it - */ - public function receive( ActivityPubObject $activity, string signature ) - { - // TODO - } -} -?> diff --git a/src/Actors/Outbox.php b/src/Actors/Outbox.php deleted file mode 100644 index 92b7c23..0000000 --- a/src/Actors/Outbox.php +++ /dev/null @@ -1,51 +0,0 @@ -actor = $actor; - $this->object = $object; - } - - /** - * Posts a new activity to the outbox, signing and delivering the activity - * to the correct recipients. - * - * @param ActivityPubObject $activity The activity - */ - public function post( ActivityPubObject $activity ) - { - // TODO - } -} -?>