#social 2017-06-16

2017-06-16 UTC
timbl joined the channel
timbl, cristomc, ben_thatmustbeme, thebaer, ajordan and cwebber2 joined the channel
#
puckipedia
https://github.com/puckipedia/Kroeg I published the code for my ActivityPub server finally :)
#
Loqi
[puckipedia] Kroeg: An ActivityPub server in C#. Also does OStatus for fun.
#
aaronpk
nice. do you have it running somewhere?
#
puckipedia
it kinda runs at lol.puckipedia.com while I work on it
#
puckipedia
(currently: turning it on)
#
puckipedia
it should be online (https://lol.puckipedia.com/auth/login) - but there's a stupid bug somewhere with inbox and IDs exisitng already
#
puckipedia
(it tries to add duplicate ids)
#
cwebber2
puckipedia: nice :D
#
puckipedia
okay, I think I have oauth2 added now
cristomc joined the channel
#
puckipedia
yup OAuth2 is there now too
#
puckipedia
so I should now support fragments in IDs too (getting e.g. example.com/test#object will probably get example.com/text, with #object embedded) - makes https://github.com/w3c/activitypub/issues/224#issuecomment-302737846 work
#
Loqi
[cwebber] @jaywink So another option is, maybe, to use fragment identifiers. Here's an example: ``` {"@context": "https://www.w3.org/ns/activitystreams", "type": "Create", "id": "https://social.example/alyssa/posts/49e2d03d-b53a-4c4c-a95c-94a6abf45a19...
#
cwebber2
puckipedia: cool :)
#
puckipedia
I also registered #kroeg on freenode for this project
#
puckipedia
(also, Kroeg is dutch for pub :P)
#
cwebber2
puckipedia: so you're using oauth2 for client to server I'm guessing? are you also using that workflow for server to server or do you have any authentication setup for that?
#
cwebber2
looks like I'll be at TPAC; who else is going from here I wonder?
#
puckipedia
cwebber2: there's currently no server->server auth
#
puckipedia
I was working on implementing JWS (per oshepherd's idea)
#
cwebber2
nods...
#
puckipedia
also I have to do something for remote retrieval of entities (currently it's unauthed too)
#
puckipedia
ooh I just realise that I misread how LD signatures would be used
#
puckipedia
I assumed the client was in control of the private key, not the server
#
cwebber2
puckipedia: yeah it would be that the client's in control for LD signatures
#
puckipedia
yeah. that means e.g. wrapping an object with a Create (in client->server) can't be done, afaik?
#
cwebber2
sorry I meant
#
cwebber2
puckipedia: yeah it would be that the server's in control for LD signatures
#
puckipedia
right, woops :P
#
cwebber2
puckipedia: there's a possible workflow where the client does have its own private key kind of vaguely outlined in the spec, so that the client could be authenticated and authorized via the public key part of that pair, but you wouldn't use LD signatures with it
#
cwebber2
you'd use http signatures
#
cwebber2
since it's really more for each http transaction, rather than something that "sticks around" on the object
#
puckipedia
provideClientKey and signClientKey, right?
#
puckipedia
I looked at HTTP signatures and I'm not sure how you would communicate "this key is signed by the actor's key"
#
cwebber2
puckipedia: I think I know how to do it but I need to prove it via implementation ;P
#
puckipedia
oh fun
#
cwebber2
you basically would have the server sign your client key
#
cwebber2
and present that signature authorizing access to the remote server you're accessing
#
cwebber2
there may need to be some vocabulary defined to clearly express that though.
KevinMarks joined the channel
#
puckipedia
ah, the signature part isn't in the http signature spec?
#
cwebber2
puckipedia: well presenting it as basically a certificate isn't iirc
#
puckipedia
right, explains a lot
#
puckipedia
... { "type": ["Create", "Post"], "id": "https://example.com/thing", "object": "https://example.com/thing", "content": "Hello.", "actor": "https://example.com/me" }
#
puckipedia
I'm scared that this might be valid
#
cwebber2
puckipedia: oh I was about to correct you :)
#
cwebber2
puckipedia: hehhhhhhhhhhhh well
#
puckipedia
yes
#
cwebber2
puckipedia: that's some epic vocabulary trolling right there...
#
puckipedia
..... I think this might be valid
#
puckipedia
I'm scared
#
cwebber2
well, it's not invalid technically, but whether it'll do what you want, I dunno...
#
cwebber2
depends on a server to server basis :)
#
cwebber2
I'd have to test with pubstrate to see what it does
#
cwebber2
hilarious though
#
cwebber2
I think really realistically
#
puckipedia
yeah. I was thinking of ways to avoid having different IDs for activities and their objects
#
puckipedia
and honestly I am scared by what I made
#
cwebber2
so I think it would render in pubstrate, though the server would accept it, but it might not do exactly waht you want
#
puckipedia
I use a bunch of First() for the Type
#
puckipedia
so it'd store the object as a Create in the database
#
puckipedia
and it'd probably indicate it's an Activity, which means it'll probably stack overflow the HTML renderer
#
puckipedia
my AS2 renderer though, will be just fine (it only unflattens each object once)
#
cwebber2
I don't think Pubstrate would have a stack overflow because of how I'm doing rendering but I should probably try :)
#
puckipedia
so if you e.g. have a CollectionPage with 10 objects, and each is attributedTo the same person
#
puckipedia
it'll only render the person's object for the first object
#
cwebber2
hilariously Pubstrate might do the right thing here: in rendering on a feed, the outer Create would win, but then it would try rendering the inner object, and it would find the Post type, and it would render that
#
cwebber2
however if you have a system where in your db one type "wins"
#
cwebber2
then yeah it would just break it
#
cwebber2
puckipedia: but if you wanted to break it with your stack overflow problem
#
cwebber2
you could have done the same thing with still "type": "Create" right?
#
cwebber2
with it posting at itself
#
puckipedia
true
#
cwebber2
if I'm understanding how you're describing your code right
#
cwebber2
sounds like you might want a recursion limit
#
cwebber2
in your renderer/flattener
#
puckipedia
it's just the static frontend, so I might fix that there
#
ben_thatmustbeme
testing a recursive object might be a good thing to put in the test suite
#
puckipedia
also maybe the AP spec should just plain out disallow someone from Creating another Activity?
#
ben_thatmustbeme
make sure that implementations don't break on things like that
#
puckipedia
(at least, if I understand the spec correctly that is not supposed to happen)
#
puckipedia
same with liking activities, as those are technically objects too
#
cwebber2
ben_thatmustbeme: might be hard to test where it would and wouldn't break things; eg in puckipedia's example it seems like it would store / etc fine, and even render as AS2 fine
#
cwebber2
but rendering as HTML it would break
#
cwebber2
which is technically out of the concern of the AP spec
#
cwebber2
might still be worth exploring
#
cwebber2
as a test anyway
#
cwebber2
a bonus "don't fall on this particular sword" check
#
puckipedia
well, the HTML renderer would be a static client
#
puckipedia
so that might fall under 'testing clients'
#
puckipedia
hm. another fun test might be: server->server federating a create with an object with an attributedTo with id=a, and the create has an actor with id=a but different values
#
ben_thatmustbeme
yeah, thats what i mean, its good to give people things that are easy to get tripped on
#
puckipedia
maybe fragments in IDs is fun as a test case
#
puckipedia
I retrieve the object by GETting without fragment
#
puckipedia
then I store that object flattened in the DB, and try to extract the ID *with* fragment
#
puckipedia
so e.g. { "id": "example.com", "object": { "id": "example.com#object" } } works
KevinMarks_ joined the channel
#
jaywink
I think K I wass
#
jaywink
Argh sorry
#
jaywink
Anyway, I was mentioned at some point. Sorry, on mobile client which means typos. Fragment ids didnt mean like a very compatible idea. I'd that something @cwebber2 you would actually recommend?
#
jaywink
I'd == is
#
cwebber2
jaywink: what's incompatible about fragment ids?
#
puckipedia
I think it's actually a really nice way to fix the issue of having sub-objects
#
cwebber2
I think that the way puckipedia is doing it is probably right
#
cwebber2
fetch the page, then search for the fragment within the document
#
puckipedia
yeah, I get it for mostly-cheap because of the way I store entities in the DB
#
cwebber2
puckipedia: how are you storing them?
#
puckipedia
as you would in a nosql db, so I remove all subobjects and store them separately
#
puckipedia
e.g. {"id": "example.com/create", "type": "Create", "object": {"id": "example.com/note", "type": "Note", "content": "hi"}}
#
puckipedia
is stored as "object": "example.com/note", and example.com/note is stored separately
#
cwebber2
puckipedia: yep that's what I'm doing as well
#
puckipedia
and when rendering as JSON I just say "render with max depth 3"
#
puckipedia
currently this is just a hard-coded list of id-having properties, but once I have JSON-LD I can store the proper context and separate them by which property has a type mapping of @id
#
cwebber2
yep that's also what I'm doing puckipedia
#
cwebber2
nice to hear we're on the same page
#
cwebber2
puckipedia: one thing I haven't solved though
#
cwebber2
is whether not to copy parent @context onto embedded objects when you "extract" them
#
cwebber2
you could expand then compact the whole thing to deal with it I guess but that seems a bit wasteful maybe
#
puckipedia
I do not do json-ld @context yet
#
cwebber2
I'm sure people who know json-ld better than I do have better answers about this
#
puckipedia
was thinking of a few interesting ways to fix this
#
puckipedia
e.g. having a database table that is just a mapping from short IDs to context URIs
#
puckipedia
and then having those short IDs be global, and just import the contexts that each item uses
#
cwebber2
puckipedia: the usual json-ld way is to expand an incoming document, then compact it to your local @context, and use that @context everywhere
#
cwebber2
but it's slightly trickier when @language values are in the context
#
cwebber2
I'm not sure what to do there, but I guess I haven't played with it enough
#
puckipedia
hmmm
#
jaywink
Cwebber2: only a comment I guess re interoperability. Whoever implements AP fully server to server will for me imho show the way. Still waiting for someone to do that.
#
cwebber2
jaywink: :)
#
puckipedia
looks at their ActivityPub server
#
jaywink
puckipedia, link?
#
Loqi
[puckipedia] Kroeg: An ActivityPub server in C#. Also does OStatus for fun.
#
jaywink
Ok. How does kroeg do delivery server to server?
#
puckipedia
I shooould probably change that to send an unflattened object
#
puckipedia
fixed
#
puckipedia
it now unflattens to a depth of 3 before sending the delivery
#
puckipedia
going to bed now, bye
#
jaywink
? yeah.