add tests
This commit is contained in:
committed by
Markus Mäkelä
parent
dbfd631fed
commit
8c6ca38a8a
76
maxscale-system-test/masking/masking_user/masking_rules.json
Normal file
76
maxscale-system-test/masking/masking_user/masking_rules.json
Normal 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'" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
Reference in New Issue
Block a user