next-core-security
v3.0.0
Published
The Augmented.js Next - Security.
Downloads
11
Maintainers
Readme
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
type
Security.ClientType The client typeuri
string The base uri
uri
Properties
uri
string The uri
type
Properties
type
Security.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
name
string The name of the application/service/module
access
access the application/service/module via OAUTH
Parameters
principal
string The principal TODO: Refresh the token and store it
ACLClient
Extends AbstractSecurityClient
Role/Privilege (ACL) Security
authenticate
authenticate the user
Parameters
username
string The name of the user (login)password
string The password for the user (not stored)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
clientType
Security.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
fullName
string The full name of the principalid
number The id of the principallogin
string The login of the principalemail
string The email of the principal
Entry
Used to secure a resource via permissions
Parameters
p
neg
permissions
array Permissions to add to the entry (optional)negaive
boolean Sets negative permissions (optional)
isNegative
Negative flag
Properties
isNegative
boolean
permissions
Gets the permissions
Returns array Permissions
permissions
Sets the permissions
Parameters
p
permissions
array Permissions Array to set
addPermission
Add a permission
Parameters
p
permission
string Permission to add
removePermission
Remove a permission
Parameters
p
permission
string Permission to remove
hasPermission
Returns if this entry has a permission
Parameters
p
permission
string Permission to test for
Returns boolean Returns true if this entry has this permission
setNegative
Sets this entry negaive or positive
Parameters
n
negative
boolean flag True or False
Context
Augmented.Security.Context Used as a security data storage class
Parameters
principal
Security.Principal The principal for this contextpermissions
array 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
p
permissions
array
addPermission
addPermission - Add a new permission for a principal
Parameters
p
permission
string
removePermission
removePermission - Remove a permission for a principal
Parameters
p
permission
string
hasPermission
hasPermission - checks for a permission for this principal
Parameters
p
permission
string