-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
54 lines (54 loc) · 3.08 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
"author": {
"name": "Joyent, Inc"
},
"name": "http-signature",
"description": "Reference implementation of Joyent's HTTP Signature Scheme",
"version": "0.10.0",
"repository": {
"type": "git",
"url": "git://github.com/joyent/node-http-signature.git"
},
"engines": {
"node": ">=0.8"
},
"main": "lib/index.js",
"scripts": {
"test": "tap tst/*.js"
},
"dependencies": {
"assert-plus": "0.1.2",
"asn1": "0.1.11",
"ctype": "0.5.2"
},
"devDependencies": {
"node-uuid": "1.4.0",
"tap": "0.4.2"
},
"readme": "# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actaully want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var key = fs.readFileSync('./key.pem', 'ascii');\n\n var options = {\n host: 'localhost',\n port: 8443,\n path: '/',\n method: 'GET',\n headers: {}\n };\n\n // Adds a 'Date' header in, signs it, and adds the\n // 'Authorization' header in.\n var req = https.request(options, function(res) {\n console.log(res.statusCode);\n });\n\n\n httpSignature.sign(req, {\n key: key,\n keyId: './cert.pem'\n });\n\n req.end();\n\n### Server\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var options = {\n key: fs.readFileSync('./key.pem'),\n cert: fs.readFileSync('./cert.pem')\n };\n\n https.createServer(options, function (req, res) {\n var rc = 200;\n var parsed = httpSignature.parseRequest(req);\n var pub = fs.readFileSync(parsed.keyId, 'ascii');\n if (!httpSignature.verifySignature(parsed, pub))\n rc = 401;\n\n res.writeHead(rc);\n res.end();\n }).listen(8443);\n\n## Installation\n\n npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/joyent/node-http-signature/issues>.\n",
"readmeFilename": "README.md",
"_id": "http-signature@0.10.0",
"dist": {
"shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582",
"tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz"
},
"_from": "http-signature@~0.10.0",
"_npmVersion": "1.2.18",
"_npmUser": {
"name": "mcavage",
"email": "mcavage@gmail.com"
},
"maintainers": [
{
"name": "mcavage",
"email": "mcavage@gmail.com"
}
],
"directories": {},
"_shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582",
"_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"bugs": {
"url": "https://github.com/joyent/node-http-signature/issues"
},
"homepage": "https://github.com/joyent/node-http-signature"
}