hapi-hpkp

2.0.0 • Public • Published

hapi-hpkp

Inspired by Helmetjs, this is a Hapi module to add HPKP headers to all requests.

Example

var hpkp = require('./index')
var Hapi = require('hapi')
 
var hpkpOptions = {
    maxAge: 1,                       // In seconds
    sha256s: ["orlando=", "magic="], // Array of sha256
    includeSubdomains: true,         // optional
    reportUri: 'http://test.site',   // optional
    reportOnly: false                // optional
}
 
var server = new Hapi.Server()
 
// Register HPKP plugin
async () => {
    try {
        await server.register({
          plugin: hpkp,
          options: hpkpOptions
        })
    } catch(err) {
        console.error('Failed to load plugin:', err)
    }
}

Readme

Keywords

Package Sidebar

Install

npm i hapi-hpkp

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

31.2 kB

Total Files

22

Last publish

Collaborators

  • vbudhram