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

support secret blobs and add parseBlob #15

Merged
merged 2 commits into from
Apr 20, 2018
Merged

support secret blobs and add parseBlob #15

merged 2 commits into from
Apr 20, 2018

Conversation

mmckegg
Copy link
Contributor

@mmckegg mmckegg commented Apr 13, 2018

This PR adds support for detecting secret blobs using isBlob.

It also adds a new parseBlob export that when given a blob ref, returns an object containing {id, key}.

var ref = require('ssb-ref')
var secretBlob = '&abcdefg6bIh5dmyss7QH7uMrQxz3LKvgjer68we30aQ=.sha256?unbox=abcdefgqAYfzLrychmP5KchZ6JaLHyYv1aYOviDnSZk=.boxs'
ref.parseBlob(secretBlob) // => {
//    id: "&abcdefg6bIh5dmyss7QH7uMrQxz3LKvgjer68we30aQ=.sha256",
//    key: "abcdefgqAYfzLrychmP5KchZ6JaLHyYv1aYOviDnSZk="
//  }

I plan to use this in ssb-mentions and patchcore, rather than using slightly differing hand-rolled implementations that are currently there.

cc @clehner @dominictarr

@dominictarr
Copy link
Contributor

to be honest, I think this is too specific. why not allow any query string on the end of an id?
same suggestion here: ssbc/ssb-mentions#11

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

mmckegg commented Apr 20, 2018

Okay updated this module to match your proposal @dominictarr!

I'm gonna go ahead merge and publish this!

@mmckegg mmckegg merged commit c2938d3 into master Apr 20, 2018
@mmckegg
Copy link
Contributor Author

mmckegg commented Apr 20, 2018

Released as v2.10.0 🎉

@mmckegg
Copy link
Contributor Author

mmckegg commented Apr 20, 2018

I unpublished 2.10.0 and instead submit #16

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.

2 participants