Skip to content

Commit

Permalink
Merge pull request #156 from PerimeterX/release/v7.7.0
Browse files Browse the repository at this point in the history
Release/v7.7.0 -> master
  • Loading branch information
chen-zimmer-px authored Apr 2, 2023
2 parents d0f9c44 + a064680 commit 2ba9a47
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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/).

## [7.7.0] - 2023-03-28

### Added

- Support for handling graphQL requests with empty query field
- Support custom is sensitive request via function

## [7.6.0] - 2023-01-26

### Added
Expand Down
18 changes: 17 additions & 1 deletion 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: [v7.6.0](https://www.npmjs.com/package/perimeterx-node-express)
> Latest stable version: [v7.7.0](https://www.npmjs.com/package/perimeterx-node-express)
## Table of Contents

Expand Down Expand Up @@ -931,6 +931,22 @@ const pxConfig = {
};
```

#### <a name="px_custom_is_sensitive_request"></a>Custom Is Sensitive Request
Allows writing your own logic to decide whether the request is sensitive.
The custom sensitive request function gets the request object as a parameter and should return true, otherwise, return false. Throwing an exception is equivalent to `false`.

**Default**: Empty

```javascript
const pxConfig = {
...
px_custom_is_sensitive_request: function(req) {
return req.method === 'POST' && req.body && req.body.test;
}
...
```
**Default:** `null`
## <a name="cdMiddleware"></a> Code Defender Middleware - cdMiddleware
Expand Down
2 changes: 1 addition & 1 deletion lib/pxenforcer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { PxEnforcer, PxCdFirstParty } = require('perimeterx-node-core');
const PxExpressClient = require('./pxclient');
const PxCdEnforcer = require('./pxcdenforcer');

const MODULE_VERSION = 'NodeJS Module v7.6.0';
const MODULE_VERSION = 'NodeJS Module v7.7.0';
const MILLISECONDS_IN_MINUTE = 60000;

function parseCookies(req, res) {
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": "7.6.0",
"version": "7.7.0",
"description": "PerimeterX Express.js middleware to monitor and block traffic according to PerimeterX risk score",
"main": "index.js",
"directories": {
Expand Down Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"axios": "^0.21.1",
"cookie-parser": "^1.4.1",
"perimeterx-node-core": "^3.9.0"
"perimeterx-node-core": "^3.10.1"
},
"devDependencies": {
"chai": "^4.3.6",
Expand Down
3 changes: 2 additions & 1 deletion px_metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "7.6.0",
"version": "7.7.0",
"supported_features": [
"additional_activity_handler",
"advanced_blocking_response",
Expand All @@ -19,6 +19,7 @@
"custom_logo",
"custom_parameters",
"custom_proxy",
"custom_sensitive_request",
"enforced_routes",
"filter_by_route",
"filter_by_http_method",
Expand Down

0 comments on commit 2ba9a47

Please sign in to comment.