Fixed StorageHub rules

This commit is contained in:
Luca Frosini 2020-04-06 17:12:43 +02:00
parent e0bbc9268e
commit d771bcb5b0
15 changed files with 87 additions and 11 deletions

View File

@ -228,7 +228,7 @@ public class TestRules extends ContextTest {
public void testAllRuleInAdirectory() throws Exception {
allRules();
File rulesDirectory = getRulesDirectory();
File rulesDirFile = new File(rulesDirectory, "SmartExecutor");
File rulesDirFile = new File(rulesDirectory, "StorageHub");
FilenameFilter filenameFilter = new FilenameFilter() {
@Override

View File

@ -1,3 +1,4 @@
DataAccess,StorageHub,/item/create/byPath
DataAccess,StorageHub,/workspace/items/bc1c9525-43f7-4565-b5ea-0a0f9d7853a0/create/FILE
DataAccess,StorageHub,createItem(FILE)
DataAccess,StorageHub,/workspace/items/bc1c9525-43f7-4565-b5ea-0a0f9d7853a0/create/test-upload
1 DataAccess StorageHub /item/create/byPath
2 DataAccess StorageHub /workspace/items/bc1c9525-43f7-4565-b5ea-0a0f9d7853a0/create/FILE
3 DataAccess StorageHub createItem(FILE)
4 DataAccess StorageHub /workspace/items/bc1c9525-43f7-4565-b5ea-0a0f9d7853a0/create/test-upload

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "(^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/create\/FILE$)|createItem\\(FILE\\)|(\/item\/create\/byPath)"
"calledMethodRegex": "(^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/create\/(FILE|(?!FOLDER).*)$)|createItem\\(FILE\\)|(\/item\/create\/byPath)"
},
"replace": {
"serviceClass": "DataAccess",

View File

@ -0,0 +1 @@
DataAccess,StorageHub,/workspace/items/2240a3dd6c-2c47-4848-bb7b-462e532954a9/create/FOLDER
1 DataAccess StorageHub /workspace/items/2240a3dd6c-2c47-4848-bb7b-462e532954a9/create/FOLDER

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "(^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/create\/FOLDER$)|createItem\\(FOLDER\\)"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "createItem(FOLDER)"
}
}

View File

@ -0,0 +1 @@
DataAccess,StorageHub,/workspace/itams/c141d53d-4cae-4bfc-a6f7-9b8bbd8c0e2b/acls
1 DataAccess StorageHub /workspace/itams/c141d53d-4cae-4bfc-a6f7-9b8bbd8c0e2b/acls

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/(workspace\/){1,2}(item|itam)(s){0,1}\/[0-9a-zA-Z\\-_]*\/acl(s){0,1}(\/){0,1}$|getAcls"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "getAcls"
}
}

View File

@ -7,3 +7,4 @@ DataAccess,StorageHub,/workspace/item/da558346-7d1a-4159-8780-a22e63f3c7dc/
DataAccess,StorageHub,/workspace/items/87bea023-3eed-445b-8c27-4d9d4e5921cc
DataAccess,StorageHub,/workspace/items/790e4c52-fbca-48e9-b267-67ea2ce708c0
DataAccess,StorageHub,getById
DataAccess,StorageHub,/workspace/workspace/items/6fbe6284-dd21-4555-bcae-f20662159e46
1 DataAccess StorageHub /workspace/40a3dd6c-2c47-4848-bb7b-462e532954a9/
7 DataAccess StorageHub /workspace/items/87bea023-3eed-445b-8c27-4d9d4e5921cc
8 DataAccess StorageHub /workspace/items/790e4c52-fbca-48e9-b267-67ea2ce708c0
9 DataAccess StorageHub getById
10 DataAccess StorageHub /workspace/workspace/items/6fbe6284-dd21-4555-bcae-f20662159e46

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/workspace(\/item(s){0,1}){0,1}\/(?!(i$)|count|i{0,1}t(h){0,1}rash|group(s){0,1}|user(s){0,1}|paged|v(re|ere|er)fo(ld|dl)ers{0,1}|((C|c)hi(dl|ld|d)ren))[0-9a-zA-Z\\-_]{1,}(\/){0,1}$|getById"
"calledMethodRegex": "^\/workspace(\/workspace){0,1}(\/item(s){0,1}){0,1}\/(?!(i$)|count|i{0,1}t(h){0,1}rash|group(s){0,1}|user(s){0,1}|paged|v(re|ere|er)fo(ld|dl)ers{0,1}|((C|c)hi(dl|ld|d)ren))[0-9a-zA-Z\\-_]{1,}(\/){0,1}$|getById"
},
"replace": {
"serviceClass": "DataAccess",

View File

@ -0,0 +1,2 @@
DataAccess,StorageHub,/workspace/workspace/items/6fbe6284-dd21-4555-bcae-f20662159e46/version
DataAccess,StorageHub,/workspace/workspace/items/6fbe6284-dd21-4555-bcae-f20662159e46/versions
1 DataAccess StorageHub /workspace/workspace/items/6fbe6284-dd21-4555-bcae-f20662159e46/version
2 DataAccess StorageHub /workspace/workspace/items/6fbe6284-dd21-4555-bcae-f20662159e46/versions

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/(workspace\/){1,2}item(s){0,1}\/[0-9a-zA-Z\\-_]*\/version(s){0,1}(\/){0,1}$|getVersions"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "getVersions"
}
}

View File

@ -1,2 +1,3 @@
DataAccess,StorageHub,/workspace/items/publiclink/E_cb6a04d1-f94b-4c2f-90ed-18c1cee591bc
DataAccess,StorageHub,/workspace/items/publiclink/E_yl9pyk1l/+qF3LnaT17GYrcqp1eg7ZghY9VJUfIk/PIMEGZvJQQZxpQ0jBEOh2eZ
DataAccess,StorageHub,/workspace/publiclink/E_Vm9EWkJIY1hyeGNZTiswWVk5STFmczJ5MnBaakdqWEhVL2hNbUhrVFhZdGlwbG5oM0ZNam0rbllGS1N3bTVubQ==
1 DataAccess StorageHub /workspace/items/publiclink/E_cb6a04d1-f94b-4c2f-90ed-18c1cee591bc
2 DataAccess StorageHub /workspace/items/publiclink/E_yl9pyk1l/+qF3LnaT17GYrcqp1eg7ZghY9VJUfIk/PIMEGZvJQQZxpQ0jBEOh2eZ
3 DataAccess StorageHub /workspace/publiclink/E_Vm9EWkJIY1hyeGNZTiswWVk5STFmczJ5MnBaakdqWEhVL2hNbUhrVFhZdGlwbG5oM0ZNam0rbllGS1N3bTVubQ==

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "\/workspace\/items\/publiclink\/.*"
"calledMethodRegex": "\/workspace(\/items){0,1}\/publiclink\/.*"
},
"replace": {
"serviceClass": "DataAccess",

View File

@ -851,13 +851,24 @@
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "(^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/create\/FILE$)|createItem\\(FILE\\)|(\/item\/create\/byPath)"
"calledMethodRegex": "(^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/create\/(FILE|(?!FOLDER).*)$)|createItem\\(FILE\\)|(\/item\/create\/byPath)"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "createItem(FILE)"
}
},{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "(^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/create\/FOLDER$)|createItem\\(FOLDER\\)"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "createItem(FOLDER)"
}
},{
"match": {
"serviceClassRegex": "DataAccess",
@ -884,7 +895,18 @@
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/workspace(\/item(s){0,1}){0,1}\/(?!(i$)|count|i{0,1}t(h){0,1}rash|group(s){0,1}|user(s){0,1}|paged|v(re|ere|er)fo(ld|dl)ers{0,1}|((C|c)hi(dl|ld|d)ren))[0-9a-zA-Z\\-_]{1,}(\/){0,1}$|getById"
"calledMethodRegex": "^\/(workspace\/){1,2}(item|itam)(s){0,1}\/[0-9a-zA-Z\\-_]*\/acl(s){0,1}(\/){0,1}$|getAcls"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "getAcls"
}
},{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/workspace(\/workspace){0,1}(\/item(s){0,1}){0,1}\/(?!(i$)|count|i{0,1}t(h){0,1}rash|group(s){0,1}|user(s){0,1}|paged|v(re|ere|er)fo(ld|dl)ers{0,1}|((C|c)hi(dl|ld|d)ren))[0-9a-zA-Z\\-_]{1,}(\/){0,1}$|getById"
},
"replace": {
"serviceClass": "DataAccess",
@ -935,6 +957,17 @@
"serviceName": "StorageHub",
"calledMethod": "getUsers"
}
},{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/(workspace\/){1,2}item(s){0,1}\/[0-9a-zA-Z\\-_]*\/version(s){0,1}(\/){0,1}$|getVersions"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "getVersions"
}
},{
"match": {
"serviceClassRegex": "DataAccess",
@ -1016,7 +1049,7 @@
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "\/workspace\/items\/publiclink\/.*"
"calledMethodRegex": "\/workspace(\/items){0,1}\/publiclink\/.*"
},
"replace": {
"serviceClass": "DataAccess",

File diff suppressed because one or more lines are too long