Monarch Database API - v1.0.0
Preparing search index...
SecurityManager
Class SecurityManager
Implements
AccessControl
Index
Constructors
constructor
Methods
authenticate
authorize
check
Resource
Access
create
User
decrypt
delete
User
encrypt
get
Active
Sessions
get
Security
Stats
get
Session
hash
Password
revoke
Session
revoke
User
Sessions
update
User
Roles
verify
Password
Constructors
constructor
new
SecurityManager
(
encryptionKey
?:
string
)
:
SecurityManager
Parameters
Optional
encryptionKey
:
string
Returns
SecurityManager
Methods
authenticate
authenticate
(
username
:
string
,
password
:
string
,
)
:
Promise
<
SecurityContext
|
null
>
Parameters
username
:
string
password
:
string
Returns
Promise
<
SecurityContext
|
null
>
authorize
authorize
(
context
:
SecurityContext
|
null
|
undefined
,
permission
:
Permission
,
resource
?:
string
,
)
:
boolean
Parameters
context
:
SecurityContext
|
null
|
undefined
permission
:
Permission
Optional
resource
:
string
Returns
boolean
check
Resource
Access
checkResourceAccess
(
context
:
SecurityContext
,
resource
:
string
,
permission
:
Permission
,
)
:
boolean
Parameters
context
:
SecurityContext
resource
:
string
permission
:
Permission
Returns
boolean
create
User
createUser
(
username
:
string
,
password
:
string
,
roles
?:
Role
[]
)
:
Promise
<
User
>
Parameters
username
:
string
password
:
string
roles
:
Role
[]
= ...
Returns
Promise
<
User
>
decrypt
decrypt
(
encryptedData
:
string
)
:
Promise
<
any
>
Parameters
encryptedData
:
string
Returns
Promise
<
any
>
delete
User
deleteUser
(
username
:
string
)
:
void
Parameters
username
:
string
Returns
void
encrypt
encrypt
(
data
:
any
)
:
Promise
<
string
>
Parameters
data
:
any
Returns
Promise
<
string
>
get
Active
Sessions
getActiveSessions
()
:
SecurityContext
[]
Returns
SecurityContext
[]
get
Security
Stats
getSecurityStats
()
:
{
activeSessions
:
number
;
totalUsers
:
number
;
usersByRole
:
Record
<
Role
,
number
>
;
}
Returns
{
activeSessions
:
number
;
totalUsers
:
number
;
usersByRole
:
Record
<
Role
,
number
>
;
}
get
Session
getSession
(
sessionId
:
string
)
:
SecurityContext
|
null
Parameters
sessionId
:
string
Returns
SecurityContext
|
null
hash
Password
hashPassword
(
password
:
string
)
:
Promise
<
string
>
Parameters
password
:
string
Returns
Promise
<
string
>
revoke
Session
revokeSession
(
sessionId
:
string
)
:
void
Parameters
sessionId
:
string
Returns
void
revoke
User
Sessions
revokeUserSessions
(
username
:
string
)
:
void
Parameters
username
:
string
Returns
void
update
User
Roles
updateUserRoles
(
username
:
string
,
roles
:
Role
[]
)
:
void
Parameters
username
:
string
roles
:
Role
[]
Returns
void
verify
Password
verifyPassword
(
password
:
string
,
hash
:
string
)
:
Promise
<
boolean
>
Parameters
password
:
string
hash
:
string
Returns
Promise
<
boolean
>
Settings
Member Visibility
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
authenticate
authorize
check
Resource
Access
create
User
decrypt
delete
User
encrypt
get
Active
Sessions
get
Security
Stats
get
Session
hash
Password
revoke
Session
revoke
User
Sessions
update
User
Roles
verify
Password
Monarch Database API - v1.0.0
Loading...