Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data restriction and attribute masking #528

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 124 additions & 132 deletions example-configs/configs/config-dev.json
Original file line number Diff line number Diff line change
@@ -1,135 +1,127 @@
{
"version": "1.0",
"zookeepers": [
"zookeeper"
],
"clusterId": "iudx-rs-cluster",
"commonConfig" : {
"dxApiBasePath" : "/ngsi-ld/v1",
"dxCatalogueBasePath": "/iudx/cat/v1",
"dxAuthBasePath": "/auth/v1"
"version": "1.0",
"zookeepers": [
"zookeeper"
],
"clusterId": "iudx-rs-cluster",
"commonConfig": {
"dxApiBasePath": "/ngsi-ld/v1",
"dxCatalogueBasePath": "/iudx/cat/v1",
"dxAuthBasePath": "/auth/v1"
},
"modules": [
{
"id": "iudx.resource.server.database.archives.DatabaseVerticle",
"isWorkerVerticle": false,
"tenantPrefix": "iudx",
"verticleInstances": 8,
"databaseIP": "",
"databasePort": 24034,
"dbUser": "",
"dbPassword": "",
"timeLimit": ""
},
"modules": [
{
"id": "iudx.resource.server.database.archives.DatabaseVerticle",
"isWorkerVerticle":false,
"tenantPrefix": "iudx",
"verticleInstances": 8,
"databaseIP": "",
"databasePort": 24034,
"dbUser": "",
"dbPassword": "",
"timeLimit": ""
},
{
"id": "iudx.resource.server.authenticator.AuthenticationVerticle",
"isWorkerVerticle":false,
"verticleInstances": 1,
"audience": "rs.iudx.io",
"authServerHost": "",
"catServerHost": "",
"catServerPort": 443,
"jwtIgnoreExpiry": true,
"enableLimits": false

},
{
"id": "iudx.resource.server.databroker.DataBrokerVerticle",
"isWorkerVerticle":false,
"verticleInstances": 1,
"dataBrokerIP": "",
"dataBrokerPort": 29042,

"prodVhost":"",
"internalVhost": "",
"externalVhost":"",

"dataBrokerUserName": "",
"dataBrokerPassword": "",
"dataBrokerManagementPort": 30042,
"connectionTimeout": 6000,
"requestedHeartbeat": 60,
"handshakeTimeout": 6000,
"requestedChannelMax": 5,
"networkRecoveryInterval": 500,
"automaticRecoveryEnabled": "true",
"postgresDatabaseIP": "",
"postgresDatabasePort": 5432,
"postgresDatabaseName": "",
"postgresDatabaseUserName": "",
"postgresDatabasePassword": "",
"postgrespoolSize": 25,

"brokerAmqpIp":"",
"brokerAmqpPort":1234
},
{
"id": "iudx.resource.server.apiserver.ApiServerVerticle",
"isWorkerVerticle":false,
"ssl": true,
"keystore": "configs/keystore.jks",
"keystorePassword": "",
"httpPort": 8443,
"verticleInstances": 8,
"catServerHost": "",
"catServerPort": 443
},
{
"id": "iudx.resource.server.database.latest.LatestVerticle",
"isWorkerVerticle":false,
"tenantPrefix": "iudx",
"verticleInstances": 2,
"redisMode": "",
"redisUsername": "",
"redisPassword": "",
"redisMaxWaitingHandlers": 1024,
"redisHost":"",
"redisPort": 1234

},
{
"id": "iudx.resource.server.metering.MeteringVerticle",
"isWorkerVerticle":false,
"verticleInstances": 1
},
{
"id":"iudx.resource.server.database.postgres.PostgresVerticle",
"isWorkerVerticle":false,
"verticleInstances": 1,
"databaseIp": "localhost",
"databasePort": 5432,
"databaseName": "",
"databaseUserName": "",
"databasePassword": "",
"poolSize": 25

},
{
"id": "iudx.resource.server.cache.CacheVerticle",
"isWorkerVerticle":false,
"catServerHost": "cat-api",
"catServerPort": 123,
"verticleInstances": 1
},
{
"id": "iudx.resource.server.database.async.AsyncVerticle",
"isWorkerVerticle":true,
"tenantPrefix": "iudx",
"threadPoolName":"async-query-pool",
"threadPoolSize":20,
"verticleInstances": 20,
"databaseIP": "",
"databasePort":998 ,
"dbUser": "",
"dbPassword": "",
"timeLimit": "",
"filePath": "/home/kailash/Downloads/",
"bucketName": ""
},
{
"id": "iudx.resource.server.encryption.EncryptionVerticle",
"isWorkerVerticle":false,
"verticleInstances": 1
}
]
{
"id": "iudx.resource.server.authenticator.AuthenticationVerticle",
"isWorkerVerticle": false,
"verticleInstances": 1,
"audience": "rs.iudx.io",
"authServerHost": "",
"jwtIgnoreExpiry": true,
"enableLimits": false
},
{
"id": "iudx.resource.server.databroker.DataBrokerVerticle",
"isWorkerVerticle": false,
"verticleInstances": 1,
"dataBrokerIP": "",
"dataBrokerPort": 29042,
"prodVhost": "",
"internalVhost": "",
"externalVhost": "",
"dataBrokerUserName": "",
"dataBrokerPassword": "",
"dataBrokerManagementPort": 30042,
"connectionTimeout": 6000,
"requestedHeartbeat": 60,
"handshakeTimeout": 6000,
"requestedChannelMax": 5,
"networkRecoveryInterval": 500,
"automaticRecoveryEnabled": "true",
"postgresDatabaseIP": "",
"postgresDatabasePort": 5432,
"postgresDatabaseName": "",
"postgresDatabaseUserName": "",
"postgresDatabasePassword": "",
"postgrespoolSize": 25,
"brokerAmqpIp": "",
"brokerAmqpPort": 1234
},
{
"id": "iudx.resource.server.apiserver.ApiServerVerticle",
"isWorkerVerticle": false,
"ssl": true,
"keystore": "configs/keystore.jks",
"keystorePassword": "",
"httpPort": 8443,
"verticleInstances": 8,
"catServerHost": "",
"catServerPort": 443
},
{
"id": "iudx.resource.server.database.latest.LatestVerticle",
"isWorkerVerticle": false,
"tenantPrefix": "iudx",
"verticleInstances": 2,
"redisMode": "",
"redisUsername": "",
"redisPassword": "",
"redisMaxWaitingHandlers": 1024,
"redisHost": "",
"redisPort": 1234
},
{
"id": "iudx.resource.server.metering.MeteringVerticle",
"isWorkerVerticle": false,
"verticleInstances": 1
},
{
"id": "iudx.resource.server.database.postgres.PostgresVerticle",
"isWorkerVerticle": false,
"verticleInstances": 1,
"databaseIp": "localhost",
"databasePort": 5432,
"databaseName": "",
"databaseUserName": "",
"databasePassword": "",
"poolSize": 25
},
{
"id": "iudx.resource.server.cache.CacheVerticle",
"isWorkerVerticle": false,
"catServerHost": "cat-api",
"catServerPort": 123,
"verticleInstances": 1
},
{
"id": "iudx.resource.server.database.async.AsyncVerticle",
"isWorkerVerticle": true,
"tenantPrefix": "iudx",
"threadPoolName": "async-query-pool",
"threadPoolSize": 20,
"verticleInstances": 20,
"databaseIP": "",
"databasePort": 998,
"dbUser": "",
"dbPassword": "",
"timeLimit": "",
"filePath": "/home/kailash/Downloads/",
"bucketName": ""
},
{
"id": "iudx.resource.server.encryption.EncryptionVerticle",
"isWorkerVerticle": false,
"verticleInstances": 1
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static iudx.resource.server.apiserver.response.ResponseUtil.generateResponse;
import static iudx.resource.server.apiserver.util.Constants.*;
import static iudx.resource.server.apiserver.util.Util.errorResponse;
import static iudx.resource.server.authenticator.Constants.ACCESSIBLE_ATTRS;
import static iudx.resource.server.authenticator.Constants.ROLE;
import static iudx.resource.server.cache.cachelmpl.CacheType.CATALOGUE_CACHE;
import static iudx.resource.server.common.Constants.CACHE_SERVICE_ADDRESS;
Expand Down Expand Up @@ -850,6 +851,10 @@ private void executeCountQuery(
*/
private void executeSearchQuery(
RoutingContext context, JsonObject json, HttpServerResponse response) {
JsonObject authInfo = (JsonObject) context.data().get("authInfo");
JsonArray accessibleAttrs = authInfo.getJsonArray(ACCESSIBLE_ATTRS, new JsonArray());
json.put(ACCESSIBLE_ATTRS, accessibleAttrs);

Future<JsonObject> searchDbFuture = database.search(json);
searchDbFuture.onComplete(
handler -> {
Expand Down Expand Up @@ -1677,6 +1682,7 @@ private Future<Void> updateAuditTable(RoutingContext context) {
request.put(API, authInfo.getValue(API_ENDPOINT));
request.put(RESPONSE_SIZE, context.data().get(RESPONSE_SIZE));
request.put(PROVIDER_ID, providerId);
request.put("accessType", authInfo.getString("accessType"));
ankitmashu marked this conversation as resolved.
Show resolved Hide resolved
meteringService.insertMeteringValuesInRmq(
request,
handler -> {
Expand Down
Loading