Skip to content

pragonauts/prg-identity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Identity

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

API

Classes

AuthService
Authorizator
UsersService
UserAccessor

Functions

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

Typedefs

Group : Object

AuthService

Kind: global class

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()

authService.expressMiddleware() ⇒ function

Kind: instance method of AuthService

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

Kind: instance method of AuthService

Param Default
userId
domain

authService.createPasswordResetToken(userId) ⇒ Promise

Kind: instance method of AuthService

Param Type
userId string

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

Kind: instance method of AuthService

Param Type
token string

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

Kind: instance method of AuthService

Param Type Default
type string
[userIdOrGroups] string null
[options] Object
[length] number

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

Kind: instance method of AuthService

Param Type
type string
token string

authService.dropToken(token) ⇒ Promise

Kind: instance method of AuthService

Param Type
token string

authService.createUserAccessor([userGroups], [userId]) ⇒ UserAccessor

Kind: instance method of AuthService

Param Type Default
[userGroups] Array.<Group> []
[userId] string null

Authorizator

Kind: global class

new Authorizator(aclList, [superGroup])

Creates an instance of Authorizator.

Param Type
aclList Map.<String, Set.<String>>
[superGroup] string

UsersService

Kind: global class

new UsersService(userStorage, [config], [formatter])

Param Type Description
userStorage *
[config] Object
[config.superGroup] string
[config.adminGroups] Array.<string>
[formatter] function user formatter

usersService.storage : MongoDbUserStorage

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

userAccessor.isMe([userId]) ⇒ boolean

Kind: instance method of UserAccessor

Param Type
[userId] string

userAccessor.isRelated(groups) ⇒ boolean

Kind: instance method of UserAccessor

Param Type
groups Array.<Group>

userAccessor.isAdministrable(groups) ⇒ boolean

Kind: instance method of UserAccessor

Param Type
groups Array.<Group>

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

Kind: instance method of UserAccessor

Param Type Default
groupList Array.<Group>
personId string
[justManageable] boolean false

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

Kind: global function

Param Type Default
aclObject any
[groupTree] any
[glue] string "'.'"

Group : Object

Kind: global typedef Properties

Name Type
group string
domain string

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published