Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mentions for secret blobs #11

Merged
merged 5 commits into from
Apr 20, 2018
Merged

mentions for secret blobs #11

merged 5 commits into from
Apr 20, 2018

Conversation

mmckegg
Copy link
Contributor

@mmckegg mmckegg commented Apr 13, 2018

@dominictarr's secret blobs proposal adds a query string onto the end of a blob ID containing the unbox key. These are not able to be detected by the mentions checker and so never get added to the msg.value.content.mentions array.

This PR fixes it by instead checking to see if the ID starts with a & and then assumes it is a blob. I did it this way because it was the same way @dominictarr did it ssbc/patchcore#50

I'm a little worried that we are veering of the "spec" established by ssb-ref here. Should we just update ssb-ref instead to be able to handle blob unbox in the id?

Thoughts?

cc @mixmix @clehner @ahdinosaur et el

@mmckegg
Copy link
Contributor Author

mmckegg commented Apr 13, 2018

@clehner has already started work on this on git-ssb:

https://git.scuttlebot.io/%258%2BwcXeBD0H3Xv%2FoHJfhJ1mU4iryhhrztgdQBP77IRqA%3D.sha256/commits

It's a much better implementation that splits out the unbox= into key.

@mmckegg
Copy link
Contributor Author

mmckegg commented Apr 13, 2018

I just updated this PR to bring it in line with what @clehner's PR does, except that it uses an updated version of ssb-ref that knows how to parse secret blob refs.

@dominictarr
Copy link
Contributor

what if we interpret this not as a special case, but rather that ssb objects (msgs, feeds, blobs) can come with parameters that represent "hints" about how that link should be interpreted?

so, maybe it should parse to {name: name, link: link, query: { unbox: ... }} because that will preserve the structure rather than handling the key as a special case. I intend to implement a similar way to pass a id with a key, except for messages (this will be part of the private-groups system) I can also think of other things I could represent as "part of a message" like maybe you could refer to a file within a git blob? or a quote inside a message? i think if we preserve the structure of the query parameters it will stay flexible.

@dominictarr
Copy link
Contributor

btw, I have been working on the ability to share a key to a encrypted message. This makes private messages into a capability system - you can create a private message, then reveal it later, or show it to another person. This is how I plan to implement private groups - create a new private message with the group key, then add more people to it.

auditdrivencrypto/private-box@9849289

(a particular message is the root, because I want it to always be explicit that you are adding someone to a group. it should not be possible to create a group that just happens to have the same key as another group_)

This is related because it points towards needing a generic way to handle the passing a link with a decryption key.

@mmckegg
Copy link
Contributor Author

mmckegg commented Apr 19, 2018

@dominictarr

Just saw this now. Yes I like this proposal {name: name, link: link, query: { unbox: ... }}.

Would you like me to update this PR (and ssbc/ssb-ref#15), or are you keen to implement yourself?

@ahdinosaur
Copy link

👍 on {name: name, link: link, query: { unbox: ... }}

mmckegg added a commit to ssbc/ssb-ref that referenced this pull request Apr 20, 2018
@mmckegg
Copy link
Contributor Author

mmckegg commented Apr 20, 2018

Latest push adds query parsing to all ID mentions. You can now have a %msgId?unbox=somecode&more=things and it will get added as:

mentions: [{ 
  link: '%msgId', 
  query: {
    unbox: 'somecode', 
    more: 'things'
  }
}]

Shall I merge? Depends on ssbc/ssb-ref#16

cc @dominictarr

@mmckegg
Copy link
Contributor Author

mmckegg commented Apr 20, 2018

Okay, I'm gonna merge!!

@mmckegg mmckegg merged commit 3d7451e into master Apr 20, 2018
mmckegg added a commit to ssbc/patchwork that referenced this pull request Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants