Fixed rules and added new ones
This commit is contained in:
parent
650244485c
commit
a59c89ae8f
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
|
|
@ -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",
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"match": {
|
||||
"serviceClassRegex": "(WPS)|(DataAnalysis)",
|
||||
"serviceNameRegex": "DataMiner",
|
||||
"calledMethodRegex": "(?<CalledMethod>.*)"
|
||||
},
|
||||
"replace": {
|
||||
"serviceClass": "DataAnalysis",
|
||||
"serviceName": "DataMiner",
|
||||
"calledMethod": "${CalledMethod}"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
ResourceManagement,FHNManager,/rest/nodes
|
||||
ResourceManagement,FHNManager,/rest/resourceTemplate
|
||||
ResourceManagement,FHNManager,/rest/serviceprofiles
|
||||
ResourceManagement,FHNManager,/rest/vmproviders
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"match": {
|
||||
"serviceClassRegex": "ResourceManagement",
|
||||
"serviceNameRegex": "FHNManager",
|
||||
"calledMethodRegex": ".*"
|
||||
},
|
||||
"replace": {
|
||||
"serviceClass": "ResourceManagement",
|
||||
"serviceName": "FHNManager",
|
||||
"calledMethod": "OTHER"
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
"match": {
|
||||
"serviceClassRegex": "(SDI)|(SpatialData)",
|
||||
"serviceNameRegex": "GeoNetwork",
|
||||
"calledMethodRegex": ".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(\\..*|\\.*|@json|$)))"
|
||||
"calledMethodRegex": ".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(?!edit).*))"
|
||||
},
|
||||
"replace": {
|
||||
"serviceClass": "SDI",
|
||||
|
|
|
@ -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
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"match": {
|
||||
"serviceClassRegex": "DataAccess",
|
||||
"serviceNameRegex": "HomeLibraryFileSystem",
|
||||
"calledMethodRegex": ".*"
|
||||
},
|
||||
"replace": {
|
||||
"serviceClass": "DataAccess",
|
||||
"serviceName": "HomeLibraryFileSystem",
|
||||
"calledMethod": "OTHER"
|
||||
}
|
||||
}
|
|
@ -10,6 +10,17 @@
|
|||
"serviceName": "${ServiceName}",
|
||||
"calledMethod": "OTHER"
|
||||
}
|
||||
},{
|
||||
"match": {
|
||||
"serviceClassRegex": "(WPS)|(DataAnalysis)",
|
||||
"serviceNameRegex": "DataMiner",
|
||||
"calledMethodRegex": "(?<CalledMethod>.*)"
|
||||
},
|
||||
"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",
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
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
|
|
@ -36,3 +36,41 @@ 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}
|
||||
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}
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"match": {
|
||||
"serviceClassRegex": "(geoanalytics)|(SDI)",
|
||||
"serviceNameRegex": "(geoanalytics-gos)|(geoanalytics-gos-gos)",
|
||||
"serviceNameRegex": "geoanalytics-gos.*",
|
||||
"calledMethodRegex": ".*"
|
||||
},
|
||||
"replace": {
|
||||
|
|
Loading…
Reference in New Issue