Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nfriedly/slsignpagedata
node.js module to sign RondavuData in the correct format for Sociable Labs's widgets
https://github.com/nfriedly/slsignpagedata
Last synced: 17 days ago
JSON representation
node.js module to sign RondavuData in the correct format for Sociable Labs's widgets
- Host: GitHub
- URL: https://github.com/nfriedly/slsignpagedata
- Owner: nfriedly
- Created: 2012-12-11T22:09:58.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-05T19:41:38.000Z (almost 12 years ago)
- Last Synced: 2024-10-12T16:15:05.745Z (about 1 month ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
SLSignPageData
==============Node.js module to sign page data (RondavuData) for use with Sociable Labs's widgets. More information about these widgets
avaliable at http://sociablelabs.comInstallation
------------npm install SLSignPageData
Usage
-----
var fs = require('fs');
var SLSignPageData = require('slsignpagedata');
var privateKey = fs.readFileSync('./sign_private_key').toString();
SLSignPageData.setPrivateKey(privateKey);var RondavuData = {config:{version:"1.2"}, page: .....
SLSignPageData.signPageData(RondavuData);console.log(JSON.stringify(RondavuData));
API
-----**signPageData(RondavuData, [privateKey=null, [fieldsToSign=['page','user','primary_mo','mos']]])**
Modifies and returns the signed RondavuData object with the keys specified by `fieldsToSign`
converted to Base64 and a `signature` field added and populated. If no `privateKey` is given,
the global one supplied to `setPrivateKey()` will be used.**setPrivateKey(privateKey)**
Accepts a string `privateKey` - this should be the contents of the `sign_private_key` supplied
by Sociable Labs. This becomes the default private key used by the other methods unless you
supply one.**signField(base64Data, [privateKey=null])**
Returns the signature for a single field. This method is used internally by `signPageData()`.
MIT License
-----Copyright (c) 2013 Nathan Friedly - http://nfriedly.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.