Plain user functionality in service methods.
- License:
- MIT
- Source:
Methods
(inner) addDomain(domainname) → {Promise}
Add blacklisted domain.
Parameters:
Name | Type | Description |
---|---|---|
domainname |
string | Domain name |
- Source:
Returns:
array with domain added or error
- Type
- Promise
(inner) checkDomain(domainname) → {Promise}
Check for registered blacklisted domain.
Parameters:
Name | Type | Description |
---|---|---|
domainname |
string | Domain name |
- Source:
Returns:
domain object or null or error
- Type
- Promise
(inner) checkUser(name, passwd) → {Promise}
Check login data for user.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | user name |
passwd |
string | clear text password from web form |
- Source:
Returns:
object of athenticated user or error
- Type
- Promise
(inner) createUser(user) → {Promise}
Creates an user entry in database.
Parameters:
Name | Type | Description |
---|---|---|
user |
string | json user object |
- Source:
Returns:
object of created user
- Type
- Promise
(inner) deleteDomain(domainname) → {Promise}
Delete one registered blacklisted domain.
Parameters:
Name | Type | Description |
---|---|---|
domainname |
string | Domain name |
- Source:
Returns:
OK or error
- Type
- Promise
(inner) deleteUser(idUser) → {Promise}
Delete one user from database.
Parameters:
Name | Type | Description |
---|---|---|
idUser |
string | the id of the user object |
- Source:
Returns:
object of user entry for the very last time
- Type
- Promise
(inner) getLogauth() → {Promise}
List logauth.
- Source:
Returns:
array of logauth entries or error
- Type
- Promise
(inner) getUser(name) → {Promise}
Show userdata of given name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | user name in database |
- Source:
Returns:
object with user data or error
- Type
- Promise
(inner) hasRole(uname, aRoles) → {Promise}
Check if user has one of the wanted roles.
Parameters:
Name | Type | Description |
---|---|---|
uname |
string | user login name |
aRoles |
string | Array of strings |
- Source:
Returns:
true or error
- Type
- Promise
(inner) isActiveHasRole(uname, aRoles) → {Promise}
Check if active user has one of the wanted roles.
Parameters:
Name | Type | Description |
---|---|---|
uname |
string | user login name |
aRoles |
string | Array of strings |
- Source:
Returns:
boolean or error
- Type
- Promise
(inner) isActiveUser(uname) → {Promise}
Check if user is activated.
Parameters:
Name | Type | Description |
---|---|---|
uname |
string | user login name |
- Source:
Returns:
true or error
- Type
- Promise
(inner) listDomains() → {Promise}
List all registered blacklisted domain.
- Source:
Returns:
array of domain entries or error
- Type
- Promise
(inner) listUser(id) → {Promise}
Show userdata of given id.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | user id in database |
- Source:
Returns:
object with user data or error
- Type
- Promise
(inner) listUsers() → {Promise}
List all registered users.
- Source:
Returns:
array of user entries or error
- Type
- Promise
(inner) logAuthExpired(uname, myremoteip, myvalidity) → {Promise}
Store expired auth via JWT.
Parameters:
Name | Type | Description |
---|---|---|
uname |
string | user login name |
myremoteip |
string | Array of strings |
myvalidity |
number | Timestamp in epoch seconds until when JWT is valid |
- Source:
Returns:
true or error
- Type
- Promise
(inner) logAuthFailure(uname, remoteip) → {Promise}
Store invalid auth via JWT.
Parameters:
Name | Type | Description |
---|---|---|
uname |
string | user login name |
remoteip |
string | Array of strings |
- Source:
Returns:
true
- Type
- Promise
(inner) logAuthSuccess(uname, myremoteip, myvalidity) → {Promise}
Store valid auth via JWT.
Parameters:
Name | Type | Description |
---|---|---|
uname |
string | user login name |
myremoteip |
string | Remote IP in IPv4 or IPv6 format, who knows |
myvalidity |
number | Timestamp in epoch seconds until when JWT is valid |
- Source:
Returns:
true or error
- Type
- Promise
(inner) patchUser(idUser, jpatch) → {Promise}
Change user data by json patch request.
Parameters:
Name | Type | Description |
---|---|---|
idUser |
string | id of user in database |
jpatch |
string | json patch data |
- Source:
Returns:
object of updated user data or error
- Type
- Promise
(inner) putUserStatus(id, newStatus) → {Promise}
Update user entry with new status
Parameters:
Name | Type | Description |
---|---|---|
id |
string | user id in database |
newStatus |
string | user status to change to |
- Source:
Returns:
updated user object or error
- Type
- Promise