next-core-security v3.0.0
next-core-security
Augmented.js Next Core - Security
API
Table of Contents
AbstractSecurityClient
Extends Object
The abstract Security Client - for use to extend your own
Parameters
type
Properties
typeSecurity.ClientType The client typeuristring The base uri
uri
Properties
uristring The uri
type
Properties
typeSecurity.ClientType The client type
OAUTH2Client
Extends AbstractSecurityClient
The OAUTH2 Client
authorize
Access Token
Parameters
name
authorize
Authorization Token
Parameters
name
authorize
Authorize the application/service/module via OAUTH
Parameters
namestring The name of the application/service/module
access
access the application/service/module via OAUTH
Parameters
principalstring The principal TODO: Refresh the token and store it
ACLClient
Extends AbstractSecurityClient
Role/Privilege (ACL) Security
authenticate
authenticate the user
Parameters
- Throws any Error Failed to authenticate
Returns Security.Context Returns a security context or null is case of failure
ClientType
Augmented.Security.ClientType - Security client type
Type: Symbol
Properties
AuthenticationFactory
AuthenticationFactory Class - Returns a client of given type for use with security
getSecurityClient
Get an instance of a security client
Parameters
clientTypeSecurity.ClientType The Client Type to return
Returns Security.Client Returns a security client instance
Principal
Pricipal object for use in security as part of the abstract implimentation
Parameters
options
Properties
fullNamestring The full name of the principalidnumber The id of the principalloginstring The login of the principalemailstring The email of the principal
Entry
Used to secure a resource via permissions
Parameters
pnegpermissionsarray Permissions to add to the entry (optional)negaiveboolean Sets negative permissions (optional)
isNegative
Negative flag
Properties
isNegativeboolean
permissions
Gets the permissions
Returns array Permissions
permissions
Sets the permissions
Parameters
ppermissionsarray Permissions Array to set
addPermission
Add a permission
Parameters
ppermissionstring Permission to add
removePermission
Remove a permission
Parameters
ppermissionstring Permission to remove
hasPermission
Returns if this entry has a permission
Parameters
ppermissionstring Permission to test for
Returns boolean Returns true if this entry has this permission
setNegative
Sets this entry negaive or positive
Parameters
nnegativeboolean flag True or False
Context
Augmented.Security.Context Used as a security data storage class
Parameters
principalSecurity.Principal The principal for this contextpermissionsarray Permissions to add to the context
principal
getPrincipal - get the principal of this context
Returns Security.Principal principal The principal of this context
permissions
getPermissions - Get all the permissions for a principal
Returns array permissions All permissions
permissions
setPermissions - Set all permissions for a principal
Parameters
ppermissionsarray
addPermission
addPermission - Add a new permission for a principal
Parameters
ppermissionstring
removePermission
removePermission - Remove a permission for a principal
Parameters
ppermissionstring
hasPermission
hasPermission - checks for a permission for this principal
Parameters
ppermissionstring