From adc694ee2517798db44dd476b34873fcd6de0ae4 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 3 Feb 2015 11:18:28 -0500 Subject: [PATCH 1/3] Removed post install action that requires devDependencies. Closes #35 --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index d62879c..fa51370 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ ], "scripts": { "make-dist": "sh scripts/make-dist.sh", - "postinstall": "npm run make-dist", "test": "mocha test/*.js --reporter spec" }, "main": "index.js", From dbac5e82610de72cc5361fa466e03d0ea6a76d39 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 3 Feb 2015 11:45:52 -0500 Subject: [PATCH 2/3] Include a basic getting started in the readme for making a browser bundle. --- README.md | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1c450d1..a9dc7fa 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,28 @@ BitAuth Passwordless authentication using Bitcoin cryptography -# Overview +## Overview BitAuth is a way to do secure, passwordless authentication using the cryptography in Bitcoin. Instead of using a shared secret, the client signs each request using a private key and the server checks to make sure the signature is valid and matches the public key. +## Getting started + +Install with Node.js: + +```bash +npm install bitauth +``` + +To generate a browser bundle, you can then run: + +```bash +npm run make-dist +``` + + ## Advantages over other authentication mechanisms * By signing each request, man in the middle attacks are impossible. @@ -73,11 +88,9 @@ a decentralized blockchain or datastore like namecoin. Key revocations could be stored here as well as reviews/feedback to build a reputation around an identity. -# Getting Started +## Examples -Example server - -``` +```javascript var express = require('express'); var bodyParser = require('body-parser'); var rawBody = require('../lib/middleware/rawbody'); @@ -117,7 +130,7 @@ app.listen(3000); Example client -``` +```javascript var request = require('request'); var bitauth = require('../lib/bitauth'); @@ -181,7 +194,7 @@ for(k in keys) { ## Middleware BitAuth exposes a connect middleware for use in connect or ExpressJS applications. Use: -``` +```javascript var bitauth = require('bitauth'); app.use( bitauth.middleware ); ``` @@ -190,7 +203,7 @@ app.use( bitauth.middleware ); To build a browser compatible version of BitAuth, run the following command from the project's root directory: -``` +```bash npm run make-dist ``` From 5ee1c32688fe5d6f4ca72838ad17c24262a89cf8 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 3 Feb 2015 11:50:12 -0500 Subject: [PATCH 3/3] Add server example text --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a9dc7fa..6f68caf 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ identity. ## Examples +Example server + ```javascript var express = require('express'); var bodyParser = require('body-parser');