masker

package
v1.0.0-beta.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MOBILE_KEYS_EXPOSED_LENGTH = 5
)

Variables

This section is empty.

Functions

func Mask

func Mask(data string, salt string) *string

func NewMsgMasker

func NewMsgMasker(salt string, topic string, config MaskConfig) transformer.MessageTransformer

Types

type MaskConfig

type MaskConfig struct {
	// NonPiiKeys specifies the columns that needs be unmasked
	NonPiiKeys map[string][]string `yaml:"non_pii_keys,omitempty"`

	// ConditionalNonPiiKeys unmasks columns if it matches a list of pattern
	ConditionalNonPiiKeys map[string]interface{} `yaml:"conditional_non_pii_keys,omitempty"`

	// DependentNonPiiKeys unmasks columns based on the values of other columns
	DependentNonPiiKeys map[string]interface{} `yaml:"dependent_non_pii_keys,omitempty"`

	// LengthKeys creates extra column containing the length of original column
	LengthKeys map[string][]string `yaml:"length_keys,omitempty"`

	// MobileKeys creates extra column containing first
	// MOBILE_KEYS_EXPOSED_LENGTH characters exposed in the mobile number
	MobileKeys map[string][]string `yaml:"mobile_keys,omitempty"`

	// MappingPIIKey creates extra column containing hashed values
	MappingPIIKeys map[string][]string `yaml:"mapping_pii_keys"`

	// SortKeys sets the Redshift column to use the column as the SortKey
	SortKeys map[string][]string `yaml:"sort_keys,omitempty"`

	// DistKeys sets the Redshift column to use the column as the DistKey
	DistKeys map[string][]string `yaml:"dist_keys,omitempty"`

	// IncludeTables restrict tables that are allowed to be sinked.
	IncludeTables *[]string `yaml:"include_tables,omitempty"`

	// RegexPatternBooleanKeys helps in keeping free text columns masked
	// and adds boolean columns giving boolean info about the kind of
	// value in the free text column.
	RegexPatternBooleanKeys map[string]interface{} `yaml:"regex_pattern_boolean_keys,omitempty"`
	// contains filtered or unexported fields
}

func NewMaskConfig

func NewMaskConfig(
	homeDir string,
	maskFile string,
	maskFileVersion string,
	gitToken string) (MaskConfig, error)

func (MaskConfig) BoolColumns

func (m MaskConfig) BoolColumns(table, cName string, cValue *string) map[string]*string

BoolColumns returns extra boolean columns for the parent column(free text col) to make analysis on the data contained in parent column possible using the boolean columns

func (MaskConfig) ConditionalNonPiiKey

func (m MaskConfig) ConditionalNonPiiKey(table, cName string) bool

func (MaskConfig) DependentNonPiiKey

func (m MaskConfig) DependentNonPiiKey(table, cName string) bool

func (MaskConfig) DistKey

func (m MaskConfig) DistKey(table, cName string) bool

func (MaskConfig) LengthKey

func (m MaskConfig) LengthKey(table, cName string) bool

func (MaskConfig) MappingPIIKey

func (m MaskConfig) MappingPIIKey(table, cName string) bool

func (MaskConfig) MobileKey

func (m MaskConfig) MobileKey(table, cName string) bool

func (MaskConfig) PerformUnMasking

func (m MaskConfig) PerformUnMasking(table, cName string, cValue *string,
	allColumns map[string]*string) bool

PerformUnMasking checks if unmasking should be done or not

func (MaskConfig) SortKey

func (m MaskConfig) SortKey(table, cName string) bool

type MaskDiff

type MaskDiff interface {
	Diff()
	ModifiedTables() map[string]bool
}

func NewMaskDiffer

func NewMaskDiffer(current MaskConfig, desired MaskConfig) MaskDiff

type MaskDiffer

type MaskDiffer struct {
	// contains filtered or unexported fields
}

func (*MaskDiffer) Diff

func (m *MaskDiffer) Diff()

Diff does the diff between current and desired config and stores the result in modified, removed and added.

func (*MaskDiffer) ModifiedTables

func (m *MaskDiffer) ModifiedTables() map[string]bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL