class Triki
- Triki
- Reference
- Object
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.crtriki/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
-
.new(configuration = ConfigHash.new)
Make a new Triki object.
Instance Method Summary
- #check_for_defined_columns_not_in_table(table_name, columns)
- #check_for_table_columns_not_in_definition(table_name, columns)
- #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)
- #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))
- #database_helper
- #database_type : Symbol
- #database_type=(database_type : Symbol)
- #extra_column_list(table_name : String, columns : Array(String))
- #fail_on_unspecified_columns=(fail_on_unspecified_columns : Bool)
- #fail_on_unspecified_columns? : Bool
- #faker : Triki::Faker.class
- #faker=(faker : ::Triki::Faker.class)
- #globally_kept_columns : Array(String)
- #globally_kept_columns=(globally_kept_columns : Array(String))
- #missing_column_list(table_name : String, columns : Array(String)) : Array
-
#obfuscate(input_io, output_io)
Read an input stream and dump out an obfuscated output stream.
- #obfuscate_bulk_insert_statement(line, table_name : String, columns : ColumnList, ignore = false)
- #reassembling_each_insert(line : String, table_name : String, columns, ignore = false, &)
-
#scaffold(input_io, output_io)
Read an input stream and dump out a config file scaffold.
- #scaffolded_tables : Hash(String, Int32)
- #scaffolded_tables=(scaffolded_tables : Hash(String, Int32))
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.
Instance Method Detail
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)
#
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))
#
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.
def obfuscate_bulk_insert_statement(line, table_name : String, columns : ColumnList, ignore = false)
#
def reassembling_each_insert(line : String, table_name : String, columns, ignore = false, &)
#
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.