Skip to content

Commit

Permalink
fix: update classification patterns (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsapet committed Nov 14, 2022
1 parent 7eb9f89 commit 7ba6125
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"metadata": { "version": "1.0" },
"id": 104,
"data_type_uuid": "e07133d8-b62b-47ed-abcd-9c9d189b362a",
"exclude_regexp": "\\b((notification|config(uration)?|template|enabled|settings?|sent\\s?by|type))\\b",
"exclude_regexp": "\\b(notification|config(uration)?|template|enabled|settings?|sent\\s?by|type|required)\\b",
"exclude_types": ["boolean", "date"],
"friendly_name": "Emails",
"health_context_data_type_uuid": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"metadata": { "version": "1.0" },
"id": 1,
"data_type_uuid": "22e24c62-82d3-4b72-827c-e261533331bd",
"exclude_regexp": "\\b(.*(notification|config(uration)?|template|enabled|token|reminder|subject|body|handover|sent.by|settings?|accept|label|id|voice|type).*)\\b",
"exclude_regexp": "\\b(.*(notification|config(uration)?|template|enabled|token|reminder|subject|body|handover|sent.by|settings?|accept|label|id|voice|type).*|required)\\b",
"exclude_types": ["boolean", "date", "bool"],
"friendly_name": "Email Address",
"health_context_data_type_uuid": null,
"include_regexp": "\b.*email.*\b",
"include_regexp": "\\b.*email.*\\b",
"include_types": ["object", "string"],
"match_column": true,
"match_object": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"metadata": { "version": "1.0" },
"id": 2,
"data_type_uuid": "22e24c62-82d3-4b72-827c-e261533331bd",
"exclude_regexp": "\\b(.*notification|config(uration)?|template|enabled|accept|label|token|reminder|subject|body|handover|sent.by|settings?|id|voicemail.*)\\b",
"exclude_regexp": "\\b(.*notification|config(uration)?|template|enabled|accept|label|token|reminder|subject|body|handover|sent.by|settings?|id|voicemail.*|required)\\b",
"exclude_types": ["boolean", "date", "bool"],
"friendly_name": "Email Address",
"health_context_data_type_uuid": null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"metadata": {
"version": "1.0"
},
"metadata": { "version": "1.0" },
"id": 60,
"data_type_uuid": "da48dfad-7322-411b-988d-5bde0d7bc659",
"exclude_regexp": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"metadata": { "version": "1.0" },
"id": 99,
"data_type_uuid": "02bb0d3a-2c8c-4842-be1c-c057f0dccd63",
"exclude_regexp": "\\b(token)|(.*config.*)\\b",
"exclude_regexp": "\\b(token)|(.*config.*)|(request)|(reset)|(required)|((mis)?match)|(forgot)|(success)|(retrieval)|(minimum)|(length)|(changed)\\b",
"exclude_types": ["boolean", "date", "number"],
"friendly_name": "Passwords",
"health_context_data_type_uuid": null,
Expand Down
8 changes: 4 additions & 4 deletions scripts/data_type_classification_patterns.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": 1,
"data_type_uuid": "22e24c62-82d3-4b72-827c-e261533331bd",
"exclude_regexp": "\\b(.*(notification|config(uration)?|template|enabled|token|reminder|subject|body|handover|sent.by|settings?|accept|label|id|voice|type).*)\\b",
"exclude_regexp": "\\b(.*(notification|config(uration)?|template|enabled|token|reminder|subject|body|handover|sent.by|settings?|accept|label|id|voice|type).*|required)\\b",
"exclude_types": ["boolean", "date", "bool"],
"friendly_name": "Email Address",
"health_context_data_type_uuid": null,
Expand All @@ -15,7 +15,7 @@
{
"id": 2,
"data_type_uuid": "22e24c62-82d3-4b72-827c-e261533331bd",
"exclude_regexp": "\\b(.*notification|config(uration)?|template|enabled|accept|label|token|reminder|subject|body|handover|sent.by|settings?|id|voicemail.*)\\b",
"exclude_regexp": "\\b(.*notification|config(uration)?|template|enabled|accept|label|token|reminder|subject|body|handover|sent.by|settings?|id|voicemail.*|required)\\b",
"exclude_types": ["boolean", "date", "bool"],
"friendly_name": "Email Address",
"health_context_data_type_uuid": null,
Expand Down Expand Up @@ -1250,7 +1250,7 @@
{
"id": 99,
"data_type_uuid": "02bb0d3a-2c8c-4842-be1c-c057f0dccd63",
"exclude_regexp": "\\b(token)|(.*config.*)\\b",
"exclude_regexp": "\\b(token)|(.*config.*)|(request)|(reset)|(required)|((mis)?match)|(forgot)|(success)|(retrieval)|(minimum)|(length)|(changed)\\b",
"exclude_types": ["boolean", "date", "number"],
"friendly_name": "Passwords",
"health_context_data_type_uuid": null,
Expand Down Expand Up @@ -1315,7 +1315,7 @@
{
"id": 104,
"data_type_uuid": "e07133d8-b62b-47ed-abcd-9c9d189b362a",
"exclude_regexp": "\\b((notification|config(uration)?|template|enabled|settings?|sent\\s?by|type))\\b",
"exclude_regexp": "\\b(notification|config(uration)?|template|enabled|settings?|sent\\s?by|type|required)\\b",
"exclude_types": ["boolean", "date"],
"friendly_name": "Emails",
"health_context_data_type_uuid": null,
Expand Down
2 changes: 1 addition & 1 deletion scripts/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# remove spaces in object type
pattern["object_type"] = pattern["object_type"].map { |object_type| object_type.downcase.gsub(" ", "_") }

filename = "pkg/classification/db/data_type_classification_patterns/#{pattern["friendly_name"].downcase.gsub(/\s+/, "_").gsub("/", "_")}.json"
filename = "pkg/classification/db/data_type_classification_patterns/#{pattern["id"]}_#{pattern["friendly_name"].downcase.gsub(/\s+/, "_").gsub("/", "_")}.json"
File.open(filename, "w") do |new_file|
new_file << {metadata: {version: "1.0"}}.merge(pattern).to_json
end
Expand Down

0 comments on commit 7ba6125

Please sign in to comment.