Socket
Socket
Sign inDemoInstall

@ibm-cloud/cloudant

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ibm-cloud/cloudant - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

37

auth/couchdbSessionAuthenticator.js

@@ -83,3 +83,40 @@ "use strict";

CouchdbSessionAuthenticator.prototype.configure = function (userOptions) {
// Merge the options
Object.assign(this.tokenOptions, userOptions);
// START monkey patch for https://github.com/salesforce/tough-cookie/issues/154
// Check if we've already patched the jar
var cookieJar = this.tokenOptions.jar;
if (cookieJar && !cookieJar.cloudantPatch) {
// Set the patching flag
cookieJar.cloudantPatch = true;
// Replace the store's updateCookie function with one that applies a patch to newCookie
var originalUpdateCookieFn_1 = cookieJar.store.updateCookie;
cookieJar.store.updateCookie = function (oldCookie, newCookie, cb) {
// Add current time as an update timestamp to the newCookie
newCookie.cloudantPatchUpdateTime = new Date();
// Replace the cookie's expiryTime function with one that uses cloudantPatchUpdateTime
// in place of creation time to check the expiry.
var originalExpiryTimeFn = newCookie.expiryTime;
newCookie.expiryTime = function (now) {
// The original expiryTime check is relative to a time in this order:
// 1. supplied now argument
// 2. this.creation (original cookie creation time)
// 3. current time
// This patch replaces 2 with an expiry check relative to the cloudantPatchUpdateTime if set instead of
// the creation time by passing it as the now argument.
return originalExpiryTimeFn.call(newCookie, newCookie.cloudantPatchUpdateTime || now);
};
// Finally delegate back to the original update function or the fallback put (which is set by Cookie
// when an update function is not present on the store). Since we always set an update function for our
// patch we need to also provide that fallback.
if (originalUpdateCookieFn_1) {
originalUpdateCookieFn_1.call(cookieJar.store, oldCookie, newCookie, cb);
}
else {
cookieJar.store.putCookie.call(cookieJar.store, newCookie, cb);
}
};
}
// END cookie jar monkey patch
// Set the token manager
this.tokenManager = new sessionTokenManager_1.SessionTokenManager(this.tokenOptions);

@@ -86,0 +123,0 @@ };

2

auth/sessionTokenManager.d.ts
/**
* © Copyright IBM Corporation 2020. All Rights Reserved.
* © Copyright IBM Corporation 2020, 2021. All Rights Reserved.
*

@@ -4,0 +4,0 @@ * Licensed under the Apache License, Version 2.0 (the "License");

"use strict";
/**
* © Copyright IBM Corporation 2020. All Rights Reserved.
* © Copyright IBM Corporation 2020, 2021. All Rights Reserved.
*

@@ -116,3 +116,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

var sessionCookie = tokenResponse.headers['set-cookie'];
if (!(sessionCookie instanceof Array)) {
if (!Array.isArray(sessionCookie)) {
var err = 'Set-Cookie header not present in response';

@@ -119,0 +119,0 @@ throw new Error(err);

{
"name": "@ibm-cloud/cloudant",
"version": "0.0.16",
"version": "0.0.17",
"description": "IBM Cloudant Node.js SDK",

@@ -36,3 +36,3 @@ "main": "index.js",

"dependencies": {
"@types/node": "^15.0.1",
"@types/node": "^16.0.0",
"extend": "^3.0.2",

@@ -39,0 +39,0 @@ "ibm-cloud-sdk-core": "~2.11.0"

@@ -5,3 +5,3 @@ [![Build Status](https://travis-ci.com/IBM/cloudant-node-sdk.svg?branch=master)](https://travis-ci.com/IBM/cloudant-node-sdk)

# IBM Cloudant Node.js SDK Version 0.0.16
# IBM Cloudant Node.js SDK Version 0.0.17

@@ -8,0 +8,0 @@ IBM Cloudant Node.js SDK is a client library that interacts with the

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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