Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase
delete oa.oauth_token_secret
var realm = oa.oauth_realm
delete oa.oauth_realm
delete oa.oauth_transport_method
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
oa.oauth_signature = oauth.sign(
oa.oauth_signature_method,
method,
baseurl,
params,
consumer_secret_or_private_key, // eslint-disable-line camelcase
token_secret // eslint-disable-line camelcase
)
if (realm) {
oa.realm = realm
}
return oa
}
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase
delete oa.oauth_token_secret
var realm = oa.oauth_realm
delete oa.oauth_realm
delete oa.oauth_transport_method
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
oa.oauth_signature = oauth.sign(
oa.oauth_signature_method,
method,
baseurl,
params,
consumer_secret_or_private_key, // eslint-disable-line camelcase
token_secret // eslint-disable-line camelcase
)
if (realm) {
oa.realm = realm
}
return oa
}
oa.oauth_nonce = uuid().replace(/-/g, '')
}
if (!oa.oauth_signature_method) {
oa.oauth_signature_method = 'HMAC-SHA1'
}
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var baseurl = self.uri.protocol + '//' + self.uri.host + self.uri.pathname
var params = self.qsLib.parse([].concat(query, form, self.qsLib.stringify(oa)).join('&'))
var signature = oauth.sign(
oa.oauth_signature_method,
self.method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
var realm = _oauth.realm ? 'realm="' + _oauth.realm + '",' : ''
var authHeader = 'OAuth ' + realm +
Object.keys(oa).sort().map(function (i) {return i + '="' + oauth.rfc3986(oa[i]) + '"'}).join(',')
authHeader += ',oauth_signature="' + oauth.rfc3986(signature) + '"'
self.setHeader('Authorization', authHeader)
return self
}
Request.prototype.jar = function (jar) {
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var realm = oa.oauth_realm
delete oa.oauth_realm
delete oa.oauth_transport_method
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
oa.oauth_signature = oauth.sign(
oa.oauth_signature_method,
method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
if (realm) {
oa.realm = realm
}
return oa
}
oa.oauth_nonce = uuid().replace(/-/g, '')
}
if (!oa.oauth_signature_method) {
oa.oauth_signature_method = 'HMAC-SHA1'
}
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var baseurl = self.uri.protocol + '//' + self.uri.host + self.uri.pathname
var params = self.qsLib.parse([].concat(query, form, self.qsLib.stringify(oa)).join('&'))
var signature = oauth.sign(
oa.oauth_signature_method,
self.method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
var realm = _oauth.realm ? 'realm="' + _oauth.realm + '",' : ''
var authHeader = 'OAuth ' + realm +
Object.keys(oa).sort().map(function (i) {return i + '="' + oauth.rfc3986(oa[i]) + '"'}).join(',')
authHeader += ',oauth_signature="' + oauth.rfc3986(signature) + '"'
self.setHeader('Authorization', authHeader)
return self
}
Request.prototype.jar = function (jar) {
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var realm = oa.oauth_realm
delete oa.oauth_realm
delete oa.oauth_transport_method
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
oa.oauth_signature = oauth.sign(
oa.oauth_signature_method,
method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
if (realm) {
oa.realm = realm
}
return oa
}
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var realm = oa.oauth_realm
delete oa.oauth_realm
delete oa.oauth_transport_method
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
oa.oauth_signature = oauth.sign(
oa.oauth_signature_method,
method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
if (realm) {
oa.realm = realm
}
return oa
}
oa.oauth_nonce = uuid().replace(/-/g, '')
}
if (!oa.oauth_signature_method) {
oa.oauth_signature_method = 'HMAC-SHA1'
}
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var baseurl = self.uri.protocol + '//' + self.uri.host + self.uri.pathname
var params = self.qsLib.parse([].concat(query, form, self.qsLib.stringify(oa)).join('&'))
var signature = oauth.sign(
oa.oauth_signature_method,
self.method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
var realm = _oauth.realm ? 'realm="' + _oauth.realm + '",' : ''
var authHeader = 'OAuth ' + realm +
Object.keys(oa).sort().map(function (i) {return i + '="' + oauth.rfc3986(oa[i]) + '"'}).join(',')
authHeader += ',oauth_signature="' + oauth.rfc3986(signature) + '"'
self.setHeader('Authorization', authHeader)
return self
}
Request.prototype.jar = function (jar) {
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var realm = oa.oauth_realm
delete oa.oauth_realm
delete oa.oauth_transport_method
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
oa.oauth_signature = oauth.sign(
oa.oauth_signature_method,
method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
if (realm) {
oa.realm = realm
}
return oa
}
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var realm = oa.oauth_realm
delete oa.oauth_realm
delete oa.oauth_transport_method
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
oa.oauth_signature = oauth.sign(
oa.oauth_signature_method,
method,
baseurl,
params,
consumer_secret_or_private_key,
token_secret)
if (realm) {
oa.realm = realm
}
return oa
}