#social 2018-08-05
2018-08-05 UTC
xmpp-social and vasilakisfil joined the channel
# tuxether[m] how should I store the private key of actors? would plaintext suffice?
# up201705417 tuxether: That's how GNU Social AP plugin is handling it...
# up201705417 in case of detected compromise you can just regenerate keys for everyone
rigelk and kaniini joined the channel
# donpdonp activitypub chess-bot. toot "@king@castling.club I challenge @myfriend@box.com" then move with "@king@castling.club @myfriend.box.com Nf3" (knight to F3).
# stephank Haha, I'm the author of that. It's currently making the rounds on HN as well. :D
# stephank Oh, and https://castling.club/ if you want some examples. There's a list of recent games and stuff.
# puckipedia huh. TIL Mastodon renders bots as type "Service" instead of "Person"
# puckipedia .. !
# puckipedia stephank: are you using a json-ld api?
# puckipedia ... yeah, most probably
# puckipedia there's an interesting "bug" occuring, like it did in Kroeg until I fixed it
# puckipedia oh right way easier way to figure it out
# puckipedia [snip] - - [05/Aug/2018:18:14:42 +0000] "GET /-/context HTTP/1.1" 200 159 "-" "https://castling.club/"
# puckipedia ~knew it~
# JasonRobinson[m] how does mastodon know what account is a bot and what not? :P
# dansup stephank: good work!
# puckipedia JasonRobinson[m]: it's manually indicated :P but in AP it's "type": "Service" vs "type": "Person"
# stephank puckipedia: Good detective work! I was wondering whether that would cause trouble somewhere, but it apparently just works. Also wasn't sure if I was supposed to pick Service or Application. :)
# stephank dansup: Thanks! :D
# puckipedia stephank: fyi, I have
{"as:Public": null}
in my own context# puckipedia should force it to be a 'public' post
# puckipedia because ehm
# puckipedia things don't like the as:Public compacting
# puckipedia stephank: also yeah puckipedia.com is completely custom, on top of a JSON-LD-like store
# stephank Oh, is there some impl that's not picking up on the public?
# puckipedia I'm not sure if the fix ever made it into Mastodon even?
# stephank I *really* didn't like dealing with JSON-LD. I may even consider that one of the most annoying parts dealing with ActivityPub.
# puckipedia if equals_or_includes?(@object['to'], ActivityPub::TagManager::COLLECTIONS[:public])
# puckipedia yep there's never been the fix
# puckipedia stephank: so yaeh. I'm kinda 75/25 for/against it? it's made it pretty flexible, and some of the alternatives for this flexibility (*cough* capability negotiation *cough*) just don't quite do the right thing imo
# stephank That's true. Maybe it'd be better if the spec set more requirements on structure? For example, I like the rule the 'object' *must* be embedded in an activity posted to an inbox. That sort of thing.
# stephank And I'm not even sure why 'as:Public' happens.
# puckipedia stephank: the reason as:Public happens is simple if you know JSON-LD
# stephank (In my code, it's hardcoded, so it's an easy fix. But my json-ld lib does the same.)
# puckipedia
{"@context": {"as": "https://www.w3.org/ns/activitystreams#"}}
# puckipedia so "https://www.w3.org/ns/activitystreams#anything" gets compacted into "as:anything"
# stephank Yes, but there's also a Public alias in the as context?
# puckipedia it's broken
# puckipedia it won't be used to serialize single ID terms, you'd need (iirc) just "Public": "as:Public" for that
# puckipedia not with "@type": "@id"
# puckipedia so imo, I don't think you would ever need to do capability negotiation, as everything should be ignorable safely
# puckipedia for example, if you send a payment, you'd have to accept it specifically, and otherwise it would just time out after e.g. a week
# puckipedia so ignoring that activity would be Safe(TM)
# puckipedia actually huh. I can't get it to serialize as Public either way
# puckipedia wait nvm i'm derping
# puckipedia yeah you can't. relative IDs.
# stephank I'm not sure I follow why it's not working. I guess I feel like JSON-LD kind of falls short on its claim that we can just treat it like normal JSON, with a context annotation.
# puckipedia you can, in Most cases
# puckipedia the issue is that we didn't realise this happened until way too late
# puckipedia the 'canonical' form is full-form https://www.w3.org/ns/activitystreams#Public but only at the end did I notice it compacted into as:Public
# stephank I wonder if things would be better if JSON-LD simply required that IRIs and especially aliases like `as:*` were simply never allowed outside the context? So we'd never fall into the trap of having to check 3 different forms of a value.
# puckipedia the trick is that activitypub defines the canonical form as the compacted JSON-LD
# puckipedia which has exactly two forms. of which noone uses the latter because Death By A Thousand Technicalities
# puckipedia (in case you really want to know. flattened json-ld can still be compacted, which ends up as
{"@context": ..., "@graph": ...}
# puckipedia (I could be evil and return the latter always, but I don't)
# stephank Hah, so, what castling.club actually does, is flatten everything, then extract and compact what's needed from the graph using the expected context.
# stephank Which also abstract away embedding for me.
# puckipedia I got a lot of use out of my custom JSON-LD implementation
# puckipedia turns out that the intermediate representation I use for the node map, I accidentally recreated at least once inside kroeg
# stephank (I fixed the Public thingy just now)
# puckipedia solved it by just making those parts public
# puckipedia so hmm
# puckipedia my shitty python activitypub client is gaining features :D
# puckipedia aaronpk: https://puckipedia.com/.json :)
# puckipedia look at my nice and compact context
# puckipedia but seriously
# puckipedia Mastodon should do this
# puckipedia fun fact, the only reason the activitystreams context is in that array is that Mastodon refuses otherwise
# puckipedia actually yeah, no reason to ignore it anyways
# puckipedia ... mmh
# puckipedia slightly scared people will just completely drop the @context
# puckipedia maybe wait until Kroeg is doing slightly better?
# puckipedia puts it in Link header
# puckipedia concept for ensuring people use JSON-LD to parse activitypub:
ajordan joined the channel
# puckipedia every instance uses its own randomly generated names for e.g. as:name, as:preferredUsername, as:content, etc
# puckipedia so you have to use the context as key :P
# saranix ~'\o/'~
# stephank Currently, ActivityPub also mandates `profile="..."` in the Content-Type. I was wondering what the spec for interpreting that is? And wouldn't it mandate a matching context? (Thus we can't remove the AS context?)
# dansup lol
# puckipedia stephank: I think it's just preferences? it doesn't change processing semantics
# puckipedia however
# puckipedia Link: <http://json-ld.org/contexts/person.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
# puckipedia this is totally valid apparently
timbl joined the channel