A Hapi 17 plugin that uses a fernet created token, created using a shared secret between servers, to authenticate a request. The token is provided in the header x-token
of the request. Check out fernet.
// generate a token using the secret let fernet = let secret = 'secret-here'let token = secret let xToken = token
// in the server receiving the request let server = configlet authConfig = secret: 'secret-here' ttl: 4000 // defaults to 300000, which is 5 minutes await serverawait serverauthawait serverauth server
linting
This project uses Prettier.js for code formating and linting. I would recomend installing it globally as described here and integrate it with your editor.
here is the configuration used
--no-semi: true
--single-quote: true
--tab-width: 4
check out .eslint.rc
as well