From a59c89ae8f85584bc38fe604133bdebf507f6f69 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 25 Mar 2020 14:57:47 +0100 Subject: [PATCH] Fixed rules and added new ones --- .../validations/validators/TestRules.java | 10 ++-- .../Catalogue-WS-listOrganizations.csv | 13 +++++ ...on => Catalogue-WS-listOrganizations.json} | 2 +- .../Catalogue-WS-organizations.csv | 4 -- .../Catalogue-WS-showOrganizations.csv | 6 +++ .../Catalogue-WS-showOrganizations.json | 12 +++++ .../rules/DataMiner-ServiceClass-rewrite.json | 12 +++++ .../rules/FHNManager/FHNManager-OTHER.csv | 4 ++ .../rules/FHNManager/FHNManager-OTHER.json | 12 +++++ .../rules/GeoNetwork/GeoNetwork-read.json | 2 +- .../HomeLibraryFileSystem-OTHER.csv | 12 +++++ .../HomeLibraryFileSystem-OTHER.json | 12 +++++ .../{allRules.json => allRules.json.full} | 50 +++++++++++++++++-- src/test/resources/rules/allRules.json.min | 1 + src/test/resources/rules/allRules.min.json | 1 - .../resources/rules/generate-all-rules.sh | 20 ++++---- .../geoanalytics-gos-OTHER.csv | 40 ++++++++++++++- .../geoanalytics-gos-OTHER.json | 2 +- 18 files changed, 188 insertions(+), 27 deletions(-) create mode 100644 src/test/resources/rules/Catalogue-WS/Catalogue-WS-listOrganizations.csv rename src/test/resources/rules/Catalogue-WS/{Catalogue-WS-organizations.json => Catalogue-WS-listOrganizations.json} (97%) delete mode 100644 src/test/resources/rules/Catalogue-WS/Catalogue-WS-organizations.csv create mode 100644 src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.csv create mode 100644 src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.json create mode 100644 src/test/resources/rules/DataMiner-ServiceClass-rewrite.json create mode 100644 src/test/resources/rules/FHNManager/FHNManager-OTHER.csv create mode 100644 src/test/resources/rules/FHNManager/FHNManager-OTHER.json create mode 100644 src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.csv create mode 100644 src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.json rename src/test/resources/rules/{allRules.json => allRules.json.full} (93%) create mode 100644 src/test/resources/rules/allRules.json.min delete mode 100644 src/test/resources/rules/allRules.min.json diff --git a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java index 5b1efb3..2f04418 100644 --- a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java +++ b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java @@ -216,8 +216,8 @@ public class TestRules extends ContextTest { public void testSingleRule() throws Exception { allRules(); File rulesDirectory = getRulesDirectory(); - File rulesDirFile = new File(rulesDirectory, "AllServices"); - File rulesFile = new File(rulesDirFile, "AllServices-OTHER.json"); + File rulesDirFile = new File(rulesDirectory, "geoanalytics-gos"); + File rulesFile = new File(rulesDirFile, "geoanalytics-gos-OTHER.json"); testRule(rulesFile); } @@ -233,13 +233,13 @@ public class TestRules extends ContextTest { @Test public void testMatcherReplace() throws Exception { File rulesDirectory = getRulesDirectory(); - File rulesDirFile = new File(rulesDirectory, "FullTextIndexNode"); - File rulesFile = new File(rulesDirFile, "FullTextIndexNode-OTHER.json"); + File rulesDirFile = new File(rulesDirectory, "geoanalytics-gos"); + File rulesFile = new File(rulesDirFile, "geoanalytics-gos-OTHER.json"); ObjectMapper mapper = DSMapper.getObjectMapper(); MatcherReplace matcherReplace = mapper.readValue(rulesFile, MatcherReplace.class); - Replace replace = matcherReplace.check("Index","FullTextIndexNode","/delete/1b9c6e34baddd4cebe9215fd381a63f4f17957f3463f94675c9d656148b99311/oai:archimer.ifremer.fr:11267"); + Replace replace = matcherReplace.check("geoanalytics","geoanalytics-gos-gos","/ShapeManagement/applyOnView"); logger.info("{}", replace); diff --git a/src/test/resources/rules/Catalogue-WS/Catalogue-WS-listOrganizations.csv b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-listOrganizations.csv new file mode 100644 index 0000000..8c78414 --- /dev/null +++ b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-listOrganizations.csv @@ -0,0 +1,13 @@ +Data-Catalogue,Catalogue-WS,/rest/api/organisations/list +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list +Data-Catalogue,Catalogue-WS,/rest/api/organisation/list +Data-Catalogue,Catalogue-WS,/rest/api/organization/list +Data-Catalogue,Catalogue-WS,/rest/api/organisations/list/ +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list%3fall_fields +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list%3fall_fields=true +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list%3finclude_dataset_count +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list%3finclude_dataset_count=true +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list%3flimit=2 +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list%3foffset=2 +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list%3forder_by=name +Data-Catalogue,Catalogue-WS,/rest/api/organizations/list/%3finclude_dataset_count=true \ No newline at end of file diff --git a/src/test/resources/rules/Catalogue-WS/Catalogue-WS-organizations.json b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-listOrganizations.json similarity index 97% rename from src/test/resources/rules/Catalogue-WS/Catalogue-WS-organizations.json rename to src/test/resources/rules/Catalogue-WS/Catalogue-WS-listOrganizations.json index 85ae342..fc64267 100644 --- a/src/test/resources/rules/Catalogue-WS/Catalogue-WS-organizations.json +++ b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-listOrganizations.json @@ -2,7 +2,7 @@ "match": { "serviceClassRegex": "(Data-Catalogue)|(DataPublishing)", "serviceNameRegex": "Catalogue-WS", - "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/list" + "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/list.*" }, "replace": { "serviceClass": "DataPublishing", diff --git a/src/test/resources/rules/Catalogue-WS/Catalogue-WS-organizations.csv b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-organizations.csv deleted file mode 100644 index 6baecbb..0000000 --- a/src/test/resources/rules/Catalogue-WS/Catalogue-WS-organizations.csv +++ /dev/null @@ -1,4 +0,0 @@ -Data-Catalogue,Catalogue-WS,/rest/api/organisations/list -Data-Catalogue,Catalogue-WS,/rest/api/organizations/list -Data-Catalogue,Catalogue-WS,/rest/api/organisation/list -Data-Catalogue,Catalogue-WS,/rest/api/organization/list diff --git a/src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.csv b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.csv new file mode 100644 index 0000000..2b8fbc5 --- /dev/null +++ b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.csv @@ -0,0 +1,6 @@ +Data-Catalogue,Catalogue-WS,/rest/api/organisations/show%3fid=biodiversitylab +Data-Catalogue,Catalogue-WS,/rest/api/organizations/show +Data-Catalogue,Catalogue-WS,/rest/api/organizations/show%3fid=aquamaps +Data-Catalogue,Catalogue-WS,/rest/api/organizations/show%3fid=biodiversitylab +Data-Catalogue,Catalogue-WS,/rest/api/organizations/show%3fid=egip +Data-Catalogue,Catalogue-WS,/rest/api/organizations/show%3fid=organization_name \ No newline at end of file diff --git a/src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.json b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.json new file mode 100644 index 0000000..e2c33fc --- /dev/null +++ b/src/test/resources/rules/Catalogue-WS/Catalogue-WS-showOrganizations.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "(Data-Catalogue)|(DataPublishing)", + "serviceNameRegex": "Catalogue-WS", + "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/show.*" + }, + "replace": { + "serviceClass": "DataPublishing", + "serviceName": "Catalogue-WS", + "calledMethod": "showOrganizations" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-ServiceClass-rewrite.json b/src/test/resources/rules/DataMiner-ServiceClass-rewrite.json new file mode 100644 index 0000000..4c0eef4 --- /dev/null +++ b/src/test/resources/rules/DataMiner-ServiceClass-rewrite.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "(WPS)|(DataAnalysis)", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "(?.*)" + }, + "replace": { + "serviceClass": "DataAnalysis", + "serviceName": "DataMiner", + "calledMethod": "${CalledMethod}" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/FHNManager/FHNManager-OTHER.csv b/src/test/resources/rules/FHNManager/FHNManager-OTHER.csv new file mode 100644 index 0000000..8476ef3 --- /dev/null +++ b/src/test/resources/rules/FHNManager/FHNManager-OTHER.csv @@ -0,0 +1,4 @@ +ResourceManagement,FHNManager,/rest/nodes +ResourceManagement,FHNManager,/rest/resourceTemplate +ResourceManagement,FHNManager,/rest/serviceprofiles +ResourceManagement,FHNManager,/rest/vmproviders diff --git a/src/test/resources/rules/FHNManager/FHNManager-OTHER.json b/src/test/resources/rules/FHNManager/FHNManager-OTHER.json new file mode 100644 index 0000000..790c458 --- /dev/null +++ b/src/test/resources/rules/FHNManager/FHNManager-OTHER.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "ResourceManagement", + "serviceNameRegex": "FHNManager", + "calledMethodRegex": ".*" + }, + "replace": { + "serviceClass": "ResourceManagement", + "serviceName": "FHNManager", + "calledMethod": "OTHER" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/GeoNetwork/GeoNetwork-read.json b/src/test/resources/rules/GeoNetwork/GeoNetwork-read.json index e81dd3c..0e79c20 100644 --- a/src/test/resources/rules/GeoNetwork/GeoNetwork-read.json +++ b/src/test/resources/rules/GeoNetwork/GeoNetwork-read.json @@ -2,7 +2,7 @@ "match": { "serviceClassRegex": "(SDI)|(SpatialData)", "serviceNameRegex": "GeoNetwork", - "calledMethodRegex": ".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(\\..*|\\.*|@json|$)))" + "calledMethodRegex": ".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(?!edit).*))" }, "replace": { "serviceClass": "SDI", diff --git a/src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.csv b/src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.csv new file mode 100644 index 0000000..0d67113 --- /dev/null +++ b/src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.csv @@ -0,0 +1,12 @@ +DataAccess,HomeLibraryFileSystem,/fs/item/29d9a102-802b-4775-b80d-a42730c643cb/download +DataAccess,HomeLibraryFileSystem,/fs/item/5a045ed3040320012fa636ce/download +DataAccess,HomeLibraryFileSystem,/fs/item/6e9b8350-4854-4c22-8aa1-ba2d8135ad6d/move +DataAccess,HomeLibraryFileSystem,/fs/item/7bb0d323-c1e7-4961-aec3-31f4d9c3179c/download +DataAccess,HomeLibraryFileSystem,/fs/item/8c422f87-4329-4543-a6d3-11e64c68192d/move +DataAccess,HomeLibraryFileSystem,/fs/item/ad8ba805-bcc5-4d0e-90c9-53216970b3e6/move +DataAccess,HomeLibraryFileSystem,/fs/item/download/6e9b8350-4854-4c22-8aa1-ba2d8135ad6d +DataAccess,HomeLibraryFileSystem,/fs/list +DataAccess,HomeLibraryFileSystem,/fs/list/byPath +DataAccess,HomeLibraryFileSystem,/fs/list/usingDif +DataAccess,HomeLibraryFileSystem,/fs/usingDif +DataAccess,HomeLibraryFileSystem,OTHER diff --git a/src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.json b/src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.json new file mode 100644 index 0000000..32eb076 --- /dev/null +++ b/src/test/resources/rules/HomeLibraryFileSystem/HomeLibraryFileSystem-OTHER.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "DataAccess", + "serviceNameRegex": "HomeLibraryFileSystem", + "calledMethodRegex": ".*" + }, + "replace": { + "serviceClass": "DataAccess", + "serviceName": "HomeLibraryFileSystem", + "calledMethod": "OTHER" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/allRules.json b/src/test/resources/rules/allRules.json.full similarity index 93% rename from src/test/resources/rules/allRules.json rename to src/test/resources/rules/allRules.json.full index 8b88ac4..a923955 100644 --- a/src/test/resources/rules/allRules.json +++ b/src/test/resources/rules/allRules.json.full @@ -10,6 +10,17 @@ "serviceName": "${ServiceName}", "calledMethod": "OTHER" } +},{ + "match": { + "serviceClassRegex": "(WPS)|(DataAnalysis)", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "(?.*)" + }, + "replace": { + "serviceClass": "DataAnalysis", + "serviceName": "DataMiner", + "calledMethod": "${CalledMethod}" + } },{ "match": { "serviceClassRegex": "Common", @@ -58,7 +69,7 @@ "match": { "serviceClassRegex": "(Data-Catalogue)|(DataPublishing)", "serviceNameRegex": "Catalogue-WS", - "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/list" + "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/list.*" }, "replace": { "serviceClass": "DataPublishing", @@ -76,6 +87,17 @@ "serviceName": "Catalogue-WS", "calledMethod": "OTHER" } +},{ + "match": { + "serviceClassRegex": "(Data-Catalogue)|(DataPublishing)", + "serviceNameRegex": "Catalogue-WS", + "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/show.*" + }, + "replace": { + "serviceClass": "DataPublishing", + "serviceName": "Catalogue-WS", + "calledMethod": "showOrganizations" + } },{ "match": { "serviceClassRegex": "DataAccess", @@ -175,6 +197,17 @@ "serviceName": "data-transfer-service", "calledMethod": "upload" } +},{ + "match": { + "serviceClassRegex": "ResourceManagement", + "serviceNameRegex": "FHNManager", + "calledMethodRegex": ".*" + }, + "replace": { + "serviceClass": "ResourceManagement", + "serviceName": "FHNManager", + "calledMethod": "OTHER" + } },{ "match": { "serviceClassRegex": "(Index)|(DataRetrieval)", @@ -189,7 +222,7 @@ },{ "match": { "serviceClassRegex": "(geoanalytics)|(SDI)", - "serviceNameRegex": "(geoanalytics-gos)|(geoanalytics-gos-gos)", + "serviceNameRegex": "geoanalytics-gos.*", "calledMethodRegex": ".*" }, "replace": { @@ -256,7 +289,7 @@ "match": { "serviceClassRegex": "(SDI)|(SpatialData)", "serviceNameRegex": "GeoNetwork", - "calledMethodRegex": ".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(\\..*|\\.*|@json|$)))" + "calledMethodRegex": ".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(?!edit).*))" }, "replace": { "serviceClass": "SDI", @@ -363,6 +396,17 @@ "serviceName": "GRSFPublisher", "calledMethod": "update" } +},{ + "match": { + "serviceClassRegex": "DataAccess", + "serviceNameRegex": "HomeLibraryFileSystem", + "calledMethodRegex": ".*" + }, + "replace": { + "serviceClass": "DataAccess", + "serviceName": "HomeLibraryFileSystem", + "calledMethod": "OTHER" + } },{ "match": { "serviceClassRegex": "DataAnalysis", diff --git a/src/test/resources/rules/allRules.json.min b/src/test/resources/rules/allRules.json.min new file mode 100644 index 0000000..781deda --- /dev/null +++ b/src/test/resources/rules/allRules.json.min @@ -0,0 +1 @@ +[{"match":{"serviceClassRegex":"(?.*)","serviceNameRegex":"(?.*)","calledMethodRegex":"UNKNOWN"},"replace":{"serviceClass":"${ServiceClass}","serviceName":"${ServiceName}","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"(?.*)"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"${CalledMethod}"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/generate.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"generate"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/retrieve.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"retrieve"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^((e\/)|\/){0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"scopes"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"(^\/rest\/(api\/){0,1}licenses\/list)|(listLicenses)"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listLicenses"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/list.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listOrganizations"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest$|^UNKNOWN$|^OTHER$"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/show.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"showOrganizations"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}DescribeProcess.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"describeProcess"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}GetCapabilities.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}RetrieveResult.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getResult"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}CancelComputation.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"stop"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*Capabilities.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*FileUpload.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"upload"}},{"match":{"serviceClassRegex":"ResourceManagement","serviceNameRegex":"FHNManager","calledMethodRegex":".*"},"replace":{"serviceClass":"ResourceManagement","serviceName":"FHNManager","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Index)|(DataRetrieval)","serviceNameRegex":"(FullTextIndexNode)|(FullTextFullTextIndexNodeNode)","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"FullTextIndexNode","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(geoanalytics)|(SDI)","serviceNameRegex":"geoanalytics-gos.*","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-gos","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-main-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-main-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.create(\\.form){0,1}|\\.insert|\\.xmlinsert\\.form)$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"create"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.delete(\\.batch|@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.list(@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"list"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":"^(?!.*(read|create|insert|delete|list|get|show|info|search|update|edit)).*$|^(.*(updated|editors|pwupdate|(systeminfo.*)|forget-password|getmap.png|(GetCapabilities.*)|(\/codelists\/.*)))$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(?!edit).*))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"read"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.|-|/|package_|open)search(\/.*|unused(.form){0,1}|\\..*|;jsessionid=.*|-.*|$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"search"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.update($|\\.finish)|\\.edit(!{0,1}|\\.save(only){0,1}|\\.commit)$|\\.infoedit$|\\.pwedit$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"update"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^(?!.*\/(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^.*\/(?(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"/${Protocol}","_comment" : "Do not remove the initial / to avoid that wms is replaced with OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*publish-product.*)|(.*create-product.*)|(create)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"create"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*delete-product.*)|(delete)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*get-catalogue-id-(and-url-){0,1}from-name.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"getURLandIdFromName"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*update-product.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"update"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"HomeLibraryFileSystem","calledMethodRegex":".*"},"replace":{"serviceClass":"DataAccess","serviceName":"HomeLibraryFileSystem","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"UNKNOWN|OTHER|^\/{0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"InformationSystem","serviceNameRegex":"(resource-registry)|(joint-resource-registry)","calledMethodRegex":"(?!(listContexts|createContext|readContext|updateContext|deleteContext|listInstances|existInstance|createInstance|readInstance|updateInstance|deleteInstance|createType|readType|addToContext|removeFromContext|query|rawQuery)).*"},"replace":{"serviceClass":"InformationSystem","serviceName":"resource-registry","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"sdi-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"sdi-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataPublishing","serviceNameRegex":"SDMXDataSource.*","calledMethodRegex":".*"},"replace":{"serviceClass":"DataPublishing","serviceName":"SDMXDataSource","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^(?!(\/{0,1}gcube\/service\/){0,1}((connect)|(disconnect)|(project))).*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/project.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"project"}},{"match":{"serviceClassRegex":"(Search)|(DataRetrieval)","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"SimulFishGrowthData","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((launch)|(execute)|(POST .*executions)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"execute"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getAvailablePlugins"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getScheduledExecution"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getState"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*(UNKNOWN)|(OTHER).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((stop)|(unSchedule)|(DELETE)|(PURGE)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"stop"}},{"match":{"serviceClassRegex":"content-management","serviceNameRegex":"storage","calledMethodRegex":".*"},"replace":{"serviceClass":"content-management","serviceName":"storage","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Application|DataAnalysis","serviceNameRegex":"TagMe","calledMethodRegex":"^((e\/)|\/){0,1}tag"},"replace":{"serviceClass":"Application","serviceName":"TagMe","calledMethod":"tag"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*((?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*)(\/){1}(.*\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::${Collection}"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*(\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::OTHER"}}] \ No newline at end of file diff --git a/src/test/resources/rules/allRules.min.json b/src/test/resources/rules/allRules.min.json deleted file mode 100644 index 70dc27a..0000000 --- a/src/test/resources/rules/allRules.min.json +++ /dev/null @@ -1 +0,0 @@ -[{"match":{"serviceClassRegex":"(?.*)","serviceNameRegex":"(?.*)","calledMethodRegex":"UNKNOWN"},"replace":{"serviceClass":"${ServiceClass}","serviceName":"${ServiceName}","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/generate.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"generate"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/retrieve.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"retrieve"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^((e\/)|\/){0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"scopes"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"(^\/rest\/(api\/){0,1}licenses\/list)|(listLicenses)"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listLicenses"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/list"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listOrganizations"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest$|^UNKNOWN$|^OTHER$"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}DescribeProcess.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"describeProcess"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}GetCapabilities.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}RetrieveResult.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getResult"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}CancelComputation.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"stop"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*Capabilities.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*FileUpload.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"upload"}},{"match":{"serviceClassRegex":"(Index)|(DataRetrieval)","serviceNameRegex":"(FullTextIndexNode)|(FullTextFullTextIndexNodeNode)","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"FullTextIndexNode","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(geoanalytics)|(SDI)","serviceNameRegex":"(geoanalytics-gos)|(geoanalytics-gos-gos)","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-gos","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-main-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-main-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.create(\\.form){0,1}|\\.insert|\\.xmlinsert\\.form)$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"create"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.delete(\\.batch|@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.list(@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"list"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":"^(?!.*(read|create|insert|delete|list|get|show|info|search|update|edit)).*$|^(.*(updated|editors|pwupdate|(systeminfo.*)|forget-password|getmap.png|(GetCapabilities.*)|(\/codelists\/.*)))$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(\\..*|\\.*|@json|$)))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"read"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.|-|/|package_|open)search(\/.*|unused(.form){0,1}|\\..*|;jsessionid=.*|-.*|$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"search"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.update($|\\.finish)|\\.edit(!{0,1}|\\.save(only){0,1}|\\.commit)$|\\.infoedit$|\\.pwedit$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"update"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^(?!.*\/(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^.*\/(?(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"/${Protocol}","_comment" : "Do not remove the initial / to avoid that wms is replaced with OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*publish-product.*)|(.*create-product.*)|(create)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"create"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*delete-product.*)|(delete)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*get-catalogue-id-(and-url-){0,1}from-name.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"getURLandIdFromName"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*update-product.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"update"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"UNKNOWN|OTHER|^\/{0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"InformationSystem","serviceNameRegex":"(resource-registry)|(joint-resource-registry)","calledMethodRegex":"(?!(listContexts|createContext|readContext|updateContext|deleteContext|listInstances|existInstance|createInstance|readInstance|updateInstance|deleteInstance|createType|readType|addToContext|removeFromContext|query|rawQuery)).*"},"replace":{"serviceClass":"InformationSystem","serviceName":"resource-registry","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"sdi-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"sdi-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataPublishing","serviceNameRegex":"SDMXDataSource.*","calledMethodRegex":".*"},"replace":{"serviceClass":"DataPublishing","serviceName":"SDMXDataSource","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^(?!(\/{0,1}gcube\/service\/){0,1}((connect)|(disconnect)|(project))).*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/project.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"project"}},{"match":{"serviceClassRegex":"(Search)|(DataRetrieval)","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"SimulFishGrowthData","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((launch)|(execute)|(POST .*executions)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"execute"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getAvailablePlugins"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getScheduledExecution"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getState"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*(UNKNOWN)|(OTHER).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((stop)|(unSchedule)|(DELETE)|(PURGE)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"stop"}},{"match":{"serviceClassRegex":"content-management","serviceNameRegex":"storage","calledMethodRegex":".*"},"replace":{"serviceClass":"content-management","serviceName":"storage","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Application|DataAnalysis","serviceNameRegex":"TagMe","calledMethodRegex":"^((e\/)|\/){0,1}tag"},"replace":{"serviceClass":"Application","serviceName":"TagMe","calledMethod":"tag"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*((?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*)(\/){1}(.*\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::${Collection}"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*(\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::OTHER"}}] \ No newline at end of file diff --git a/src/test/resources/rules/generate-all-rules.sh b/src/test/resources/rules/generate-all-rules.sh index d7654b5..367b4e8 100755 --- a/src/test/resources/rules/generate-all-rules.sh +++ b/src/test/resources/rules/generate-all-rules.sh @@ -1,13 +1,13 @@ #!/bin/bash -echo "[" > allRules.json -cat ./AllServices-OTHER.json >> allRules.json -cat **/*.json >> allRules.json -echo "]" >> allRules.json -sed -i 's/}{/},{/g' allRules.json +echo "[" > allRules.json.full +cat ./*.json >> allRules.json.full +cat **/*.json >> allRules.json.full +echo "]" >> allRules.json.full +sed -i 's/}{/},{/g' allRules.json.full -tr -d '\n' < allRules.json > allRules.min.json -sed -i 's/\t//g' allRules.min.json -sed -i 's/ / /g' allRules.min.json -sed -i 's/": "/":"/g' allRules.min.json -sed -i 's/": {/":{/g' allRules.min.json \ No newline at end of file +tr -d '\n' < allRules.json.full > allRules.json.min +sed -i 's/\t//g' allRules.json.min +sed -i 's/ / /g' allRules.json.min +sed -i 's/": "/":"/g' allRules.json.min +sed -i 's/": {/":{/g' allRules.json.min \ No newline at end of file diff --git a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.csv b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.csv index 545ae52..ecc6572 100644 --- a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.csv +++ b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.csv @@ -35,4 +35,42 @@ geoanalytics,geoanalytics-gos-gos,/ShapeManagement/countShapesOfLayer/{UUID_TO_R geoanalytics,geoanalytics-gos-gos,/ShapeManagement/deleteLayer/{UUID_TO_REPLACE} geoanalytics,geoanalytics-gos-gos,/ShapeManagement/getShapeByID/{UUID_TO_REPLACE} geoanalytics,geoanalytics-gos-gos,/ShapeManagement/insertShapes -geoanalytics,geoanalytics-gos-gos,/ShapeManagement/shapesOfLayerID/{UUID_TO_REPLACE} \ No newline at end of file +geoanalytics,geoanalytics-gos-gos,/ShapeManagement/shapesOfLayerID/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/GeoserverManagement/addGeoserverLayer +SDI,geoanalytics-gos,/GeoserverManagement/addStyle +SDI,geoanalytics-gos,/GeoserverManagement/deleteGeoserverLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/GeoserverManagement/deleteGeoserverLayer/{UUID_TO_REPLACE}/PostGIS +SDI,geoanalytics-gos,/GeoserverManagement/getAllStyles +SDI,geoanalytics-gos,/GeoserverManagement/getFeatureType/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/GeoserverManagement/getGeoserverLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/GeoserverManagement/getGeoserverLayers +SDI,geoanalytics-gos,/GeoserverManagement/getLayerType/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/GeoserverManagement/initializeEnvironment +SDI,geoanalytics-gos,/GeoserverManagement/removeStyle +SDI,geoanalytics-gos,/GeoserverManagement/setDefaultLayerStyle +SDI,geoanalytics-gos,/ShapeManagement/existingLayerIDs +SDI,geoanalytics-gos,/ShapeManagement/applyOnView +SDI,geoanalytics-gos,/ShapeManagement/countShapesOfLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/ShapeManagement/deleteLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/ShapeManagement/getShapeByID/{UUID_TO_REPLACE} +SDI,geoanalytics-gos,/ShapeManagement/insertShapes +SDI,geoanalytics-gos,/ShapeManagement/shapesOfLayerID/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/GeoserverManagement/addGeoserverLayer +SDI,geoanalytics-gos-gos,/GeoserverManagement/addStyle +SDI,geoanalytics-gos-gos,/GeoserverManagement/deleteGeoserverLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/GeoserverManagement/deleteGeoserverLayer/{UUID_TO_REPLACE}/PostGIS +SDI,geoanalytics-gos-gos,/GeoserverManagement/getAllStyles +SDI,geoanalytics-gos-gos,/GeoserverManagement/getFeatureType/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/GeoserverManagement/getGeoserverLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/GeoserverManagement/getGeoserverLayers +SDI,geoanalytics-gos-gos,/GeoserverManagement/getLayerType/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/GeoserverManagement/initializeEnvironment +SDI,geoanalytics-gos-gos,/GeoserverManagement/removeStyle +SDI,geoanalytics-gos-gos,/GeoserverManagement/setDefaultLayerStyle +SDI,geoanalytics-gos-gos,/ShapeManagement/existingLayerIDs +SDI,geoanalytics-gos-gos,/ShapeManagement/applyOnView +SDI,geoanalytics-gos-gos,/ShapeManagement/countShapesOfLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/ShapeManagement/deleteLayer/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/ShapeManagement/getShapeByID/{UUID_TO_REPLACE} +SDI,geoanalytics-gos-gos,/ShapeManagement/insertShapes +SDI,geoanalytics-gos-gos,/ShapeManagement/shapesOfLayerID/{UUID_TO_REPLACE} \ No newline at end of file diff --git a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.json b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.json index c39d5d7..9954f2a 100644 --- a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.json +++ b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-OTHER.json @@ -1,7 +1,7 @@ { "match": { "serviceClassRegex": "(geoanalytics)|(SDI)", - "serviceNameRegex": "(geoanalytics-gos)|(geoanalytics-gos-gos)", + "serviceNameRegex": "geoanalytics-gos.*", "calledMethodRegex": ".*" }, "replace": {