koa-helmet
Security header middleware collection for koa
Last updated a year ago by venables .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install koa-helmet 
SYNC missed versions from official npm registry.

koa-helmet

Version Build Status Coverage Status Dependency Status js-semistandard-style Downloads

koa-helmet is a wrapper for helmet to work with koa. It provides important security headers to make your app more secure by default.

Installation

yarn add koa-helmet

or via npm:

npm install koa-helmet --save

Usage

Usage is the same as helmet

Helmet offers 14 security middleware functions:

Module Default?
contentSecurityPolicy for setting Content Security Policy
permittedCrossDomainPolicies for handling Adobe products' crossdomain requests
dnsPrefetchControl controls browser DNS prefetching
expectCt for handling Certificate Transparency
featurePolicy to limit your site's features
frameguard to prevent clickjacking
hidePoweredBy to remove the X-Powered-By header
hpkp for HTTP Public Key Pinning
hsts for HTTP Strict Transport Security
ieNoOpen sets X-Download-Options for IE8+
noCache to disable client-side caching
noSniff to keep clients from sniffing the MIME type
referrerPolicy to hide the Referer header
xssFilter adds some small XSS protections

You can see more in the documentation.

Note:

In order to work well with the helmet HSTS module, koa-helmet will augment this.request to include a secure boolean to determine if the request is over HTTPS.

Example

"use strict";

const Koa = require("koa");
const helmet = require("koa-helmet");
const app = new Koa();

app.use(helmet());

app.use((ctx) => {
  ctx.body = "Hello World"
});

app.listen(4000);

Testing

To run the tests, simply run

yarn test

Versioning

  • koa-helmet >=2.x (master branch) supports koa 2.x
  • koa-helmet 1.x (koa-1 branch) supports koa 0.x and koa 1.x

Current Tags

  • 2.0.0-alpha.1                                ...           alpha (5 years ago)
  • 0.2.0-beta2                                ...           beta (5 years ago)
  • 1.1.0                                ...           koa1 (4 years ago)
  • 5.2.0                                ...           latest (a year ago)

29 Versions

  • 5.2.0                                ...           a year ago
  • 5.1.0                                ...           a year ago
  • 5.0.0                                ...           a year ago
  • 4.2.1                                ...           a year ago
  • 4.2.0                                ...           a year ago
  • 4.1.0                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.3.0                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           4 years ago
  • 3.1.0                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 2.0.0-alpha.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 1.0.0-alpha.2                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 1.0.0-alpha.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.2.0-beta2                                ...           5 years ago
  • 0.2.0-beta1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 10
This Week 819
This Month 2,335
Last Day 39
Last Week 814
Last Month 3,869
Dependencies (1)
Dev Dependencies (7)
Dependents (232)

Copyright 2014 - 2016 © taobao.org |