class Triki

Overview

Class for obfuscating MySQL dumps. This can parse mysqldump outputs when using the -c option, which includes column names in the insert statements.

Defined in:

triki.cr
triki/base.cr
triki/config_applicator.cr
triki/config_parser.cr
triki/config_scaffold_generator.cr
triki/english_dictionary.cr
triki/faker.cr
triki/insert_statement_parser.cr
triki/mysql.cr
triki/postgres.cr
triki/sql_server.cr
triki/version.cr

Constant Summary

Log = begin backend = ::Log::IOBackend.new(STDERR) ::Log.builder.bind("*", :warn, backend) ::Log.for(self) end
NUMBER_CHARS = "1234567890"
SENSIBLE_CHARS = USERNAME_CHARS + "+-=[{]}/?|!@#$%^&*()`~"
USERNAME_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_" + NUMBER_CHARS
VERSION = "0.3.2"

Constructors

Instance Method Summary

Constructor Detail

def self.new(configuration = ConfigHash.new) #

Make a new Triki object. Pass in a configuration structure to define how the obfuscation should be performed. See the README.rdoc file for more information.


[View source]

Instance Method Detail

def check_for_defined_columns_not_in_table(table_name, columns) #

[View source]
def check_for_table_columns_not_in_definition(table_name, columns) #

[View source]
def config : Hash(String, Hash(String, Hash(Symbol, Array(Regex) | Array(String) | Bool | Int32 | Hash(String, Int32 | String | Nil) -> Int32 | String | Nil | Hash(String, Int32 | String | Nil) -> Bool | -> String | Range(Int32, Int32) | String | Symbol) | Symbol) | Symbol) #

[View source]
def config=(config : Hash(String, Hash(String, Hash(Symbol, Array(Regex) | Array(String) | Bool | Int32 | Hash(String, Int32 | String | Nil) -> Int32 | String | Nil | Hash(String, Int32 | String | Nil) -> Bool | -> String | Range(Int32, Int32) | String | Symbol) | Symbol) | Symbol)) #

[View source]
def database_helper #

[View source]
def database_type : Symbol #

[View source]
def database_type=(database_type : Symbol) #

[View source]
def extra_column_list(table_name : String, columns : Array(String)) #

[View source]
def fail_on_unspecified_columns=(fail_on_unspecified_columns : Bool) #

[View source]
def fail_on_unspecified_columns? : Bool #

[View source]
def faker : Triki::Faker.class #

[View source]
def faker=(faker : ::Triki::Faker.class) #

[View source]
def globally_kept_columns : Array(String) #

[View source]
def globally_kept_columns=(globally_kept_columns : Array(String)) #

[View source]
def missing_column_list(table_name : String, columns : Array(String)) : Array #

[View source]
def obfuscate(input_io, output_io) #

Read an input stream and dump out an obfuscated output stream. These streams could be any class implementing IO abstract class. or STDIN and STDOUT.


[View source]
def obfuscate_bulk_insert_statement(line, table_name : String, columns : ColumnList, ignore = false) #

[View source]
def reassembling_each_insert(line : String, table_name : String, columns, ignore = false, &) #

[View source]
def scaffold(input_io, output_io) #

Read an input stream and dump out a config file scaffold. These streams could be any class implementing IO abstract class. or STDIN and STDOUT.


[View source]
def scaffolded_tables : Hash(String, Int32) #

[View source]
def scaffolded_tables=(scaffolded_tables : Hash(String, Int32)) #

[View source]