egg-esapi

1.0.4 • Public • Published

egg-esapi

NPM version build status Test coverage David deps Known Vulnerabilities npm download

An ESAPI(Enterprise Security API) plugin for egg.js

Install

$ npm i egg-esapi --save

Usage

// {app_root}/config/plugin.js
exports.esapi = {
  enable: true,
  package: 'egg-esapi',
};

Example

this.app.esapi.encodeForHTML(HTML);
this.app.esapi.encodeForCSS(CSS);
this.app.esapi.encodeForJavaScript(JavaScript);
this.app.esapi.encodeForURL(URL);
this.app.esapi.encodeForHTMLAttribute(HTMLAttribute);
this.app.esapi.encodeForBase64(Base64);
 
// or use in context
this.ctx.esapi.encodeForHTML(HTML);
this.ctx.esapi.encodeForCSS(CSS);
this.ctx.esapi.encodeForJavaScript(JavaScript);
this.ctx.esapi.encodeForURL(URL);
this.ctx.esapi.encodeForHTMLAttribute(HTMLAttribute);
this.ctx.esapi.encodeForBase64(Base64);

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-esapi

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

7 kB

Total Files

8

Last publish

Collaborators

  • weihongyu12