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

cartodb-redis

Package Overview
Dependencies
Maintainers
17
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cartodb-redis - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

97

lib/carto_metadata.js

@@ -744,4 +744,2 @@ /**

var that = this; // AUTH_FALLBACK
this.getMultipleApikeyParams(username, apikeyToken, apikeyParams, function(err, apikey) {

@@ -752,18 +750,2 @@ if (err) {

// Remove this block when Auth fallback is not used anymore
// AUTH_FALLBACK
if (!isValidApikey(apikey)) {
if (apikeyToken === 'default_public') {
return that.createFauxDefaultApikeyFromUserMetadata(username, callback);
}
return that.getUserMapKey(username, function (err, masterApikeyToken) {
if (masterApikeyToken !== apikeyToken) {
return that.createFauxDefaultApikeyFromUserMetadata(username, callback);
}
return that.createFauxMasterApikeyFromUserMetadata(username, apikeyToken, callback);
});
}
apikey.grantsMaps = (apikey.grantsMaps === 'true');

@@ -783,81 +765,2 @@ apikey.grantsSql = (apikey.grantsSql === 'true');

// DEPRECATED. Used only until Auth fallback in use
// AUTH_FALLBACK
function isValidApikey(apikey) {
return apikey.type !== null &&
apikey.user !== null &&
apikey.databasePassword !== null &&
apikey.databaseRole !== null;
}
// DEPRECATED. Used only until Auth fallback in use
// AUTH_FALLBACK
function addGrantsFieldsToUserMetadataApikeys(apikey) {
apikey.grantsMaps = true;
apikey.grantsSql = true;
return apikey;
}
// DEPRECATED. Used only until Auth fallback in use
// AUTH_FALLBACK
me.createFauxMasterApikeyFromUserMetadata = function (username, apikeyToken, callback) {
var dbParams = {
id: 'user_id',
database_password: 'database_password',
map_key: 'map_key',
database_host: 'dbhost',
database_name: 'dbname'
};
this.getMultipleUserDBParams(username, dbParams, function(err, params){
var apikey = {};
if (err) {
return callback(null, {});
}
if (params.map_key === apikeyToken) {
apikey.user_id = params.user_id;
apikey.databaseRole = null;
apikey.databasePassword = params.database_password;
apikey.user = username;
apikey.type = 'master';
addGrantsFieldsToUserMetadataApikeys(apikey);
}
return callback(null, apikey);
});
};
// DEPRECATED. Used only until Auth fallback in use
// AUTH_FALLBACK
me.createFauxDefaultApikeyFromUserMetadata = function (username, callback) {
var dbParams = {
id: 'user_id',
database_publicuser: 'database_publicuser',
database_host: 'dbhost',
database_name: 'dbname'
};
this.getMultipleUserDBParams(username, dbParams, function (err, params) {
if (err) {
return callback(err);
}
var apikey = {};
apikey.userId = params.id;
apikey.databaseRole = params.database_publicuser;
apikey.databasePassword = null;
apikey.user = username;
apikey.type = 'default';
addGrantsFieldsToUserMetadataApikeys(apikey);
return callback(null, apikey);
});
};
/*******************************************************************************************************************

@@ -864,0 +767,0 @@ * END AUTH

2

package.json
{
"name": "cartodb-redis",
"version": "1.0.0",
"version": "1.0.1",
"main": "./lib/carto_metadata.js",

@@ -5,0 +5,0 @@ "description": "A Node.js based lib to interact with cartodb redis databases",

Sorry, the diff of this file is not supported yet

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