0.7.3 • Published 7 years ago

prg-identity v0.7.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Identity

  • manages users
  • registers
  • authorizes
  • autenticates
  • distributes tokens

API

Classes

Functions

Typedefs

AuthService

Kind: global class

new AuthService(getUserByIdFn, tokenStorage, options, appsProvider)

Creates an instance of AuthService

ParamTypeDefault
getUserByIdFnfunction
tokenStorageTokenStorage
optionsObject{}
options.aclObject
options.groupsObject
options.tokenFactoryfunction
options.passwordResetObject
options.passwordReset.tokenExpiresInMinutesnumber
options.superGroupstring
options.adminGroupsArray.<string>
options.cookieKeystring
options.signedboolean
options.tokenTypestring
appsProviderMap.<string, (Object|Promise.<Object>)>new Map()

authService.expressMiddleware() ⇒ function

Kind: instance method of AuthService

authService.createUserToken(userId, domain) ⇒ Promise.<Object>

Kind: instance method of AuthService

ParamDefault
userId
domain

authService.createPasswordResetToken(userId) ⇒ Promise

Kind: instance method of AuthService

ParamType
userIdstring

authService.getAndRemovePasswordResetToken(token) ⇒ Promise.<(Object|null)>

Kind: instance method of AuthService

ParamType
tokenstring

authService.createToken(type, userIdOrGroups, options, length) ⇒ Promise

Kind: instance method of AuthService

ParamTypeDefault
typestring
userIdOrGroupsstringnull
optionsObject
lengthnumber

authService.getToken(type, token) ⇒ Promise.<(Object|null)>

Kind: instance method of AuthService

ParamType
typestring
tokenstring

authService.dropToken(token) ⇒ Promise

Kind: instance method of AuthService

ParamType
tokenstring

authService.createUserAccessor(userGroups, userId) ⇒ UserAccessor

Kind: instance method of AuthService

ParamTypeDefault
userGroupsArray.<Group>[]
userIdstringnull

Authorizator

Kind: global class

new Authorizator(aclList, superGroup)

Creates an instance of Authorizator.

ParamType
aclListMap.<String, Set.<String>>
superGroupstring

UsersService

Kind: global class

new UsersService(userStorage, config, formatter)

ParamTypeDescription
userStorage*
configObject
config.superGroupstring
config.adminGroupsArray.<string>
formatterfunctionuser formatter

usersService.storage : MongoDbUserStorage

Kind: instance property of UsersService

UserAccessor

Kind: global class

new UserAccessor(userGroups, byUserId, superGroup, adminGroups)

ParamTypeDefault
userGroupsArray.<Group>
byUserIdstringnull
superGroupstringnull
adminGroupsArray.<string>

userAccessor.setUser(userGroups, byUserId)

Kind: instance method of UserAccessor

ParamTypeDefault
userGroupsArray.<Group>
byUserIdstringnull

userAccessor.isMe(userId) ⇒ boolean

Kind: instance method of UserAccessor

ParamType
userIdstring

userAccessor.isRelated(groups) ⇒ boolean

Kind: instance method of UserAccessor

ParamType
groupsArray.<Group>

userAccessor.isAdministrable(groups) ⇒ boolean

Kind: instance method of UserAccessor

ParamType
groupsArray.<Group>

userAccessor.filterGroups(groupList, personId, justManageable) ⇒ Array.<Group>

Kind: instance method of UserAccessor

ParamTypeDefault
groupListArray.<Group>
personIdstring
justManageablebooleanfalse

aclResolver(aclObject, groupTree, glue) ⇒ Map.<string, Set.<string>>

Kind: global function

ParamTypeDefault
aclObjectany
groupTreeany
gluestring"'.'"

Group : Object

Kind: global typedef Properties

NameType
groupstring
domainstring