@aspecto/privacy-rules
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -47,2 +47,3 @@ "use strict"; | ||
case 'body-json': | ||
executeFilteredAction(actionType, filter, msg.HTTP_REQUEST.requestBody); | ||
executeFilteredAction(actionType, filter, msg.HTTP_REQUEST.body); | ||
@@ -49,0 +50,0 @@ return; |
@@ -7,3 +7,4 @@ export declare type AspectoMessage = { | ||
}; | ||
body: any; | ||
body?: any; | ||
requestBody?: any; | ||
query: Record<string, string>; | ||
@@ -10,0 +11,0 @@ requestHeaders: Record<string, string>; |
{ | ||
"name": "@aspecto/privacy-rules", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Aspecto Privacy Rules Engine", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -49,2 +49,9 @@ import { PrivacyEngine } from '../src'; | ||
}, | ||
{ | ||
actionType: 'block-field', | ||
actionData: { | ||
fieldTypes: ['header', 'body-json', 'query-param'], | ||
filter: { filterType: 'by-key', filterValue: 'password' }, | ||
}, | ||
}, | ||
], | ||
@@ -129,2 +136,4 @@ }; | ||
expect(authMessage.HTTP_REQUEST.requestHeaders.Bearer).toBe('__aspecto_field_blocked__'); | ||
expect(authMessage.HTTP_REQUEST.body.password).toBe('__aspecto_field_blocked__'); | ||
expect(authMessage.HTTP_REQUEST.requestBody.password).toBe('__aspecto_field_blocked__'); | ||
}); | ||
@@ -131,0 +140,0 @@ }); |
@@ -9,2 +9,3 @@ import { AspectoMessage } from '../src/types/AspectoMessage'; | ||
body: { user: 'daniel', password: 'craig' }, | ||
requestBody: { user: 'daniel', password: 'craig' }, | ||
query: { | ||
@@ -11,0 +12,0 @@ auth: 'token', |
Sorry, the diff of this file is not supported yet
24875
384