Giter VIP home page Giter VIP logo

activitypub's People

Contributors

dpi avatar gudzpoz avatar jeremytubbs avatar landrok avatar simounet avatar snorpey avatar swentel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activitypub's Issues

Recherche développeur Activity Pub

Bonjour
Nous cherchons un developpeur pour intégré AP dans un projet open source en PHP
c'est une bouteille à la mer , on sait jamais
merci et désolé si c'est pas le bon endroit

Signature pattern too strict

The signature pattern is quite strict on the padding signs at the end. I'm getting signatures now and then with one or sometimes without equal signs in the end. So something like underneath makes the preg match work fine. Unless there's a requirement for having two there, but I don't think so :)

/^
        keyId="(?P<keyId>
            (https?:\/\/[\w\-\.]+[\w]+)
            (:[\d]+)?
            ([\w\-\.#\/@]+)
        )",
        (headers="\(request-target\) (?P<headers>[\w\s]+)",)?
        signature="(?P<signature>[\w+\/]+={0,2})"
    /x

Httpsignature verification failing

I've started verifying incoming activities now in the Drupal module. However, most are failing. As a consequence, incoming messages (even from followers) are unpublished and not visible on the timeline.

This is probably due to mastodon/mastodon#14556 - I had to change the creation of the signature because of this change when sending out activities to my followers.

Tricky stuff :) I'll dig in deeper myself first to figure out what needs to change and run it in my environment for a few days once I got something.

Cache miss even though an entry should be found

It looks like, even though cache is written to the file system, the cache is missed on the next request.

Some sample code; Note: the functions return ttl and the actual path which are configurable in the drupal module, but it also happens with the default cache settings.

    $config += [
      'cache' => [
        'ttl' => activitypub_cache_ttl(),
        'stream' => activitypub_cache_path()
      ],
    ];
    $config['instance']['types'] = 'ignore';
    return new Server($config);

  ...

  $server->actor($target)->get('inbox')

I did some naive debugging in Request.php to find out it didn't get into the ::has statement

        print_r("CHECKING $url");
        if (CacheHelper::has($url)) {
            print_r("FOUND");
            return CacheHelper::get($url);
        }
        try {
            print_r("DAMN");
            $content = $this->client->get($url)->getBody()->getContents();
        } catch (\GuzzleHttp\Exception\ClientException $exception) {
            throw new Exception($exception->getMessage());
        }

        CacheHelper::set($url, $content);

        return $content;

Use some sort of cache in WebfingerFactory

When using following code:

$webfinger = $server->actor($handle)->webfinger();

The call to the webfinger url happens twice

  • first in __construct of Actor.php
  • then in webfinger()

There's a property webfingers, but a quick debug by adding in the get() method of the factory doesn't help, because well, it's static (unless I miss something very stupid here).

Not sure what the most elegant way would be to handle it.

Examples

Hi. I'm not an expert in using my brain :P I've tried from the documentation to understand how the code works (+ ActivityPub from online texts), but I don't know how to use these projects realistically, and I wouldn't want to create my own protocol. Can you write different simple examples of different functions?

For example:

  • Creating a user for ActivityPub (what data is needed) [of course can be given from the code].
  • Creating an entry based on the data
  • Retrieving an entry from another instance
  • Retrieving user data

And so on.

If possible, of course.

Use webfinger for public key and client side signing

Hi,
I start to play with webfinger and webrtc and would like to use your ActivityPub library because my small project could be extended with activitypub features later...
So I know it's a little bit of topic, but I hope you could help me to be compatible with your project 😅

Two questions about how to use it.

  1. It looks like webfinger would be nice to store a public key used for signature verification and optional encryption.
    Is it possible to add a public key to the webfinger user "file" and is it possible to get that attribute with your webfinger implementation?

  2. Content should be signed / encrypted client side. So how to do it with JavaScript to be compatible to HttpSignature::verify()?
    Client side encryption library examples:

How to use this as a federated server?

What I want to do is create a server that will be federated with Lemmy instances and will receive pings to the inbox like Lemmy instances do. I can't find any documentation about anything similar. Is it supported? If so, how?

Thank you!

This is just a thank you issue :)

I've just tagged alpha 1 of the Drupal module at https://www.drupal.org/project/activitypub.

I don't even use the full power yet of your library, but that's slowly coming, thanks for all the work already!

🎉 🤘 💪

HttpSignature use - (Failing requests from Mastodon)

So this is less a problem with the library and more of a problem with my use of it. But when trying to validate signatures coming from a mastodon Follow request, the httpsignature->verify fails every time.

I'm following the examples and I don't know where things are going sideways on this. Any information to help clear this up would be great.

