Skip to content

Latest commit

 

History

History
212 lines (141 loc) · 4.41 KB

WorkingWithSrubbersAndAttributes.md

File metadata and controls

212 lines (141 loc) · 4.41 KB

Working with Scrubbers and Attributes

Contents

  1. Scrub Modes
  2. Strings
  3. Decimal
  4. Double
  5. Integer
  6. Long
  7. Short
  8. Misc
  9. Other Attributes
    1. Predefined Value Atr.
    2. Preserve Value Atr.
    3. Stateful Scrub Atr.

This document will go over the available attributes and scrub types ShamWow allows users to leverage when removing PII.

ShamWow supports all primitive types such as

  1. Strings
  2. Decimal
  3. Double
  4. Integer
  5. Long
  6. Short
  7. Byte (Only Arrays)
  8. Arrays of any type above

Scrub Modes

ShamWow offers two types of scrubbing modes, which are pretty self explanatory.

  1. Marked
  2. Full

Marked will only scrub value which have a scrubbing attribute on the property, whereas full mode will scrub any property that is accessible and not null.

Strings

Constructors

//Basic scrub that will default to lorem ipsum text
public ScrubString() { }

//Allows user to select the string scrubber to use
public ScrubString(StringScrubber scrubber) { }

//Allows a user to replace scrubbed text with a redacted string
public ScrubString(StringScrubber scrubber, bool IsRedacted) { }

//Allows a user to define the length for lorem ipsum text
public ScrubString(StringScrubber scrubber, int length) { }

//Alows a user to generate an id or number as a string
public ScrubString(StringScrubber, int minValue, int maxValue) { }

Scrubbers

  1. Address
  2. AddressTwo
  3. City
  4. State
  5. StateCode
  6. Zip
  7. CountyFIPS
  8. CountyName
  9. Phone
  10. Email
  11. DOB
  12. SSN
  13. FullName
  14. FirstName
  15. MiddleName
  16. LastName
  17. UserName
  18. Number

Decimal

Constructors

//Uses default scrub to generate random number
public ScrubDecimal() { }

//Defines a scrubber to use
public ScrubDecimal(DecimalScrubber scrubber) { }

Scrubbers

Currently Decimal scrubbing only supports default at the moment, so no specific scrubbers are defined as of right now.

  1. Default (Currently generates random number)

Double

Constructors

//Uses default scrub to generate random number
public ScrubDouble() { }

//Defines a scrubber to use
public ScrubDouble(DoubleScrubber scrubber) { }

Scrubbers

Currently Double scrubbing only supports default at the moment, so no specific scrubbers are defined as of right now.

  1. Default (Currently generates random number)

Integer

Constructor

//Uses default scrub to generate random number
public ScrubInteger() { }

//Defines a scrubber to use
public ScrubInteger(IntegerScrubber scrubber) { }

Scrubbers

  1. Zip (First 5 only)
  2. Phone
  3. VIN

Long

Constructor

//Uses default scrub to generate random number
public ScrubLong() { }

//Defines a scrubber to use
public ScrubLong(LongScrubber scrubber) { }

Scrubbers

  1. Phone

Short

Constructors

//Uses default scrub to generate random number
public ScrubShort() { }

//Defines a scrubber to use
public ScrubShort(ShortScrubber scrubber) { }

Scrubbers

Currently Short scrubbing only supports default at the moment, so no specific scrubbers are defined as of right now.

  1. Default (Currently generates random number)

Miscellaneous

Byte

The Byte format currently does not support custom scrubbing and does not have an attribute for itself. Currently only Byte Arrays work, which will always be treated as a document.

Arrays

Arrays currently work as treating each of their items as its own individual property and scrubbing them individually then joining them back into an array

Other Scrubbers

PredefinedValue

//Allows a user to define the scrub value before-hand
public PredefinedValue(object value) { }

This scrubber allows a user to create a scrub value to replace the original value within the object.

Note type must be the same as original type

PreserveValue

//Marks the property as do not scrub, leaving the original value intact
public PreserveValue() { }

StatefulScrub

//Allows a user to define a variable name to store scrub state 
public StatefulScrub(string value) { }

This attribute allows a user to define a key that will allow all other properties using the same key to have consistent state across the entire object.