Skip to content

Commit

Permalink
Merge pull request #73 from PerimeterX/dev
Browse files Browse the repository at this point in the history
Version 5.1.0
  • Loading branch information
Johnny Tordgeman authored Feb 25, 2019
2 parents ef8b95d + c7066ed commit 0ff958f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [5.1.0] - 2019-02-25
### Added
- Support for testing blocking flow in monitor mode

## [5.0.0] - 2018-01-11
### Added
- Full refactor of proxy support
Expand Down
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[PerimeterX](http://www.perimeterx.com) Express.js Middleware
=============================================================

> Latest stable version: [v5.0.0](https://www.npmjs.com/package/perimeterx-node-express)
> Latest stable version: [v5.1.0](https://www.npmjs.com/package/perimeterx-node-express)
Table of Contents
-----------------
Expand All @@ -28,16 +28,21 @@ Table of Contents
* [Custom Request Handler](#customRequestHandler)
* [Additional Activity Handler](#additionalActivityHandler)
* [Proxy Support](#proxySupport)
* [Test Block Flow on Monitoring Mode](#bypassMonitorHeader)
- [Advanced Blocking Response](#advancedBlockingResponse)

## <a name="installation"></a> Installation
PerimeterX Express.js middleware is installed via NPM:
`$ npm install --save perimeterx-node-express`

> Please note: NodeJS 6.x will reach EoL on April 2019 as stated in [NodeJSs release schedule](https://github.com/nodejs/Release#release-schedule). Hence, [NodeJS express module](https://github.com/PerimeterX/perimeterx-node-express/) version 5.0.0 and above will only support NodeJS 8.x and above.
> Please note: As stated in [NodeJS's release schedule](https://github.com/nodejs/Release#release-schedule), NodeJS 6.x is reaching EOL. Thus, support for it will be dropped starting with version 5.0.0.
## <a name="upgrading"></a> Upgrading
To upgrade to the latest Enforcer version, run:

`npm install -s perimeterx-node-express`

For more information, contact [PerimeterX Support]([email protected]).
## <a name="configuration"></a> Configuration

### <a name="requiredConfiguration"></a> Required Configuration
Expand Down Expand Up @@ -108,6 +113,15 @@ server.listen(8081, () => {
console.log('server started');
});
```
## <a name="upgrade"></a> Upgrading

To upgrade to the latest Enforcer version, run:

`npm install -s perimeterx-node-express`

Your Enforcer version is now upgraded to the latest enforcer version.

For more information,contact [PerimeterX Support]([email protected]).

### <a name="optionalConfiguration"></a>Optional Configuration

Expand Down Expand Up @@ -308,6 +322,26 @@ const pxConfig = {
...
};
```

#### <a name=“bypassMonitorHeader”></a> Test Block Flow on Monitoring Mode

Allows you to test an enforcer’s blocking flow while you are still in Monitor Mode.

When the header name is set(eg. `x-px-block`) and the value is set to `1`, when there is a block response (for example from using a User-Agent header with the value of `PhantomJS/1.0`) the Monitor Mode is bypassed and full block mode is applied. If one of the conditions is missing you will stay in Monitor Mode. This is done per request.
To stay in Monitor Mode, set the header value to `0`.

The Header Name is configurable using the `BypassMonitorHeader` property.

**Default:** Empty

```javascript
const pxConfig = {
...
bypassMonitorHeader: "x-px-block"
...
};
```

## <a name="advancedBlockingResponse"></a> Advanced Blocking Response
In special cases, (such as XHR post requests) a full Captcha page render might not be an option. In such cases, using the Advanced Blocking Response returns a JSON object continaing all the information needed to render your own Captcha challenge implementation, be it a popup modal, a section on the page, etc. The Advanced Blocking Response occurs when a request contains the *Accept* header with the value of `application/json`. A sample JSON response appears as follows:

Expand Down
2 changes: 1 addition & 1 deletion lib/perimeterx.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const MODULE_VERSION = 'NodeJS Module v5.0.0';
const MODULE_VERSION = 'NodeJS Module v5.1.0';

const PxExpressClient = require('./pxclient');
const PxEnforcer = require('perimeterx-node-core').PxEnforcer;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "perimeterx-node-express",
"version": "5.0.0",
"version": "5.1.0",
"description": "PerimeterX Express.js middleware to monitor and block traffic according to PerimeterX risk score",
"main": "index.js",
"directories": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"cookie-parser": "^1.4.1",
"moment": "^2.19.3",
"perimeterx-node-core": "~1.7.0"
"perimeterx-node-core": "~1.8.0"
},
"devDependencies": {
"express": "4.16.2",
Expand Down

0 comments on commit 0ff958f

Please sign in to comment.