New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aspecto/privacy-rules

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aspecto/privacy-rules - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

13

dist/actions.js

@@ -56,3 +56,3 @@ "use strict";

executeFilteredAction(actionType, filter, msg.HTTP_REQUEST.query);
// TODO: handle fullUrlProp
copyQueryToFullUrl(msg);
return;

@@ -65,2 +65,13 @@ default:

};
const copyQueryToFullUrl = (msg) => {
// we have query props in 2 places: fullUrl prop and query object
// it's easy to apply privacy rules to the object, but not to the raw string
// so we just replace query part of the fullUrl prop with the values from the query object
const { query } = msg.HTTP_REQUEST;
if (query) {
msg.HTTP_REQUEST.fullUrl = msg.HTTP_REQUEST.fullUrl.replace(/\?[^#/$]+/gi, `?${Object.keys(query)
.map((key) => `${key}=${query[key]}`)
.join('&')}`);
}
};
exports.executeAction = (action, msg) => {

@@ -67,0 +78,0 @@ const { actionType } = action;

@@ -9,2 +9,3 @@ export declare type AspectoMessage = {

requestBody?: any;
fullUrl?: string;
query: Record<string, string>;

@@ -11,0 +12,0 @@ requestHeaders: Record<string, string>;

2

package.json
{
"name": "@aspecto/privacy-rules",
"version": "0.0.3",
"version": "0.0.4",
"description": "Aspecto Privacy Rules Engine",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -137,2 +137,6 @@ import { PrivacyEngine } from '../src';

expect(authMessage.HTTP_REQUEST.requestBody.password).toBe('__aspecto_field_blocked__');
expect(authMessage.HTTP_REQUEST.query.Authentication).toBe('__aspecto_field_blocked__');
expect(authMessage.HTTP_REQUEST.fullUrl).toBe(
'https://auth-service.com/users/auth?Authentication=__aspecto_field_blocked__&param1=notprivate#some/route'
);
});

@@ -139,0 +143,0 @@ });

@@ -8,6 +8,7 @@ import { AspectoMessage } from '../src/types/AspectoMessage';

route: { path: '/users/' },
fullUrl: 'https://auth-service.com/users/auth?Authentication=token&param1=notprivate#some/route',
body: { user: 'daniel', password: 'craig' },
requestBody: { user: 'daniel', password: 'craig' },
query: {
auth: 'token',
Authentication: 'token',
param1: 'notprivate',

@@ -14,0 +15,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc