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

Anonymization in/out #76

Merged
merged 28 commits into from
Aug 20, 2024
Merged

Anonymization in/out #76

merged 28 commits into from
Aug 20, 2024

Conversation

AJun01
Copy link
Collaborator

@AJun01 AJun01 commented Jul 1, 2024

Summary

This pull request replaces #74. The Compare branch has been renamed from anonymization/v1.0 to AJun01/fix-issue-71 and renamed PR into Anonymization in/out.

Changes

Renamed the branch to AJun01/fix-issue-71
Retained all commits and changes from the old branch

Context

Anonymization Feature v1.0

Introduction

Releasing of the Anonymization Feature v1.0. This feature is designed to enhance the privacy and security of our users by filtering out sensitive information in generated HTTP requests.

Key Features

  • JSON Anonymization
  • Form Data Anonymization

How It Works

The Anonymization Feature v1.0 utilizes advanced regular expressions to detect sensitive information in HTTP requests. When enabled using setAnonymization(), it processes the request body and replaces the detected sensitive information with anonymized placeholders.

Example

Original Request Body:

{
  "email": "[email protected]",
  "name": "Yujun Liu",
  "address": "22 Bond str"
}

Anonymized Request Body:

{
  "email": "************@email.com",
  "name": "*Anonymized* Name",
  "address": "*Anonymized* Address"
}

How to Enable

To enable the Anonymization Feature, simply call the anonymizeMode(true) function in your configuration. This will ensure that all HTTP requests are processed to filter out sensitive information before being sent.

Code Example

var trafficSimulator = require('flexbench');

trafficSimulator.anonymizeMode(true); 

Test(Anonymizer.js)

  • File involved:
image
  • Run test:
npm test
  • Result: JSON
image
  • Result: Form Data
image

Test(simple-request(anonymized).js)

  • File involved:
image
  • Run test:
node simple-request\(anonymized\).js
  • Result:
image

Yujun 6/16/2024 Created

Yujun 7/4/2024 Updated

AJun01 and others added 2 commits June 27, 2024 11:51
remove the auto change made by Docker
- Deleted unnecessary files: anonumized-request.js(testing), mockServer.js(testing), anonymizationProxy.js(no need), TAS.js(no need)
- Added two testing files: anonymized_Form-test.js, anonymized_JSON-test.js
- Improved regex, function with ability to handle JSON and Form data
@AJun01 AJun01 force-pushed the AJun01/fix-issue-71 branch from 36daf4d to 4d31657 Compare July 1, 2024 19:59
@mariosk mariosk requested a review from iskitsas July 3, 2024 19:13
- modified main.js code utilizing anonymization feature
- add function: anonymizedMode: starting anonymization feature
mariosk

This comment was marked as resolved.

@iskitsas

This comment was marked as resolved.

@AJun01

This comment was marked as resolved.

- fixed testing with anonymizer.js
- created testing file(simple-request.js) utilizing trafficSimulator
@AJun01

This comment was marked as resolved.

@AJun01 AJun01 closed this Jul 8, 2024
@AJun01 AJun01 reopened this Jul 8, 2024
@AJun01

This comment was marked as resolved.

package.json Outdated Show resolved Hide resolved
lib/anonymizer.js Show resolved Hide resolved
lib/anonymizer.js Outdated Show resolved Hide resolved
lib/anonymizer.js Outdated Show resolved Hide resolved
lib/anonymizer.js Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
example/simple-request_anonymized.js Outdated Show resolved Hide resolved
test/anonymized_Form-test.js Outdated Show resolved Hide resolved
test/anonymized_JSON-test.js Outdated Show resolved Hide resolved
AJun01 and others added 5 commits July 20, 2024 16:05
- Fixed renames
- Implemented zip, address, state regex for text anonymization
- Ensured backward compatibility for callback function
- Improved error handling to always invoke callback
lib/anonymizer.js Outdated Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
lib/anonymizer.js Outdated Show resolved Hide resolved
@iskitsas

This comment was marked as resolved.

@iskitsas

This comment was marked as resolved.

@AJun01

This comment was marked as resolved.

README.md Outdated Show resolved Hide resolved
lib/anonymizer.js Outdated Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
iskitsas pushed a commit that referenced this pull request Aug 17, 2024
…response to replace the original with anonymized body
@iskitsas

This comment was marked as resolved.

-modified README
-modified anonymizer based on proposed PR#94
-modified main based on proposed PR#94
lib/main.js Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
lib/main.js Outdated Show resolved Hide resolved
@mariosk

This comment was marked as resolved.

@mariosk mariosk closed this Aug 19, 2024
@mariosk mariosk reopened this Aug 19, 2024
@mariosk

This comment was marked as resolved.

@AJun01

This comment was marked as resolved.

Copy link
Collaborator

@mariosk mariosk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mariosk mariosk merged commit cb3a427 into flexivian:develop Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants