1.0.4 • Published 4 years ago

egg-esapi v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago