Adding and fixing rules

This commit is contained in:
Luca Frosini 2020-04-06 15:41:42 +02:00
parent 02854fab2c
commit e5ffc25d34
20 changed files with 79 additions and 16 deletions

View File

@ -219,8 +219,8 @@ public class TestRules extends ContextTest {
public void testSingleRule() throws Exception {
allRules();
File rulesDirectory = getRulesDirectory();
File rulesDirFile = new File(rulesDirectory, "StorageHub");
File ruleFile = new File(rulesDirFile, "StorageHub-createItem(FILE).json");
File rulesDirFile = new File(rulesDirectory, "SmartExecutor");
File ruleFile = new File(rulesDirFile, "SmartExecutor-getAvailablePlugins.json");
testRule(ruleFile);
}
@ -228,7 +228,7 @@ public class TestRules extends ContextTest {
public void testAllRuleInAdirectory() throws Exception {
allRules();
File rulesDirectory = getRulesDirectory();
File rulesDirFile = new File(rulesDirectory, "StorageHub");
File rulesDirFile = new File(rulesDirectory, "SmartExecutor");
FilenameFilter filenameFilter = new FilenameFilter() {
@Override

View File

@ -0,0 +1,3 @@
InformationSystem,ICProxy,/gcube/service/GCoreEndpoint/Application/perform-service
InformationSystem,ICProxy,/gcube/service/GCoreEndpoint/InformationSystem/ICProxy
InformationSystem,ICProxy,/gcube/service/HostingNode
1 InformationSystem ICProxy /gcube/service/GCoreEndpoint/Application/perform-service
2 InformationSystem ICProxy /gcube/service/GCoreEndpoint/InformationSystem/ICProxy
3 InformationSystem ICProxy /gcube/service/HostingNode

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "InformationSystem",
"serviceNameRegex": "ICProxy",
"calledMethodRegex": "^(\/){0,1}gcube\/service\/(GCoreEndpoint|HostingNode|RuntimeResource|GenericResource).*"
},
"replace": {
"serviceClass": "InformationSystem",
"serviceName": "ICProxy",
"calledMethod": "query"
}
}

View File

@ -0,0 +1,14 @@
InformationSystem,ICProxy,/gcube/service/&gcube-token=d730d65f-073a-4600-8c7b-326752d61ebf-98187548
InformationSystem,ICProxy,/gcube/service/23d827cd-ba8e-4d8c-9ab4-6303bdb7d1db
InformationSystem,ICProxy,/gcube/service/56ec4876-999f-4afc-a9e3-efbda5f5c8bc
InformationSystem,ICProxy,/gcube/service/78fb3c26-0411-49e3-a244-581591413fa3
InformationSystem,ICProxy,/gcube/service/9151fd89-ae33-4ddb-ac6b-c4e4c85376d6-98187548
InformationSystem,ICProxy,/gcube/service/a074d80d-d339-490c-a9bb-1055576530a9
InformationSystem,ICProxy,/gcube/service/ab9d32c9-...
InformationSystem,ICProxy,/gcube/service/ab9d32c9-9425-42f1-99d7-50d68e651e9c
InformationSystem,ICProxy,/gcube/service/c96d4477-236c-4f98-ba7d-7897991ef412
InformationSystem,ICProxy,/gcube/service/cdc52c27-6d7b-4d55-b4cd-314d7cc2e224
InformationSystem,ICProxy,/gcube/service/dc8cc938-24f9-4aaf-aac2-397817b8798a
InformationSystem,ICProxy,/gcube/service/df24b57c-0a9d-40fe-846e-ef0a94b89389
InformationSystem,ICProxy,/gcube/service/resource/c96d4477-236c-4f98-ba7d-7897991ef412
InformationSystem,ICProxy,/gcube/service/Resource/c0594b4e-107c-4c9f-bd00-818b68298aa4
1 InformationSystem ICProxy /gcube/service/&gcube-token=d730d65f-073a-4600-8c7b-326752d61ebf-98187548
2 InformationSystem ICProxy /gcube/service/23d827cd-ba8e-4d8c-9ab4-6303bdb7d1db
3 InformationSystem ICProxy /gcube/service/56ec4876-999f-4afc-a9e3-efbda5f5c8bc
4 InformationSystem ICProxy /gcube/service/78fb3c26-0411-49e3-a244-581591413fa3
5 InformationSystem ICProxy /gcube/service/9151fd89-ae33-4ddb-ac6b-c4e4c85376d6-98187548
6 InformationSystem ICProxy /gcube/service/a074d80d-d339-490c-a9bb-1055576530a9
7 InformationSystem ICProxy /gcube/service/ab9d32c9-...
8 InformationSystem ICProxy /gcube/service/ab9d32c9-9425-42f1-99d7-50d68e651e9c
9 InformationSystem ICProxy /gcube/service/c96d4477-236c-4f98-ba7d-7897991ef412
10 InformationSystem ICProxy /gcube/service/cdc52c27-6d7b-4d55-b4cd-314d7cc2e224
11 InformationSystem ICProxy /gcube/service/dc8cc938-24f9-4aaf-aac2-397817b8798a
12 InformationSystem ICProxy /gcube/service/df24b57c-0a9d-40fe-846e-ef0a94b89389
13 InformationSystem ICProxy /gcube/service/resource/c96d4477-236c-4f98-ba7d-7897991ef412
14 InformationSystem ICProxy /gcube/service/Resource/c0594b4e-107c-4c9f-bd00-818b68298aa4

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "InformationSystem",
"serviceNameRegex": "ICProxy",
"calledMethodRegex": "^(\/){0,1}gcube\/service\/(?!GCoreEndpoint|HostingNode|RuntimeResource|GenericResource).*"
},
"replace": {
"serviceClass": "InformationSystem",
"serviceName": "ICProxy",
"calledMethod": "read"
}
}

View File

@ -4,3 +4,4 @@ VREManagement,SmartExecutor,GET /plugins/
VREManagement,smart-executor,getAvailablePlugins
VREManagement,smart-executor,GET /plugins
VREManagement,smart-executor,GET /plugins/
VREManagement,SmartExecutor,/plugins

1 VREManagement SmartExecutor getAvailablePlugins
4 VREManagement smart-executor getAvailablePlugins
5 VREManagement smart-executor GET /plugins
6 VREManagement smart-executor GET /plugins/
7 VREManagement SmartExecutor /plugins

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "VREManagement",
"serviceNameRegex": "(SmartExecutor)|(smart-executor)",
"calledMethodRegex": ".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))"
"calledMethodRegex": ".*((getAvailablePlugins.*)|(^(GET ){0,1}(\/){0,1}plugins(\/){0,1}$))"
},
"replace": {
"serviceClass": "VREManagement",

View File

@ -6,3 +6,5 @@ VREManagement,smart-executor,GET /plugins/accounting-dashboard-harvester-se-plug
VREManagement,smart-executor,GET /plugins/accounting-dashboard-harvester-se-plugin/executions/
VREManagement,SmartExecutor,/rest/plugins/HelloWorld
VREManagement,SmartExecutor,/plugins/HelloWorld
VREManagement,SmartExecutor,/plugins/social-data-indexer-plugin/executions
VREManagement,SmartExecutor,/plugins/social-data-indexer-plugin/executions/ORPHAN
1 VREManagement SmartExecutor getScheduledExecution
6 VREManagement smart-executor GET /plugins/accounting-dashboard-harvester-se-plugin/executions/
7 VREManagement SmartExecutor /rest/plugins/HelloWorld
8 VREManagement SmartExecutor /plugins/HelloWorld
9 VREManagement SmartExecutor /plugins/social-data-indexer-plugin/executions
10 VREManagement SmartExecutor /plugins/social-data-indexer-plugin/executions/ORPHAN

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "VREManagement",
"serviceNameRegex": "(SmartExecutor)|(smart-executor)",
"calledMethodRegex": ".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))|((GET ){0,1}(\/){0,1}(rest\/){0,1}plugins\/[a-zA-Z]{1,})"
"calledMethodRegex": ".*((getScheduledExecution.*)|((GET ){0,1}.*executions(\/(ORPHAN){0,1}){0,1}()$))|((GET ){0,1}(\/){0,1}(rest\/){0,1}plugins\/[0-9a-zA-Z%\\-_]{1,})"
},
"replace": {
"serviceClass": "VREManagement",

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "VREManagement",
"serviceNameRegex": "(SmartExecutor)|(smart-executor)",
"calledMethodRegex": ".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*|((GET ){0,1}(\/){0,1}(rest\/){0,1}plugins\/[a-zA-Z]{1,}\/.*)"
"calledMethodRegex": ".*((getStateEvolution)|(getState)|(GET .*executions\/(?!executions).{1,})).*|((GET ){0,1}(\/){0,1}(rest\/){0,1}plugins\/[0-9a-zA-Z%\\-_]{1,}\/(?!executions).*)"
},
"replace": {
"serviceClass": "VREManagement",

View File

@ -71,3 +71,4 @@ Portal,SocialNetworking,/rest/2/vres/get-my-vres
Portal,SocialNetworking,/rest/messages/writeMessageToUsers
Portal,SocialNetworking,/rest/users/getUserEmail
Portal,SocialNetworking,/rest/users/getUserFullname
Portal,SocialNetworking,/gcube/service/&gcube-token=d730d65f-073a-4600-8c7b-326752d61ebf-98187548
1 Portal SocialNetworking /rest/1/users/get-usernames-by-global-role
71 Portal SocialNetworking /rest/messages/writeMessageToUsers
72 Portal SocialNetworking /rest/users/getUserEmail
73 Portal SocialNetworking /rest/users/getUserFullname
74 Portal SocialNetworking /gcube/service/&gcube-token=d730d65f-073a-4600-8c7b-326752d61ebf-98187548

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "Portal",
"serviceNameRegex": "SocialNetworking",
"calledMethodRegex": "\/{0,1}rest\/((1|2)\/){0,1}(((users(\/2){0,1})|comments|full-text-search|hashtags|messages|notifications|people|posts|tokens|vres|vers)\/){0,1}(?<Method>[a-zA-Z\\-]*(\/){0,1})"
"calledMethodRegex": "\/{0,1}rest\/((1|2)\/){0,1}(((people){0,1}(users(\/2){0,1})|comments|full-text-search|hashtags|messages|notifications|people|posts|tokens|vres|vers)\/){0,1}(?<Method>[a-zA-Z\\-]*(\/){0,1})"
},
"replace": {
"serviceClass": "Portal",

View File

@ -1,6 +1,6 @@
{
"match": {
"serviceClassRegex": "SDI",
"serviceClassRegex": "SDI|DataAnalysis",
"serviceNameRegex": "Thredds",
"calledMethodRegex": "^(?!.*((\/public\/netcdf\/)|(::))).*$"
},

View File

@ -0,0 +1 @@
DataAnalysis,data-analytics-visualization,/
1 DataAnalysis data-analytics-visualization /

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "DataAnalysis",
"serviceNameRegex": "data-analytics-visualization",
"calledMethodRegex": ".*"
},
"replace": {
"serviceClass": "DataAnalysis",
"serviceName": "data-analytics-visualization",
"calledMethod": "OTHER"
}
}

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "(DataCatalogue)|(DataPublishing)",
"serviceNameRegex": "(science-catalogue)|(gcat)|(gCat)",
"calledMethodRegex": "(\/index)|OTHER|UNKNOWN"
"calledMethodRegex": "(^\/index$)|OTHER|UNKNOWN"
},
"replace": {
"serviceClass": "DataPublishing",

View File

@ -8,6 +8,11 @@ DataCatalogue,science-catalogue,/items/restful_transaction_model
DataCatalogue,science-catalogue,/organizations/algorithms
DataCatalogue,science-catalogue,/organizations/aquamaps1
DataCatalogue,science-catalogue,/profiles/Empty%20Profile
DataCatalogue,science-catalogue,/rest/api/items/create
DataCatalogue,gcat,/profiles/SoBigData.eu%3A%20Application%20Metadata
DataCatalogue,gcat,/profiles/SoBigData.eu%3A%20Dataset%20Metadata
DataCatalogue,gcat,/profiles/SoBigData.eu%3A%20Method%20Metadata
DataCatalogue,gcat,/profiles/SoBigData.eu%3A%2520Dataset%2520Metadata
DataCatalogue,gcat,/profiles/SoBigData.eu%3A+Dataset+Metadata
DataCatalogue,gcat,/profiles/SoBigData.eu:%20Dataset%20Metadata
DataCatalogue,science-catalogue,/users/andrearossi
DataCatalogue,science-catalogue,/users/luca_frosini
1 DataCatalogue science-catalogue /groups/ABCD
8 DataCatalogue science-catalogue /organizations/algorithms
9 DataCatalogue science-catalogue /organizations/aquamaps1
10 DataCatalogue science-catalogue /profiles/Empty%20Profile
11 DataCatalogue science-catalogue gcat /rest/api/items/create /profiles/SoBigData.eu%3A%20Application%20Metadata
12 DataCatalogue gcat /profiles/SoBigData.eu%3A%20Dataset%20Metadata
13 DataCatalogue gcat /profiles/SoBigData.eu%3A%20Method%20Metadata
14 DataCatalogue gcat /profiles/SoBigData.eu%3A%2520Dataset%2520Metadata
15 DataCatalogue gcat /profiles/SoBigData.eu%3A+Dataset+Metadata
16 DataCatalogue gcat /profiles/SoBigData.eu:%20Dataset%20Metadata
17 DataCatalogue science-catalogue /users/andrearossi
18 DataCatalogue science-catalogue /users/luca_frosini

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "(DataCatalogue)|(DataPublishing)",
"serviceNameRegex": "(science-catalogue)|(gcat)|(gCat)",
"calledMethodRegex": "(\/){0,1}(rest\/(api\/){0,1}){0,1}(?<Collection>group|item|license|namespace|organization|profile|user)s\/(?!list)[%0-9a-zA-Z\\-_]*$"
"calledMethodRegex": "^(\/){0,1}(rest\/(api\/){0,1}){0,1}(?<Collection>group|item|license|namespace|organization|profile|user)s\/(?!list|create)[%0-9a-zA-Z\\-_.+:]*$"
},
"replace": {
"serviceClass": "DataPublishing",

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "(DataCatalogue)|(DataPublishing)",
"serviceNameRegex": "(science-catalogue)|(gcat)|(gCat)",
"calledMethodRegex": "(\/){0,1}(rest\/(api\/){0,1}){0,1}items\/[%0-9a-zA-Z\\-_]*\/resources\/[%0-9a-zA-Z\\-_]*$"
"calledMethodRegex": "^(\/){0,1}(rest\/(api\/){0,1}){0,1}items\/[%0-9a-zA-Z\\-_]*\/resources\/[%0-9a-zA-Z\\-_.+:]*$"
},
"replace": {
"serviceClass": "DataPublishing",

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "(DataCatalogue)|(DataPublishing)",
"serviceNameRegex": "(science-catalogue)|(gcat)|(gCat)",
"calledMethodRegex": "(\/){0,1}(rest\/(api\/){0,1}){0,1}items\/[%0-9a-zA-Z\\-_]*\/resources$"
"calledMethodRegex": "^(\/){0,1}(rest\/(api\/){0,1}){0,1}items\/[%0-9a-zA-Z\\-_.+:]*\/resources$"
},
"replace": {
"serviceClass": "DataPublishing",