Thanks

@[email protected]

"Fetch Peertube Outbox activities" Docs is not working (for me)

I've been trying to run https://landrok.github.io/activitypub/fetch-peertube-outbox-activities.html but I can't get a result from the various Peertube accounts. For example: [email protected].

Could you check if the documentation is still correct? Could you maybe look at some sample profiles that work with the script?

The first issues their about undefined properties, but event after defining them I still ran into issues.

Thanks again for all your work and documentation!

Signature pattern failed with Mastodon/Pleroma requests

The signature field in the request was keyId="https://domain/path#main-key",algorithm="rsa-sha256",headers="(request-target) host date digest content-type",signature="zRbQw......0MUqA==", and I suspect that the algorithm="rsa-sha256" field has caused this problem. (By the way, requests from both Mastodon and Pleroma seem to be using rsa-sha256.)

Can this be fixed somehow? Thanks!

Update psr/cache dependency

landrok/activitypub 0.5.6 requires psr/cache ^1.0 -> found psr/cache[1.0.0, 1.0.1] but the package is fixed to 3.0.0

0.4.0 release?

Hi,

I'm (finally) working on ActivityPub for Drupal using your library, and it's coming along well.

I was wondering whether you have an ETA to tag a new release? That would allow me to set a stable tag in my composer file, instead of having to rely on dev/master branch.

Thanks!

[Question] How use that library or build a pubgate like project?

I'm not a programmer / developer, so I don't think I could design or realize such a project in needed quality...

I searched for a universal solution for a multi user / multi domain blog (one user can have different author names and blog domains) as alternative to multiple blog installations (plume, writefreely or some other solution).

I found https://github.com/autogestion/pubgate which looks like a activitypub headless cms (database + api). I really like that way and would ask if there is a project like that build on top of that library with php?

Who uses landrok/acticitypub?

WordPress compatibility

Hey @landrok , I am the author of the WordPress ActivityPub Plugin (https://github.com/pfefferle/wordpress-activitypub) and @mediaformat and I investigated if it is possible to use your lib in the plugin, so I have some questions.

  • WordPress comes with it's own API endpoints and with it's request handlers, do you see a way to provide a bit more generic way to verify requests, withouth the requirement of guzzle or symfony?
  • Because we can't use the server part of your lib, what do you think about a fromJson method for the Activity Objects, so that we will be able to init the objects, using the JSON request?

Allow passing custom User Agent to the request object

Depending on the context, it might be necessary to pass on a different user agent.
In my case, this is because the tests in Drupal spawn a separate Drupal which is only accessible if the right user agent is passed on in guzzle user agents.

Client API?

Hi,

looks like a client api is planned, but not ready?
And which clients should be compatible to the client api (mastodon web client, mastodon apps)?

Validation error on CollectionPage

I am trying to build out Mastodon support for an application, and running into a validation error I cannot explain.

Here's the code:

$server new Server([
    'ontologies' => [
        // I'm building out the ontology class based on the error messages I get.
        'mastodon' => MastodonOntology::class,
    ]
]);

// This works (after I create an extended Person and a PropertyValue)
$actor = $this->server->actor('[email protected]');

$outbox = $this->server->outbox('[email protected]');

$pages = [];

// This fails.
$page = $outbox->getPage($outbox->get()->first);

Specifically, the error comes from Util::hasProperties(), which is called with an array for $item instead of an object. (The method really needs better native types.) That makes the property_exists() call fail with a type error. After some debugging, I have determined it's being called with this array:

[
  'type' => 'CollectionPage',
  'next' => 'https://phpc.social/users/Crell/statuses/...',
  'partOf' => 'https://phpc.social/users/Crell/statuses/...',
  'items' => [],
]

Which... doesn't make sense, as CollectionPage is a built-in supported type, so I have no idea how it's still an array at that point.

I've hit a wall on debugging at this point. Any help on what's going on? There's like 10 stack layers between my code and where the error is, and I have on idea where the issue is.

(I'm quite open to submitting the Mastodon ontology as a PR once I have it working, if there would be interest.)

Be more forgiven about (some) undefined properties?

There's validation when trying to create an object, which is great.

However, it looks like mastodon added a 'featured' property, so trying to get the webfinger info from say [email protected] results now in

In AbstractObject.php line 137:
                                                                                                                                                                                                                  
  Property "featured" is not defined. Type="Service", Class="ActivityPhp\Type\Extended\Actor\Service" 

I haven't fully dived into the code yet, and I can probably add it the feature/property myself with custom code. However, it still means we'd have to keep an eye on the logs in case some service decided to add another one which would break everything again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.