Class: TrustPlugin

module:kadence/trust~ TrustPlugin

Handles user-defined rules for allowing and preventing the processing of messages from given identities

new TrustPlugin(policies [, mode])

Parameters:
Name Type Argument Default Description
policies Array.<module:kadence/trust~TrustPlugin~policy>
mode number <optional>
TrustPlugin.MODE_BLACKLIST Blacklist or whitelist
Source:

Members


<static> MODE_BLACKLIST

Mode flag passed to TrustPlugin to place into blacklist mode
Source:

<static> MODE_WHITELIST

Mode flag passed to TrustPlugin to place into whitelist mode
Source:

Methods


addTrustPolicy(policy)

Adds a new trust policy
Parameters:
Name Type Description
policy module:kadence/trust~TrustPlugin~policy
Source:
Returns:
Type
TrustPlugin

getTrustPolicy(identity)

Returns the trust policy for the given identity
Parameters:
Name Type Description
identity string | buffer Identity key for the policy
Source:
Returns:
Type
module:kadence/trust~TrustPlugin~policy | null

removeTrustPolicy(identity)

Removes an existing trust policy
Parameters:
Name Type Description
identity string | buffer Trust policy to remove
Source:
Returns:
Type
TrustPlugin

Type Definitions


policy

Type:
  • object
Properties:
Name Type Description
identity string | buffer Node identity key
methods Array.<string> Methods, wildcard (*) supported for all
Source: