3
3
from dblinter .function_library import FunctionLibrary
4
4
from dblinter .sarif_document import SarifDocument
5
5
6
+
6
7
def test_table_with_sensitive_column (postgres_instance_args ) -> None :
7
8
args = postgres_instance_args
8
9
db = DatabaseConnection (args )
@@ -16,11 +17,11 @@ def test_table_with_sensitive_column(postgres_instance_args) -> None:
16
17
fixes = [
17
18
"Install extension anon, and create some masking rules on." ,
18
19
],
19
- message = "{0} have column {1} (category {2}) that can be consider has sensitive. It should be masked for non data-operator users."
20
+ message = "{0} have column {1} (category {2}) that can be consider has sensitive. It should be masked for non data-operator users." ,
20
21
)
21
22
function_library = FunctionLibrary ()
22
- db .query (' select anon.init()' )
23
- db .query (' CREATE TABLE test (id integer, creditcard text)' )
23
+ db .query (" select anon.init()" )
24
+ db .query (" CREATE TABLE test (id integer, creditcard text)" )
24
25
sarif_document = SarifDocument ()
25
26
function_library .get_function_by_function_name ("table_with_sensible_column" )(
26
27
function_library , db , [], context , ("public" , "test" ), sarif_document
@@ -34,6 +35,7 @@ def test_table_with_sensitive_column(postgres_instance_args) -> None:
34
35
== "postgres.public.test have column id (category account_id) that can be consider has sensitive. It should be masked for non data-operator users."
35
36
)
36
37
38
+
37
39
def test_table_without_sensitive_column (postgres_instance_args ) -> None :
38
40
args = postgres_instance_args
39
41
db = DatabaseConnection (args )
@@ -47,11 +49,11 @@ def test_table_without_sensitive_column(postgres_instance_args) -> None:
47
49
fixes = [
48
50
"Install extension anon, and create some masking rules on." ,
49
51
],
50
- message = "{0} have column {1} (category {2}) that can be consider has sensitive. It should be masked for non data-operator users."
52
+ message = "{0} have column {1} (category {2}) that can be consider has sensitive. It should be masked for non data-operator users." ,
51
53
)
52
54
function_library = FunctionLibrary ()
53
- db .query (' select anon.init()' )
54
- db .query (' CREATE TABLE test (test_id integer, description text)' )
55
+ db .query (" select anon.init()" )
56
+ db .query (" CREATE TABLE test (test_id integer, description text)" )
55
57
sarif_document = SarifDocument ()
56
58
function_library .get_function_by_function_name ("table_with_sensible_column" )(
57
59
function_library , db , [], context , ("public" , "test" ), sarif_document
0 commit comments