Commit Graph

54 Commits

Author SHA1 Message Date
Hugo Sales d4b7e990ce
[CORE][Event] Make all events return \EventResult, enforced at container build time 2022-04-03 21:40:32 +01:00
Diogo Peralta Cordeiro fd71d6ee7d
[PLUGIN][UnboundGroup] Finish implementation 2022-03-29 00:57:41 +01:00
Diogo Peralta Cordeiro 83599ef866
[CORE][Modules][Plugin] version should be static 2022-03-28 23:54:18 +01:00
Hugo Sales 483983790a
[CORE][Router] Rename \App\Core\Router\Router to \App\Core\Router and merge \App\Core\Router\RouteLoader with \App\Core\Router 2022-03-28 20:59:15 +01:00
Hugo Sales 60af9f5e9b
[CORE][Queue] Rename App\Core\Queue\Queue to App\Core\Queue 2022-03-28 20:59:15 +01:00
Hugo Sales abe35428da
[CORE][DB] Rename App\Core\DB\DB to App\Core\DB 2022-03-28 20:59:14 +01:00
Diogo Peralta Cordeiro be33c20614
[PLUGIN][ActivityPub] Improve flexibility of Type layer, accomodate more elaborate understanding of Group Announces after FEP-2100 development 2022-03-28 20:58:48 +01:00
Diogo Peralta Cordeiro 56b8710b26
[PLUGIN][ActivityPub][Notification] Fix some issues with targetting 2022-03-23 13:23:44 +00:00
Diogo Peralta Cordeiro 888c3798b7
[COMPONENT][Notification] Make logic more generic and robust
Fixed various bugs

Some important concepts to bear in mind:

* Notification: Associated with activities, won't be reconstructed
together with objects, can be thought of as transient

* Attention: Associated with objects, will be reconstructed with them, can
be thought as persistent

* Notifications and Attentions have no direct implications.

* Mentions are a specific form of attentions in notes, leads to the creation of Attentions.

Finally,

Potential PHP issue detected and reported: https://github.com/php/php-src/issues/8199
`static::method()` from a non static context (such as a class method) calls `__call`, rather than
the expected `__callStatic`. Can be fixed by using `(static fn() => static::method())()`, but the
usage of the magic method is strictly unnecessary in this case.
2022-03-14 11:37:09 +00:00
Diogo Peralta Cordeiro 1a0c9e720f
[COMPONENT][FreeNetwork] Start using queues
[COMPONENT][Notification] Start using queues
[PLUGIN][ActivityPub] Start using queues
2022-03-05 14:23:08 +00:00
Diogo Peralta Cordeiro b630d530f4
[PLUGIN][ActivityPub][Postman] JSON_UNESCAPED_SLASHES
Only record webfinger matches for acct
2022-02-25 13:52:56 +00:00
Diogo Peralta Cordeiro f5e92de62d
[PLUGIN][ActivityPub][Util][Explorer] Simplify fetching Actor by URI 2022-02-25 13:12:14 +00:00
Diogo Peralta Cordeiro f3c2e49e3f
[PLUGIN][ActivityPub] Correct @context 2022-02-23 22:27:30 +00:00
Diogo Peralta Cordeiro 57a07ef74f
[COMPONENT][FreeNetwork] Add to Search the query expression 2022-02-21 04:53:12 +00:00
Diogo Peralta Cordeiro 1e310aa124
[PLUGIN][ActivityPub][FreeNetwork] DB::findBy won't work if not commited first 2022-02-20 15:01:49 +00:00
Diogo Peralta Cordeiro 6f3e760c63
[PLUGIN][ActivityPub][Inbox] Separate handler by method 2022-02-20 05:03:40 +00:00
Diogo Peralta Cordeiro 51cccd0155
[PLUGIN][ActivityPub] Simplify DB usage 2022-02-20 05:03:40 +00:00
Diogo Peralta Cordeiro 52ae5fa690
[PLUGIN][ActivityPub][Inbox] Improve logs 2022-02-19 04:49:50 +00:00
Diogo Peralta Cordeiro b6ed0b4c6c
[CORE][Actor] Fix generic profile route 2022-02-16 18:53:08 +00:00
Diogo Peralta Cordeiro 3ae8f8213f
[GROUP] Notifity group subscribers of new activity concerning the group 2022-02-13 23:15:00 +00:00
Diogo Peralta Cordeiro 17733f32d6
[PLUGIN][ActivityPub] Implement Group Outbox
Fix various minor issues
2022-02-11 10:06:01 +00:00
Diogo Peralta Cordeiro fb3e900b28
[CORE] Add CONFIG_ prefix to environment whitelist
Fixed minor issues with Commong:config of env not being included and ported to local social yaml

