Skip to content

Entity-Anonymizer-Plugin is a powerful and easy-to-use plugin designed for SAP Cloud Application Programming (CAP) projects. It replaces sensitive property names on entities with generic values, ensuring data privacy and security throughout your application.

Notifications You must be signed in to change notification settings

MoSwilam/Entity-Anonymizer-Plugin

Repository files navigation

CAP Anonymizer Plugin

A CAP (Cloud Application Programming) plugin designed to anonymize fields based on @dbg.anonymize annotation. This plugin replaces sensitive property names on entities with generic values, ensuring data privacy and security.


Features

  • Entity-Level Anonymization: Anonymizes entire entities if they are annotated with @dbg.anonymize annotation.
  • Element-Level Anonymization: Replaces sensitive field values with generic placeholders.
  • Logging: Logs the entities and fields that are marked for anonymization.

Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • @sap/cds (latest version)

Installation

  1. Install the plugin as an npm package using the Github repo URL
npm install <Github repo URL>

Usage

Annotate your entities and elements with @dbg.anonymize to enable anonymization.

Example - Entity Annotation:

@dbg.anonymize
entity Authors {
  key ID : Integer;
  name   : String;
  birthdate : Date;
  email : String;
  nationality : String;
  phone: String;
}

Turns this

{
  "ID": 1,
  "name": "J.K. Rowling",
  "birthdate": "1965-07-31",
  "nationality": "British",
  "email": "[email protected]",
  "phone": "+44-20-7946-0958"
}

To this

{
  "ID": 1,
  "name": "Jane Doe",
  "birthdate": "1980-01-15",
  "nationality": "American",
  "email": "[email protected]",
  "phone": "+1-123-456-7890"
}

Example - Element Annotation:

entity Authors {
  key ID : Integer;
  name   : String;
  birthdate : Date;
  @dbg.anonymize
  email : String;
  nationality : String;
  phone: String;
}

Turns this

{
  "ID": 1,
  "name": "J.K. Rowling",
  "birthdate": "1965-07-31",
  "nationality": "British",
  "email": "[email protected]",
  "phone": "+44-20-7946-0958"
}

To this

{
  "ID": 1,
  "name": "J.K. Rowling",
  "birthdate": "1965-07-31",
  "nationality": "British",
  "email": "[email protected]",
  "phone": "+44-20-7946-0958"
}

About

Entity-Anonymizer-Plugin is a powerful and easy-to-use plugin designed for SAP Cloud Application Programming (CAP) projects. It replaces sensitive property names on entities with generic values, ensuring data privacy and security throughout your application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published