Skip to content

weihongyu12/egg-esapi

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published