Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
user: randStr,
password: 'Example12#',
permission: USER_PERMISSION.READ_ONLY,
database: 'defaultdb',
}
const createUserRes = await cl.createUser(createUserReq)
console.log('success: createUser', createUserRes);
const listUsersRes = await cl.listUsers()
console.log('success: listUser', util.inspect(listUsersRes, false, 6, true))
const changePermissionReq: Parameters.ChangePermission = {
action: USER_ACTION.GRANT,
username: randStr,
database: randStr,
permission: USER_PERMISSION.READ_WRITE,
}
const changePermissionRes = await cl.changePermission(changePermissionReq)
console.log('success: changePermission', changePermissionRes);
const changePasswordReq: Parameters.ChangePassword = {
user: randStr,
oldpassword: 'Example12#',
newpassword: 'Example1234%',
}
const changePasswordRes = await cl.changePassword(changePasswordReq)
console.log('success: changePassword', changePasswordRes);
const setActiveUserReq: Parameters.SetActiveUser = {
username: randStr,
active: true,
}