wrp-listener is a library that provides a webhook registerer and a validation function to be used for authentication.
Wrp-listener provides packages to help a consumer register to a webhook and authenticate messages received. Registering to a webhook can be done directly or set up to run at an interval. Message authentication is set up to work with the bascule library.
Table of Contents
Code of Conduct
This project and everyone participating in it are governed by the XMiDT Code Of Conduct. By participating, you agree to this Code.
Authentication is done using the bascule library: the token factory provided
hashTokenFactory package can be given to the bascule Constructor
middleware in order to verify that the hashed body given with a request is
valid and created with the expected secret.
Registration happens through the
webhookClient package, and can be set up for
manual registration or registration at an interval. If the consumer of this
package decides when to register, an error is returned if registering a webhook
is not successful. With registering at an interval, a logger can be provided.
Then, if an error occurs, the registerer will log it and then try again at the next interval.
Refer to CONTRIBUTING.md.