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

aws-user-service

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-user-service - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

40

index.js

@@ -10,4 +10,19 @@ const AWS = require('aws-sdk');

extractUserIdFromRequest(request) {
return request.apiGateway.event.requestContext.identity.cognitoAuthenticationProvider.split(':').pop()
}
getUserIdFromRequest(request) {
return request.apiGateway.event.requestContext.identity.cognitoAuthenticationProvider.split(':').pop();
const realUserId = extractUserIdFromRequest(request)
if (!request.query.impersonatingUserId) {
return realUserId
}
// check if current user is Admin
if (await this.isAdmin(realUserId) === true) {
// return impersonating user id
return request.query.impersonatingUserId
}
throw new Error('Non admin attempt to impersonate');
}

@@ -86,10 +101,2 @@

async impersonateUser(userId, user) {
}
async removeImpersonation(userId) {
//await updateUserAttributes(userId, )
}
async updateUserAttributes(userId, attributeName, attributeValue) {

@@ -109,17 +116,2 @@

}
async updateUserAttributes(userId, attributeName, attributeValue) {
var params = {
"UserAttributes": [
{
"Name": attributeName,
"Value": attributeValue
}
],
"Username": userId,
"UserPoolId": this.authIntegrationUserPoolId
}
return await this.cognitoidentityserviceprovider.adminUpdateUserAttributes(params).promise()
}
}

2

package.json
{
"name": "aws-user-service",
"version": "1.1.0",
"version": "1.1.1",
"description": "Contain methods to work with asw user",

@@ -5,0 +5,0 @@ "main": "index.js",

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