Help Needed: Actor validity

@chocobozzz @diogo

while doing a s2s Like activity from scratch (in dash) e.g. peertube says ActivityPub signature could not be checked and gnu social says Invalid actor.

How can I validate and diagnose the actor https://demo.mro.name/activitypub/u/alice/?

It might be that gnu social is expecting a Person type actor, not Service.

it fails regardless.

@nutomic @grishka @trwnh @heluecht @WisTex you all implemented servers I guess – how did you validate actors for federation? Is there something comparable the W3C HTML validator or the feed validators?

(And: Who else could have an interest in such and could possibly fund?)

I guess the issues you bump into are universal struggles that any new would-be fedi dev encounters. Unfortunately the onboarding to the fediverse is still too hard, and we should continue to improve it to have more people attracted to fedi and create / integrate more different apps.

I don’t know if you’ve seen the Guide for new ActivityPub implementers?

This long document with a ton of links is also a Wiki post that anyone can edit and update with stuff that is missing in the guidelines. If you find that important stuff is missing it would be great to update in this wiki. Hopefully at a certain time we can lift it from its current location and elaborate it into a comprehensive handbook of sorts, and crowdsource further from there to keep it up-to-date.

1 Like

Hi @aschrijver, I had a glimpse at it before. It’s very verbose (3500+ words) but terse on validation: Guide for new ActivityPub implementers

It doesn’t mention any aid to validate, right? Verbosity without reliable aid makes onboarding a horror, frankly. I found most documentation seen so far as useful to a newcomer as the Oxford Dictionary for a non-english-speaker to ask for the daytime. Work it through in total and get a doctoral degree after decades.

Don’t want to go OT on this thread, but fully agreed it is a horror show. One of the major challenges I see for the Fediverse that hampers adoption and innovation.

nope actually
 hehe

validation is a best-effort kind of thing. what you put out there will end up getting used entirely as the consumer sees fit. all you can really do is make sure that you are using the correct semantics.

put another way: any actor document is “valid” until it isn’t.

taking a quick look i see the following issues:

  • icon.url is not a valid url, so perhaps GNU Social expects the avatar to be valid?
  • empty properties can be excluded, you don’t have to define them as []
  • attachments should be attachment if it is included

now, you’re probably wondering, how would you have known these things beforehand? you can’t really. all you can do is read the spec and follow it as you see fit.

if you have an example consumer in mind, then you can start to test against that consumer’s expectations.

this sounds like peertube is expecting http signatures on incoming Like activities?

1 Like

which one (seriously)?

indeed. Feel free to play with https://codeberg.org/mro/activitypub/src/branch/master/like.sh it has no dependencies.

In my experience, its easier to first work on federation only between instances of your own project. This makes testing much easier, and allows you to make breaking changes while you figure things out.

Later you can work on federation with other projects. For that its easiest to run an instance of the other project yourself (or know someone who does). Then the admin should be able to tell from logs what exactly is going wrong. Some projects give better error messages than others, so if Peertube isnt working well, try federating with something else first.

2 Likes

for the documents you send out:

  • activitypub
  • activitystreams 2.0
  • activity vocabulary

for how to send: there’s http signatures, but iirc it’s a draft and really you’ll have to figure out how to get it working with various projects. if you can get it working with mastodon you can probably get it working with others (unless they have their own expectations)

1 Like

:tada: Alice just seems to have liked https://tube.network.europa.eu/w/aTx3DYwH1km2gTEn9gKpah

with https://codeberg.org/mro/activitypub/commit/83214037

Hi @WisTex,

with ‘validate’ I mean syntactical conformance in the sense of XML schema validation. Not authentication nor authorisation.

I just tested importing your test actor against GNU social v3, and it worked smoothly. If you tested it with version 2, we haven’t updated the AP plugin for v2 in a while and it has a couple of known bugs and limitations, it’s no longer in active development


1 Like

I still get

[{"error":"Invalid actor."}]

when doing a dislike of https://gnusocial.net/notice/11921862 with as2.ml#L295 namely the actor

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "id": "https://demo.mro.name/seppo/activitypub/",
  "type": "Person",
  "following": "https://demo.mro.name/seppo/activitypub/following.json",
  "followers": "https://demo.mro.name/seppo/activitypub/followers.json",
  "liked": "https://demo.mro.name/seppo/activitypub/liked.json",
  "inbox": "https://demo.mro.name/seppo/seppo.cgi/activitypub/inbox.json",
  "outbox": "https://demo.mro.name/seppo/activitypub/outbox.json",
  "preferredUsername": "demo",
  "name": "#Seppo! — self-reliantly posting on the #Fediverse",
  "summary": "some longer text\nthat may span mul-\ntiple lines",
  "publicKey": {
    "id": "https://demo.mro.name/seppo/activitypub/#main-key",
    "owner": "https://demo.mro.name/seppo/activitypub/",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1zzfMMOSi9JwQWSL5Mls\nnN1sPck+6Ve4eWmcyce4DIs472MORs46WcDsb9xtFTyI/UgPVh8kl66ilNDRXrCD\nYPbk04o18nrWOSk5XYVEOcj5zxO0GCqXI5ZdhNiugsumdvAOB5zSZp27Vc4MlOfb\nh76eaDhVX8TBJdRkOe/tfH6r5vENBaudL4vtDuWoFbAjdfup0f9GJqJbf7gwMPoq\nSGbvjThhrJ41VsTQjmPsQDaOQ5MDnrwkDJPQtKgGTgTiAThcppgTCljtCdnhBls7\nlWBPMcetsIyeR2h7WC71BA6QqltEM/RVBeET4CcajWzvoEoUdD54Lm+6U8saazzb\nDQIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  "attachment": [
    {
      "name": "Generator",
      "value": "seppo.app",
      "type": "PropertyValue"
    }
  ]
}

My question is still: why, how can I comply?

Or: what message id should I test against?

The instance gnusocial.net runs GNU social version 2. If you want to test with GNU social v3, you will have to deploy your own local instance. You’ll find instructions to do it at https://gnusocial.rocks .

1 Like

@diogo, @spookie thx, can you name me a post I can like/dislike for testing purposes? Hosting my own instance is not an option.

I won’t run other platforms. I test existing instances in the wild.