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

idea-toolbox

Package Overview
Dependencies
Maintainers
1
Versions
377
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idea-toolbox - npm Package Compare versions

Comparing version 0.8.8 to 0.8.9

20

index.js

@@ -13,2 +13,6 @@ 'use strict';

const COGNITO_USER_POOL_ID = process.env['COGNITO_USER_POOL_ID'];
const COGNITO_ACCESS_KEY_ID = process.env['COGNITO_ACCESS_KEY_ID'];
const COGNITO_SECRET_ACCESS_KEY = process.env['COGNITO_SECRET_ACCESS_KEY'];
const S3_DEFAULT_DOWNLOAD_BUCKET = 'idea-downloads';

@@ -210,3 +214,8 @@ const S3_DEFAULT_DOWNLOAD_BUCKET_PREFIX = 'common';

*/
function cognitoGetUserByEmail(AWS, accessKeyId, secretAccessKey, cognitoUserPoolId, email, cb) {
function cognitoGetUserByEmail(email, cb, accessKeyId, secretAccessKey, cognitoUserPoolId) {
// read the parameters from env. var or force them
accessKeyId = accessKeyId || COGNITO_ACCESS_KEY_ID;
secretAccessKey = secretAccessKey || COGNITO_SECRET_ACCESS_KEY;
cognitoUserPoolId = cognitoUserPoolId || COGNITO_USER_POOL_ID;
// find the user by the email
new AWS.CognitoIdentityServiceProvider({

@@ -218,2 +227,3 @@ apiVersion: '2016-04-18', accessKeyId: accessKeyId, secretAccessKey: secretAccessKey

if(err || !data || !data.Users || !data.Users[0]) return cb();
// convert and return the attributes
let userAttributes = [];

@@ -228,3 +238,8 @@ data.Users[0].Attributes.forEach(a => userAttributes[a.Name] = a.Value);

*/
function cognitoGetUserBySub(AWS, accessKeyId, secretAccessKey, cognitoUserPoolId, sub, cb) {
function cognitoGetUserBySub(sub, cb, accessKeyId, secretAccessKey, cognitoUserPoolId) {
// read the parameters from env. var or force them
accessKeyId = accessKeyId || COGNITO_ACCESS_KEY_ID;
secretAccessKey = secretAccessKey || COGNITO_SECRET_ACCESS_KEY;
cognitoUserPoolId = cognitoUserPoolId || COGNITO_USER_POOL_ID;
// find the user by the sub
new AWS.CognitoIdentityServiceProvider({

@@ -236,2 +251,3 @@ apiVersion: '2016-04-18', accessKeyId: accessKeyId, secretAccessKey: secretAccessKey

if(err || !data || !data.Users || !data.Users[0]) return cb();
// convert and return the attributes
let userAttributes = [];

@@ -238,0 +254,0 @@ data.Users[0].Attributes.forEach(a => userAttributes[a.Name] = a.Value);

2

package.json
{
"name": "idea-toolbox",
"version": "0.8.8",
"version": "0.8.9",
"description": "IDEA's utility functions",

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

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