Fixed some regressions introduced with [CORE] Unset sensitive information from the environment
2022-02-11 10:05:58 +00:00
Diogo Peralta Cordeiro 416451a519
[CORE][Actor] Simplify logic so more is reused between different types of actors
Minor bug fixes
2022-02-11 00:27:03 +00:00
Diogo Peralta Cordeiro 59b8bdf99b
[PLUGIN][ActivityPub] Provide ActivityStreams 2.0 responses for every Collection
Implemented ActivityPub Outbox
2022-01-11 20:30:25 +00:00
Diogo Peralta Cordeiro 9ea230d12b
[COMPONENT][Subscription] Implement subscription handlers 2022-01-03 02:23:06 +00:00
Diogo Peralta Cordeiro def5f36c25
[PLUGIN][ActivityPub][Inbox] Accept Follow Activity
Improve how Core Activity is handled in general
2022-01-02 23:50:16 +00:00
Diogo Peralta Cordeiro 1d1d169a5c
[PLUGIN][ActivityPub] Support federation of Tombstones 2021-12-28 17:10:20 +00:00
Diogo Peralta Cordeiro 9585472679
[ENTITY][Actor] Basic check if can admin for remote actors 2021-12-28 15:38:41 +00:00
Diogo Peralta Cordeiro e3efd25b43
[PLUGIN][ActivityPub] Fix typo in getObjectByUri 2021-12-24 02:46:45 +00:00
Diogo Peralta Cordeiro a005a7bcea
[PLUGIN][ActivityPub] Add getUriByObject, so that we can construct activities referring to other known objects (local or foreign) 2021-12-20 13:32:46 +00:00
Hugo Sales a81ac673ac
[CORE][ENTITY] Rename 'Entity::getWithPK' to 'Entity::getByPK' 2021-12-19 19:04:01 +00:00
Diogo Peralta Cordeiro 480a42cca5
[PLUGIN][ActivityPub] Introduce ActivitypubObject. Beware, inside the plugin, an Object can never be an Activity.
Many bug fixes and other major changes (interface changed, see EVENTS.md)
2021-12-08 23:24:23 +00:00
Diogo Peralta Cordeiro 778cb57d83
[PLUGIN][ActivityPub] Finish base ActivityStreams 2.0 interface
Instructions below

To extend an Activity properties do:

public function onActivityPubValidateActivityStreamsTwoData(string $type_name, array &$validators): bool {
    if ($type_name === '{Type}') {
        $validators['attribute'] = myValidator::class;
    }
    return Event::next;
}

The Validator should be of the form:

use ActivityPhp\Type;
use ActivityPhp\Type\Util;
use Plugin\ActivityPub\Util\ModelValidator;

class myValidator extends ModelValidator
{
    /**
     * Validate Attribute's value
     *
     * @param mixed $value from JSON's attribute
     * @param mixed $container A {Type}
     * @return bool
     * @throws Exception
     */
    public function validate($value, $container): bool
    {
        // Validate that container is a {Type}
        Util::subclassOf($container, Type\Extended\Object\{Type}::class, true);

        return {Validation Result};

To act on received activities do:

public function onActivityPubNew{Type}(&$obj): bool {

To add information to Activities being federated by ActivityPub do:

public function ActivityPubAddActivityStreamsTwoData(string $type_name, &$type): bool {

To implement an ActivityStreams 2.0 representation do:

public function onActivityPubActivityStreamsTwoResponse(string $route, arrray $vars, ?TypeResponse &$response = null): bool {
        if ($route === '{Object route}') {
                $response = ModelResponse::handle($vars[{Object}]);
                return Event::stop;
        }
        return Event::next;
}
2021-12-04 21:05:07 +00:00
Diogo Peralta Cordeiro d044039272
[FreeNetwork] Initial multi-protocol support 2021-12-02 14:23:21 +00:00
Diogo Peralta Cordeiro dbaee08038
[FreeNetwork] Move mentions logic from AP to FN and handle local webfinger mentions properly 2021-12-02 11:12:04 +00:00
Diogo Peralta Cordeiro 6f543ccc06
[ActivityPub][Model][Activity] Translate including objects 2021-12-01 20:53:51 +00:00
Diogo Peralta Cordeiro 424df54a1b
[ActivityPub] Add HTTP Signatures 2021-12-01 19:47:41 +00:00
Diogo Peralta Cordeiro 123544fa50
[ActivityPub] Port Postman 2021-12-01 19:47:40 +00:00
Diogo Peralta Cordeiro 56526c9ba6
[ActivityPub][Inbox] Restore Create Note Functionality
Minor bug fixes
2021-11-29 22:42:46 +00:00
Diogo Peralta Cordeiro c862c9bf18
[ActivityPub] Make remote mentions great again 2021-11-01 12:16:46 +00:00
Hugo Sales 4d9a5aae5a
[ActivityPub] Always explicitly compare the results of `Event::handle` to the constants `next` or `stop` 2021-10-28 17:28:02 +01:00
Diogo Peralta Cordeiro 51c984849f
[ActivityPub] Port Explorer 2021-10-27 04:22:19 +01:00
Diogo Peralta Cordeiro 028ea79fff
[CORE][Router] Properly act on Accept headers 2021-10-27 04:19:30 +01:00
Diogo Peralta Cordeiro 8544fe157b
[FreeNetwork] First steps porting webfinger/lrdd to v3, GET webfinger requests already have a basic result 2021-10-27 04:19:29 +01:00
Hugo Sales 9109c61af5
[TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types 2021-10-27 04:19:28 +01:00
Diogo Peralta Cordeiro 517ed953f2
[FreeNetwork] First step towards de-duplication mechanism for federation
Refactored AS2 inside AP; [ENTITY][Activity] went from core to AP
Webfinger plugin will be part of FreeNetwork component
2021-10-06 11:48:22 +01:00
Diogo Peralta Cordeiro d6f31d102a
[CORE][ActivityStreamsTwo][ActivityPub] Set all routes
Allow global routes to act for every actor
Fix Favoured stream query
2021-09-18 05:12:15 +01:00
Diogo Peralta Cordeiro 365edbaff0
[ActivityStreamsTwo] Initial Actor support
Various bug fixes
2021-09-15 10:26:53 +01:00
Hugo Sales 4e30e5aad9
[TOOLS] Fix all issues found by PHPStan level 2 2021-09-14 13:13:44 +01:00
Diogo Peralta Cordeiro 8880af8197
[ActivityStreamsTwo] Introduce a structure for data representation in ActivityStreams 2.0
Type factory borrowed from landrok/activitypub
2021-09-14 13:13:37 +01:00