Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/7.9.0 to master #172

Merged
merged 14 commits into from
Dec 21, 2023
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ 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.9.0] - 2023-12-21

### Added

- Support for header-based logger
- Added `risk_start_time` and `enforcer_start_time` fields to enforcer activities.
- Added `failOnEmptyBody` flag for `callServer` to specify weather or not a request should fail if it has no body.
- Updated the configuration of PX first-party requests to include a connection timeout

### Changed
- Updated the captcha template to handle empty captcha responses

## [7.8.0] - 2023-05-16

### Changed
Expand Down
2 changes: 1 addition & 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.8.0](https://www.npmjs.com/package/perimeterx-node-express)
> Latest stable version: [v7.9.0](https://www.npmjs.com/package/perimeterx-node-express)

## Table of Contents

Expand Down
12 changes: 11 additions & 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.8.0';
const MODULE_VERSION = 'NodeJS Module v7.9.0';
const MILLISECONDS_IN_MINUTE = 60000;

function parseCookies(req, res) {
Expand Down Expand Up @@ -79,8 +79,14 @@ class PerimeterXEnforcer {
function pxMiddleware(req, res, next) {
parseCookies(req, res).then(() => {
enforcer.enforce(req, res, (err, response) => {
let pxContext = null;
if (req.locals && req.locals.pxCtx) {
pxContext = req.locals.pxCtx;
}
if (!err && response) {
PerimeterXEnforcer.handleCallbackResponse(err, response, res);

enforcer.sendHeaderBasedLogs(pxContext, enforcer.config.conf, req);
} else {
//pass
saveResponseBody(res);
Expand All @@ -95,8 +101,12 @@ class PerimeterXEnforcer {
enforcer.handleAdditionalS2SActivity(pxCtx, res);
}
});

enforcer.sendHeaderBasedLogs(pxContext, enforcer.config.conf, req);

next();
}

});
});
}
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.8.0",
"version": "7.9.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.11.0"
"perimeterx-node-core": "^3.13.0"
},
"devDependencies": {
"chai": "^4.3.6",
Expand Down
15 changes: 12 additions & 3 deletions px_metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "7.8.0",
"version": "7.9.0",
"supported_features": [
"additional_activity_handler",
"advanced_blocking_response",
Expand All @@ -12,6 +12,7 @@
"bypass_monitor_header",
"client_ip_extraction",
"cors_support",
"credentials_intelligence",
"csp_support",
"css_ref",
"cookie_v3",
Expand All @@ -27,9 +28,9 @@
"filter_by_user_agent",
"filter_by_extension",
"first_party",
"header_based_logger",
"js_ref",
"logger",
"credentials_intelligence",
"mobile_support",
"module_enable",
"module_mode",
Expand Down Expand Up @@ -58,6 +59,14 @@
"test_page_requested_activity_cookie_origin",
"test_block_page_hard_block_response",
"test_risk_api_validate_cookie_origin",
"test_risk_cookie_valid_cookie_with_user_agent_bigger_than_max_length"
"test_block_activity_headers",
"test_page_requested_activity_headers",
"test_sensitive_headers_removed_from_page_requested",
"test_sensitive_headers_removed_from_block",
"test_risk_api_schema",
"test_block_activity_schema",
"test_page_requested_activity_schema",
"test_risk_cookie_valid_cookie_with_user_agent_bigger_than_max_length",
"test_risk_cookie_validate_client_uuid_in_risk_api"
]
}
Loading