Kinto / kinto-signer

Digital signatures to guarantee integrity and authenticity of collections of records.
12 stars 7 forks source link

Package a lib for signature verification with kinto.js #78

Closed leplatrem closed 3 years ago

leplatrem commented 8 years ago

Follow-up of #76

Since the signature verification requires some code to merge the changes, CanonicalJSON.stringify(), jsesc, and a X.509 parser, it would be relevant to package it in a NPM lib:

import validateCollectionSignature from "kinto-signature-verification";

const kinto = new Kinto({
    remote: "https://kinto-reader.dev.mozaws.net/v1",
    bucket: "blocklists"
  });
  const collection = kinto.collection("certificates", { hooks : {
    "incoming-changes": [validateCollectionSignature]
  }});

  collection.sync();

The code for this could live in this repo (subfolder javascript or client) with its own package.json, test suite etc.

The X.509 parser and the canonicaljson probably deserve their own package.

Thoughts?

Natim commented 8 years ago

Agreed

n1k0 commented 8 years ago

Note you can add a package.json file to setup the npm package info in this repository, and add a .npmignore to blacklist all non-package related contents (we shouldn't publish python stuff to npm).