Skip to content

Commit d1bacc3

Browse files
author
Johnny Tordgeman
authored
Merge pull request #162 from PerimeterX/dev
Version 5.3.1
2 parents 953b900 + 6dfd8a6 commit d1bacc3

File tree

6 files changed

+106
-5
lines changed

6 files changed

+106
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [5.3.1] - 2018-11-07
9+
### Fixed
10+
- Wrong value in Json response's vid property
11+
812
## [5.3.0] - 2018-11-04
913
### Added
1014
- Support for first party route prefix

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# [PerimeterX](http://www.perimeterx.com) NGINX Lua Plugin
66

7-
> Latest stable version: [v5.3.0](https://luarocks.org/modules/bendpx/perimeterx-nginx-plugin/5.3-0)
7+
> Latest stable version: [v5.3.0](https://luarocks.org/modules/bendpx/perimeterx-nginx-plugin/5.3-1)
88
99

1010
## [Introduction](#introduction)

lib/px/block/pxblock.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function M.load(px_config)
122122
appId = props.appId,
123123
jsClientSrc = props.jsClientSrc,
124124
firstPartyEnabled = props.firstPartyEnabled,
125-
vid = props.firstPartyEnabled,
125+
vid = props.vid,
126126
uuid = props.uuid,
127127
hostUrl = props.hostUrl,
128128
blockScript = props.blockScript

lib/px/utils/pxconstants.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
----------------------------------------------
44

55
local _M = {
6-
MODULE_VERSION = "NGINX Module v5.3.0",
6+
MODULE_VERSION = "NGINX Module v5.3.1",
77
RISK_PATH = "/api/v3/risk",
88
CAPTCHA_PATH = "/api/v2/risk/captcha",
99
ACTIVITIES_PATH = "/api/v1/collector/s2s",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package = "perimeterx-nginx-plugin"
2-
version = "5.3-0"
2+
version = "5.3-1"
33
source = {
44
url = "git://github.com/PerimeterX/perimeterx-nginx-plugin.git",
5-
tag = "v5.3.0",
5+
tag = "v5.3.1",
66
}
77
description = {
88
summary = "PerimeterX NGINX Lua Middleware.",

t/003-block.t

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,100 @@ User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36
207207
208208
--- error_log
209209
[PerimeterX - DEBUG] [ PX_APP_ID ] - Visitor score is higher than allowed threshold
210+
211+
=== TEST 4: Json response w/first party
212+
verify the json response
213+
214+
--- http_config
215+
lua_package_path "/usr/local/lib/lua/?.lua;/usr/local/openresty/lualib/?.lua;;";
216+
lua_ssl_trusted_certificate "/etc/ssl/certs/ca-certificates.crt";
217+
lua_ssl_verify_depth 3;
218+
lua_socket_pool_size 500;
219+
resolver 8.8.8.8;
220+
init_worker_by_lua_block {
221+
require ("px.utils.pxtimer").application()
222+
}
223+
set_real_ip_from 0.0.0.0/0;
224+
real_ip_header X-Forwarded-For;
225+
226+
--- config
227+
location = /t {
228+
resolver 8.8.8.8;
229+
set_by_lua_block $config {
230+
pxconfig = require "px.pxconfig"
231+
pxconfig.cookie_secret = "perimeterx"
232+
pxconfig.px_debug = true
233+
pxconfig.block_enabled = true
234+
pxconfig.enable_server_calls = false
235+
pxconfig.send_page_requested_activity = false
236+
return true
237+
}
238+
239+
access_by_lua_block {
240+
require("px.pxnginx").application(require "px.pxconfig")
241+
}
242+
}
243+
244+
--- request
245+
GET /t
246+
247+
--- req_headers
248+
X-Forwarded-For: 1.2.3.4
249+
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36
250+
Accept: application/json
251+
252+
--- response_body
253+
{"uuid":"57ecdc10-0e97-11e6-80b6-095df820282c","appId":"PX_APP_ID","firstPartyEnabled":true,"hostUrl":"\/_APP_ID\/xhr","vid":"vid","jsClientSrc":"\/_APP_ID\/init.js","blockScript":"\/_APP_ID\/captcha\/PX_APP_ID\/captcha.js?a=captcha&m=0&u=57ecdc10-0e97-11e6-80b6-095df820282c&v=vid"}
254+
--- error_code: 403
255+
256+
--- error_log
257+
[PerimeterX - DEBUG] [ PX_APP_ID ] - Visitor score is higher than allowed threshold
258+
259+
=== TEST 5: Json response wo/ first party
260+
verify the json response
261+
262+
--- http_config
263+
lua_package_path "/usr/local/lib/lua/?.lua;/usr/local/openresty/lualib/?.lua;;";
264+
lua_ssl_trusted_certificate "/etc/ssl/certs/ca-certificates.crt";
265+
lua_ssl_verify_depth 3;
266+
lua_socket_pool_size 500;
267+
resolver 8.8.8.8;
268+
init_worker_by_lua_block {
269+
require ("px.utils.pxtimer").application()
270+
}
271+
set_real_ip_from 0.0.0.0/0;
272+
real_ip_header X-Forwarded-For;
273+
274+
--- config
275+
location = /t {
276+
resolver 8.8.8.8;
277+
set_by_lua_block $config {
278+
pxconfig = require "px.pxconfig"
279+
pxconfig.cookie_secret = "perimeterx"
280+
pxconfig.px_debug = true
281+
pxconfig.block_enabled = true
282+
pxconfig.enable_server_calls = false
283+
pxconfig.send_page_requested_activity = false
284+
pxconfig.first_party_enabled = false
285+
return true
286+
}
287+
288+
access_by_lua_block {
289+
require("px.pxnginx").application(require "px.pxconfig")
290+
}
291+
}
292+
293+
--- request
294+
GET /t
295+
296+
--- req_headers
297+
X-Forwarded-For: 1.2.3.4
298+
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36
299+
Accept: application/json
300+
301+
--- response_body
302+
{"uuid":"57ecdc10-0e97-11e6-80b6-095df820282c","appId":"PX_APP_ID","firstPartyEnabled":false,"hostUrl":"\/\/collector-PX_APP_ID.perimeterx.net","vid":"vid","jsClientSrc":"\/\/client.perimeterx.net\/PX_APP_ID\/main.min.js","blockScript":"\/\/captcha.px-cdn.net\/PX_APP_ID\/captcha.js?a=captcha&m=0&u=57ecdc10-0e97-11e6-80b6-095df820282c&v=vid"}
303+
--- error_code: 403
304+
305+
--- error_log
306+
[PerimeterX - DEBUG] [ PX_APP_ID ] - Visitor score is higher than allowed threshold

0 commit comments

Comments
 (0)