(401) 515-5115 moc.sbalnrubkcalb@ofni

Parse Platform Auditor

Add automated auditing/versioning to Parse Server classes.

Audit, Version, Track: Fast, lightweight, & easy data automation.

Tracking data changes and access logs is critical for many regulatory requirements, such as HIPAA compliance. With just a few lines of code you can add full data manipulation and access auditing to any class in your Parse Server powered app.

Installation

You can install this API using NPM. This API must run as a part of your Parse Platform app’s cloud code. Simply add parse-auditor to you cloud code’s package.json file: 

Cloud Cloud Installation (cloud/package.json)

{
  "dependencies": {
    "parse-auditor": "*"
  }
}

Usage

You can use parse-auditor anywhere you can use other cloud code hooks, such as Parse.Cloud.beforeSave(). 

Track Modifications

Automatically add auditing capabilities to any of your classes by passing them into parse-auditor:

const ParseAuditor = require('parse-auditor');
ParseAuditor(['Patient', 'Clinic'])

This will track all edits to these classes (creates, updates, deletes) in classes named Patient_AUD & Clinic_AUD respectively.

Track Reads

Automatically add view auditing capabilities to any of your classes by passing them into parse-auditor as a second array:

const ParseAuditor = require('./parse-auditor.js');
ParseAuditor(['Patient', 'Clinic'], ['Patient'])

This will not only track all edits to these classes (creates, updates, deletes) but any views to a Patient will also be tracked. This will all be logged in classes named Patient_AUD & Clinic_AUD respectively.

Configuation

You can configure how parse-audit tracks data.

1. Config Object

Pass a confgi object as the third argument to parse-auditor:

const ParseAuditor = require('parse-auditor');
ParseAuditor(['Patient', 'Clinic'], ['Patient'], myConfig)

The config object is structured as follows:

{
    classPrefix: '',
    classPostfix: '_AUD',
    fieldPrefix: 'meta_',
    fieldPostfix: '',
    parseSDK: Parse,
}

Example

Custom Configuration:

const ParseAuditor = require('./parse-auditor.js');
ParseAuditor(['Patient', 'Clinic'], ['Patient'], { classPostfix: '_HISTORY' })

This will track all edits to these classes (creates, updates, deletes) as well as any views to a Patient. This will all be logged in classes named Patient_HISTORY & Clinic_HISTORY respectively.

Request a Feature or Open a Ticket

This project is sponsored and supported by Blackburn Labs. Please feel free to reach out to us if you need help or would like to suggest a feature.

Need a Parse Developer?