kadence/trust~ TrustPlugin

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

Constructor

new TrustPlugin(policies, modeopt)

Parameters:
NameTypeAttributesDefaultDescription
policiesArray.<module:kadence/trust~TrustPlugin~policy>
modenumber<optional>
TrustPlugin.MODE_BLACKLIST

Blacklist or whitelist

Members

(static) MODE_BLACKLIST

Mode flag passed to TrustPlugin to place into blacklist mode

(static) MODE_WHITELIST

Mode flag passed to TrustPlugin to place into whitelist mode

Methods

addTrustPolicy(policy) → {TrustPlugin}

Adds a new trust policy

Parameters:
NameTypeDescription
policymodule:kadence/trust~TrustPlugin~policy
Returns:
Type: 
TrustPlugin

getTrustPolicy(identity) → {module:kadence/trust~TrustPlugin~policy|null}

Returns the trust policy for the given identity

Parameters:
NameTypeDescription
identitystring | buffer

Identity key for the policy

removeTrustPolicy(identity) → {TrustPlugin}

Removes an existing trust policy

Parameters:
NameTypeDescription
identitystring | buffer

Trust policy to remove

Returns:
Type: 
TrustPlugin

Type Definitions

policy

Type:
  • object
Properties
NameTypeDescription
identitystring | buffer

Node identity key

methodsArray.<string>

Methods, wildcard (*) supported for all