New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0.11 to 1.0.12

45

index.js

@@ -11,6 +11,6 @@ const AWS = require('aws-sdk');

getUserIdFromRequest(request) {
return request.apiGateway.event.requestContext.identity.cognitoAuthenticationProvider.split(':').pop();
return request.apiGateway.event.requestContext.identity.cognitoAuthenticationProvider.split(':').pop();
}
async getUser(userId){
async getUser(userId) {
const listUsersResponse = await this.cognitoidentityserviceprovider.listUsers({

@@ -23,3 +23,42 @@ UserPoolId: this.authIntegrationUserPoolId,

}
async getUsers(paginationToken, pageSize) {
const request = {
UserPoolId: this.authIntegrationUserPoolId,
Limit: pageSize
}
if (paginationToken) {
request.PaginationToken = paginationToken
}
const response = await this.cognitoidentityserviceprovider.listUsers(request).promise();
return {
paginationToken: response.PaginationToken,
users: response.Users
}
}
async isAdmin(userId) {
const groups = await this.cognitoidentityserviceprovider.adminListGroupsForUser({
UserPoolId: this.authIntegrationUserPoolId,
Username: userId,
Limit: 10
}).promise();
if (!groups)
return false
if (groups.err) {
console.log(groups.err)
return false
}
if (!groups.data)
return false
return groups.data.Groups.filter(x => x.GroupName === "SenterAdmin").length === 1
}
updateUserAttributes = async (userId, attributeName, attributeValue) => {

@@ -26,0 +65,0 @@

20

package.json
{
"name": "aws-user-service",
"version": "1.0.11",
"description": "Contain methods to work with asw user",
"main": "index.js",
"scripts": {
"test": "npm test"
},
"author": "DM",
"license": "ISC",
"dependencies": {}
"name": "aws-user-service",
"version": "1.0.12",
"description": "Contain methods to work with asw user",
"main": "index.js",
"scripts": {
"test": "npm test"
},
"author": "Senter",
"license": "ISC",
"dependencies": {}
}
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