oauth-1.0a
Advanced tools
Comparing version 0.1.1 to 0.2.1
@@ -41,2 +41,9 @@ if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') { | ||
break; | ||
case 'HMAC-SHA256': | ||
this.hash = function(base_string, key) { | ||
return CryptoJS.HmacSHA256(base_string, key).toString(CryptoJS.enc.Base64); | ||
}; | ||
break; | ||
case 'PLAINTEXT': | ||
@@ -47,2 +54,3 @@ this.hash = function(base_string, key) { | ||
break; | ||
case 'RSA-SHA1': | ||
@@ -49,0 +57,0 @@ throw new Error('oauth-1.0a does not support this signature method right now. Coming Soon...'); |
{ | ||
"name": "oauth-1.0a", | ||
"version": "0.1.1", | ||
"version": "0.2.1", | ||
"description": "OAuth 1.0a Request Authorization for Node and Browser.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,11 +0,30 @@ | ||
oauth-1.0a | ||
oauth-1.0a ![codeship][codeship-img] | ||
========== | ||
[![NPM version](https://badge.fury.io/js/oauth-1.0a.png)](http://badge.fury.io/js/oauth-1.0a) | ||
[![Dependency Status](https://david-dm.org/ddo/oauth-1.0a.png?theme=shields.io)](https://david-dm.org/ddo/oauth-1.0a) | ||
[![Coverage Status](https://coveralls.io/repos/ddo/oauth-1.0a/badge.png?branch=master)](https://coveralls.io/r/ddo/oauth-1.0a?branch=master) | ||
[![Code Climate](https://codeclimate.com/github/ddo/oauth-1.0a.png)](https://codeclimate.com/github/ddo/oauth-1.0a) | ||
[![version][version-img]][version-url] | ||
[![download][download-img]][download-url] | ||
![codeship](https://www.codeship.io/projects/4388a200-ac85-0131-b0cb-7e8dce60f53f/status) | ||
[![coverage][coverage-img]][coverage-url] | ||
[![climate][climate-img]][climate-url] | ||
[![dependency][dependency-img]][dependency-url] | ||
[codeship-img]: https://www.codeship.io/projects/4388a200-ac85-0131-b0cb-7e8dce60f53f/status | ||
[codeship-url]: https://www.codeship.io/projects/4388a200-ac85-0131-b0cb-7e8dce60f53f/status | ||
[download-img]: https://img.shields.io/npm/dm/oauth-1.0a.svg?style=flat-square | ||
[download-url]: https://www.npmjs.com/package/oauth-1.0a | ||
[version-img]: https://img.shields.io/npm/v/oauth-1.0a.svg?style=flat-square | ||
[version-url]: https://www.npmjs.com/package/oauth-1.0a | ||
[dependency-img]: https://img.shields.io/david/ddo/oauth-1.0a.svg?style=flat-square | ||
[dependency-url]: https://david-dm.org/ddo/oauth-1.0a | ||
[coverage-img]: https://img.shields.io/coveralls/ddo/oauth-1.0a/master.svg?style=flat-square | ||
[coverage-url]: https://coveralls.io/r/ddo/oauth-1.0a?branch=master | ||
[climate-img]: https://img.shields.io/codeclimate/github/ddo/oauth-1.0a.svg?style=flat-square | ||
[climate-url]: https://codeclimate.com/github/ddo/oauth-1.0a | ||
OAuth 1.0a Request Authorization for **Node** and **Browser** | ||
@@ -23,2 +42,3 @@ | ||
* Openbankproject(HMAC-SHA256) | ||
@@ -53,8 +73,14 @@ ## Quick Start | ||
###Browser | ||
Download oauth-1.0a.js [here](https://github.com/ddo/oauth-1.0a/blob/0.1.1/oauth-1.0a.js) | ||
Download oauth-1.0a.js [here](https://raw.githubusercontent.com/ddo/oauth-1.0a/master/oauth-1.0a.js) | ||
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js"></script> | ||
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script> | ||
<script src="oauth-1.0a.js"></script> | ||
```html | ||
<!-- sha1 --> | ||
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js"></script> | ||
<!-- sha256 --> | ||
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha256.js"></script> | ||
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script> | ||
<script src="oauth-1.0a.js"></script> | ||
``` | ||
##Examples | ||
@@ -185,4 +211,35 @@ | ||
##Options | ||
##.authorize(/* options */) | ||
* url: ``String`` | ||
* method: ``String`` default ``'GET'`` | ||
* data: ``Object`` any custom data you want to send with, including extra oauth option ``oauth_*`` as oauth_callback, oauth_version... | ||
```js | ||
var request_data = { | ||
url: 'https://bitbucket.org/api/1.0/oauth/request_token', | ||
method: 'POST', | ||
data: { | ||
oauth_callback: 'http://www.ddo.me' | ||
} | ||
}; | ||
``` | ||
##.toHeader(/* signed data */) | ||
convert signed data into headers | ||
```js | ||
$.ajax({ | ||
url: request_data.url, | ||
type: request_data.method, | ||
data: request_data.data, | ||
headers: oauth.toHeader(oauth.authorize(request_data, token)) | ||
}).done(function(data) { | ||
//process your data here | ||
}); | ||
``` | ||
##Init Options | ||
```js | ||
var oauth = OAuth(/* options */); | ||
@@ -234,5 +291,2 @@ ``` | ||
##Todo | ||
please check my [todo list](https://github.com/ddo/todo) | ||
##[Changelog](https://github.com/ddo/oauth-1.0a/releases) | ||
@@ -239,0 +293,0 @@ |
@@ -11,2 +11,3 @@ ##Core testing | ||
* Bitbucket | ||
* Openbankproject | ||
@@ -29,2 +30,4 @@ ##Setup | ||
* ``BITBUCKET_CONSUMER_SECRET`` | ||
* ``OPENBANK_CONSUMER_PUBLIC`` | ||
* ``OPENBANK_CONSUMER_SECRET`` | ||
@@ -31,0 +34,0 @@ ##Run test |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
640847
40
19882
292
45