Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oauth-1.0a

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauth-1.0a - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

test/oauth_body_hash.js

21

oauth-1.0a.js

@@ -81,2 +81,6 @@ if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') {

if(request.includeBodyHash) {
oauth_data.oauth_body_hash = this.getBodyHash(request, token.secret)
}
oauth_data.oauth_signature = this.getSignature(request, token.secret, oauth_data);

@@ -99,2 +103,12 @@

/**
* Create a OAuth Body Hash
* @param {Object} request data
*/
OAuth.prototype.getBodyHash = function(request, token_secret) {
var body = typeof request.data === 'string' ? request.data : JSON.stringify(request.data)
return this.hash_function(body, this.getSigningKey(token_secret))
};
/**
* Base String = Method + Base Url + ParameterString

@@ -120,3 +134,8 @@ * @param {Object} request data

OAuth.prototype.getParameterString = function(request, oauth_data) {
var base_string_data = this.sortObject(this.percentEncodeData(this.mergeObject(oauth_data, this.mergeObject(request.data, this.deParamUrl(request.url)))));
var base_string_data;
if (oauth_data.oauth_body_hash) {
base_string_data = this.sortObject(this.percentEncodeData(this.mergeObject(oauth_data, this.deParamUrl(request.url))));
} else {
base_string_data = this.sortObject(this.percentEncodeData(this.mergeObject(oauth_data, this.mergeObject(request.data, this.deParamUrl(request.url)))));
}

@@ -123,0 +142,0 @@ var data_str = '';

2

package.json
{
"name": "oauth-1.0a",
"version": "2.0.0",
"version": "2.1.0",
"description": "OAuth 1.0a Request Authorization for Node and Browser.",

@@ -5,0 +5,0 @@ "scripts": {

@@ -276,2 +276,3 @@ oauth-1.0a ![semaphore][semaphore-img]

* data: ``Object`` any custom data you want to send with, including extra oauth option ``oauth_*`` as oauth_callback, oauth_version...
* includeBodyHash: ``Boolean`` default ``false`` set to true if you want ``oauth_body_hash`` signing

@@ -278,0 +279,0 @@ ```js

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc