add tests

This commit is contained in:
Timofey Turenko
2017-05-17 18:16:06 +03:00
committed by Markus Mäkelä
parent dbfd631fed
commit 8c6ca38a8a
594 changed files with 48376 additions and 0 deletions

View File

@ -0,0 +1,76 @@
{
"rules": [
{
"replace": {
"column": "a"
},
"with": {
"fill": "X"
}
},
{
"replace": {
"column": "b"
},
"with": {
"fill": "X"
},
"applies_to" : [ "'skysql'" ]
},
{
"replace": {
"column": "c"
},
"with": {
"fill": "X"
},
"applies_to" : [ "'maxskysql'" ]
},
{
"replace": {
"column": "d"
},
"with": {
"fill": "X"
},
"exempted" : [ "'skysql'" ]
},
{
"replace": {
"column": "e"
},
"with": {
"fill": "X"
},
"exempted" : [ "'maxskysql'" ]
},
{
"replace": {
"column": "f"
},
"with": {
"fill": "X"
},
"applies_to" : [ "'skysql'", "'maxskysql'" ]
},
{
"replace": {
"column": "g"
},
"with": {
"fill": "X"
},
"exempted" : [ "'skysql'", "'maxskysql'" ]
},
{
"replace": {
"column": "h"
},
"with": {
"fill": "X"
},
"applies_to" : [ "'skysql'" ],
"exempted" : [ "'maxskysql'" ]
}
]
}

View File

@ -0,0 +1,8 @@
drop database if exists maskingdb;
create database maskingdb;
use maskingdb;
create table masking (a TEXT, b TEXT, c TEXT, d TEXT, e TEXT, f TEXT, g TEXT, h TEXT);
insert into masking values ("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello");
select * from masking;
a b c d e f g h
XXXXX hello XXXXX XXXXX hello XXXXX hello hello

View File

@ -0,0 +1,8 @@
drop database if exists maskingdb;
create database maskingdb;
use maskingdb;
create table masking (a TEXT, b TEXT, c TEXT, d TEXT, e TEXT, f TEXT, g TEXT, h TEXT);
insert into masking values ("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello");
select * from masking;
a b c d e f g h
XXXXX XXXXX hello hello XXXXX XXXXX hello XXXXX

View File

@ -0,0 +1,46 @@
#
# Masking User
#
# See ../masking_rules.json
drop database if exists maskingdb;
create database maskingdb;
use maskingdb;
#
# Each table contains a single column 'a' of a type subject
# to masking.
#
create table masking (a TEXT, b TEXT, c TEXT, d TEXT, e TEXT, f TEXT, g TEXT, h TEXT);
insert into masking values ("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello");
select * from masking;
# With the user skysql
#
# a: XXXXX, because the rule applies to everyone.
# b: XXXXX, because the rule specifically applies to the user 'skysql'
# c: hello, because the rule specifically applies to the user 'maxskysql'
# d: hello, because the rule specifically excludes the user 'skysql'
# e: XXXXX, because the rule applies to everyone except to the user 'maxskysql'
# f: XXXXX, because the rule applies to the user 'skysql' and 'maxskysql'
# g: hello, because the rule specifically does not apply to the users 'skysql' and 'maxskysql'
# h: XXXXX, because the rule specifically applies to the user 'skysql'
#
#a b c d e f g h
#XXXXX XXXXX hello hello XXXXX XXXXX hello XXXXX
# With the user maxskysql
#
# a: XXXXX, because the rule applies to everyone.
# b: hello, because the rule specifically applies to the user 'skysql'
# c: XXXXX, because the rule specifically applies to the user 'maxskysql'
# d: XXXXX, because the rule specifically excludes the user 'skysql'
# e: hello, because the rule applies to everyone except to the user 'maxskysql'
# f: XXXXX, because the rule applies to the user 'skysql' and 'maxskysql'
# g: hello, because the rule specifically does not apply to the users 'skysql' and 'maxskysql'
# h: XXXXX, because the rule specifically applies to the user 'skysql'
#
#a b c d e f g h
#XXXXX hello XXXXX XXXXX hello XXXXX hello hello