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.9.2 to 0.9.3

22

index.js

@@ -15,4 +15,2 @@ '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'];

@@ -225,15 +223,9 @@ const S3_DEFAULT_DOWNLOAD_BUCKET = 'idea-downloads';

* @param {*} cb (err, data) => {}
* @param {string} accessKeyId of a user w/ permissions in the specified user pool
* @param {string} secretAccessKey of a user w/ permissions in the specified user pool
* @param {string} cognitoUserPoolId Cognito user pool
*/
function cognitoGetUserByEmail(email, cb, accessKeyId, secretAccessKey, cognitoUserPoolId) {
function cognitoGetUserByEmail(email, cb, 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({
apiVersion: '2016-04-18', accessKeyId: accessKeyId, secretAccessKey: secretAccessKey
})
new AWS.CognitoIdentityServiceProvider({ apiVersion: '2016-04-18' })
.listUsers({ UserPoolId: cognitoUserPoolId, Filter: `email = "${email}"`, Limit: 1},

@@ -253,15 +245,9 @@ (err, data) => {

* @param {*} cb (err, data) => {}
* @param {string} accessKeyId of a user w/ permissions in the specified user pool
* @param {string} secretAccessKey of a user w/ permissions in the specified user pool
* @param {string} cognitoUserPoolId Cognito user pool
*/
function cognitoGetUserBySub(sub, cb, accessKeyId, secretAccessKey, cognitoUserPoolId) {
function cognitoGetUserBySub(sub, cb, 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({
apiVersion: '2016-04-18', accessKeyId: accessKeyId, secretAccessKey: secretAccessKey
})
new AWS.CognitoIdentityServiceProvider({ apiVersion: '2016-04-18' })
.listUsers({ UserPoolId: cognitoUserPoolId, Filter: `sub = "${sub}"`, Limit: 1},

@@ -268,0 +254,0 @@ (err, data) => {

2

package.json
{
"name": "idea-toolbox",
"version": "0.9.2",
"version": "0.9.3",
"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