idea-toolbox
Advanced tools
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) => { |
{ | ||
"name": "idea-toolbox", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "IDEA's utility functions", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
8
21812
470