Identity
- manages users
- registers
- authorizes
- autenticates
- distributes tokens
API
Classes
Functions
- aclResolver(aclObject, [groupTree], [glue]) ⇒
Map.<string, Set.<string>>
Typedefs
- Group :
Object
AuthService
Kind: global class
- AuthService
- new AuthService(getUserByIdFn, [tokenStorage], [options], [appsProvider])
- .expressMiddleware() ⇒
function
- .createUserToken(userId, domain) ⇒
Promise.<Object>
- .createPasswordResetToken(userId) ⇒
Promise
- .getAndRemovePasswordResetToken(token) ⇒
Promise.<(Object|null)>
- .createToken(type, [userIdOrGroups], [options], [length]) ⇒
Promise
- .getToken(type, token) ⇒
Promise.<(Object|null)>
- .dropToken(token) ⇒
Promise
- .createUserAccessor([userGroups], [userId]) ⇒
UserAccessor
new AuthService(getUserByIdFn, [tokenStorage], [options], [appsProvider])
Creates an instance of AuthService
Param | Type | Default |
---|---|---|
getUserByIdFn | function |
|
[tokenStorage] | TokenStorage |
|
[options] | Object |
{} |
options.acl | Object |
|
options.groups | Object |
|
options.tokenFactory | function |
|
[options.passwordReset] | Object |
|
[options.passwordReset.tokenExpiresInMinutes] | number |
|
options.superGroup | string |
|
options.adminGroups | Array.<string> |
|
[options.cookieKey] | string |
|
[options.signed] | boolean |
|
[options.tokenType] | string |
|
[appsProvider] | Map.<string, (Object|Promise.<Object>)> |
new Map() |
function
authService.expressMiddleware() ⇒ Kind: instance method of AuthService
Promise.<Object>
authService.createUserToken(userId, domain) ⇒ Kind: instance method of AuthService
Param | Default |
---|---|
userId | |
domain |
|
Promise
authService.createPasswordResetToken(userId) ⇒ Kind: instance method of AuthService
Param | Type |
---|---|
userId | string |
Promise.<(Object|null)>
authService.getAndRemovePasswordResetToken(token) ⇒ Kind: instance method of AuthService
Param | Type |
---|---|
token | string |
Promise
authService.createToken(type, [userIdOrGroups], [options], [length]) ⇒ Kind: instance method of AuthService
Param | Type | Default |
---|---|---|
type | string |
|
[userIdOrGroups] | string |
null |
[options] | Object |
|
[length] | number |
Promise.<(Object|null)>
authService.getToken(type, token) ⇒ Kind: instance method of AuthService
Param | Type |
---|---|
type | string |
token | string |
Promise
authService.dropToken(token) ⇒ Kind: instance method of AuthService
Param | Type |
---|---|
token | string |
UserAccessor
authService.createUserAccessor([userGroups], [userId]) ⇒ Kind: instance method of AuthService
Param | Type | Default |
---|---|---|
[userGroups] | Array.<Group> |
[] |
[userId] | string |
null |
Authorizator
new Authorizator(aclList, [superGroup])
Creates an instance of Authorizator.
Param | Type |
---|---|
aclList | Map.<String, Set.<String>> |
[superGroup] | string |
UsersService
Kind: global class
- UsersService
- new UsersService(userStorage, [config], [formatter])
- .storage :
MongoDbUserStorage
new UsersService(userStorage, [config], [formatter])
Param | Type | Description |
---|---|---|
userStorage | * |
|
[config] | Object |
|
[config.superGroup] | string |
|
[config.adminGroups] | Array.<string> |
|
[formatter] | function |
user formatter |
MongoDbUserStorage
usersService.storage : Kind: instance property of UsersService
UserAccessor
Kind: global class
new UserAccessor(userGroups, [byUserId], [superGroup], [adminGroups])
Param | Type | Default |
---|---|---|
userGroups | Array.<Group> |
|
[byUserId] | string |
null |
[superGroup] | string |
null |
[adminGroups] | Array.<string> |
|
userAccessor.setUser([userGroups], [byUserId])
Kind: instance method of UserAccessor
Param | Type | Default |
---|---|---|
[userGroups] | Array.<Group> |
|
[byUserId] | string |
null |
boolean
userAccessor.isMe([userId]) ⇒ Kind: instance method of UserAccessor
Param | Type |
---|---|
[userId] | string |
boolean
userAccessor.isRelated(groups) ⇒ Kind: instance method of UserAccessor
Param | Type |
---|---|
groups | Array.<Group> |
boolean
userAccessor.isAdministrable(groups) ⇒ Kind: instance method of UserAccessor
Param | Type |
---|---|
groups | Array.<Group> |
Array.<Group>
userAccessor.filterGroups(groupList, personId, [justManageable]) ⇒ Kind: instance method of UserAccessor
Param | Type | Default |
---|---|---|
groupList | Array.<Group> |
|
personId | string |
|
[justManageable] | boolean |
false |
Map.<string, Set.<string>>
aclResolver(aclObject, [groupTree], [glue]) ⇒ Kind: global function
Param | Type | Default |
---|---|---|
aclObject | any |
|
[groupTree] | any |
|
[glue] | string |
"'.'" |
Object
Group : Kind: global typedef Properties
Name | Type |
---|---|
group | string |
domain | string |