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.4.0 to 1.5.0

45

index.js
const MongoRepository = require('senter-mongo-repository')
const AWS = require('aws-sdk')
AWS.config.update({ region: process.env.REGION })
AWS.config.update({region: process.env.REGION})
var noOrganisationOptions = MongoRepository.BuildCallOptions(true, false)
module.exports = class AwsUserService {
constructor(authIntegrationUserPoolId, userRepository) {
this.authIntegrationUserPoolId = authIntegrationUserPoolId
constructor(userPoolId, userRepository) {
this.userPoolId = userPoolId
this.userRepository = userRepository

@@ -51,3 +51,3 @@ this.cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider()

const listUsersResponsePromise = this.cognitoidentityserviceprovider.listUsers({
UserPoolId: this.authIntegrationUserPoolId,
UserPoolId: this.userPoolId,
Filter: `sub = "${userId}"`,

@@ -61,4 +61,5 @@ Limit: 1

const cognitoUser = result[0].Users[0]
if (result[1]) {
cognitoUser.organisationId = result[1].organisationId
const senterUser = result[1]
if (senterUser) {
cognitoUser.organisationId = senterUser.organisationId
}

@@ -71,3 +72,3 @@ cognitoUser.id = userId

const request = {
UserPoolId: this.authIntegrationUserPoolId,
UserPoolId: this.userPoolId,
Filter: `email ^= "${partialEmail}"`,

@@ -91,3 +92,3 @@ Limit: pageSize

const request = {
UserPoolId: this.authIntegrationUserPoolId,
UserPoolId: this.userPoolId,
Limit: pageSize

@@ -110,3 +111,3 @@ }

const cognitoResponse = await this.cognitoidentityserviceprovider.adminListGroupsForUser({
UserPoolId: this.authIntegrationUserPoolId,
UserPoolId: this.userPoolId,
Username: userId,

@@ -143,6 +144,28 @@ Limit: 10

"Username": userId,
"UserPoolId": this.authIntegrationUserPoolId
"UserPoolId": this.userPoolId
}
return await this.cognitoidentityserviceprovider.adminUpdateUserAttributes(params).promise()
}
}
async disableUser(userId) {
const params = {
UserPoolId: this.userPoolId,
Username: userId
}
const response = await this.cognitoidentityserviceprovider.adminDisableUser(params)
if (response.error) {
throw response.error
}
}
async enableUser(userId) {
const params = {
UserPoolId: this.userPoolId,
Username: userId
}
const response = await this.cognitoidentityserviceprovider.adminEnableUser(params)
if (response.error) {
throw response.error
}
}
}
{
"name": "aws-user-service",
"version": "1.4.0",
"version": "1.5.0",
"description": "Contain methods to work with asw user",

@@ -14,2 +14,2 @@ "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