From 97225a60e0dc447b4a774b0d1526434b19d7b680 Mon Sep 17 00:00:00 2001 From: Ankit Singh <101859999+ankitmashu@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:32:43 +0530 Subject: [PATCH] added type and resourceGroup for auditing_rs --- .../java/iudx/rs/proxy/apiserver/ApiServerVerticle.java | 8 ++++++++ .../iudx/rs/proxy/apiserver/util/ApiServerConstants.java | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/iudx/rs/proxy/apiserver/ApiServerVerticle.java b/src/main/java/iudx/rs/proxy/apiserver/ApiServerVerticle.java index d7f287e..fc98489 100644 --- a/src/main/java/iudx/rs/proxy/apiserver/ApiServerVerticle.java +++ b/src/main/java/iudx/rs/proxy/apiserver/ApiServerVerticle.java @@ -622,6 +622,14 @@ private void updateAuditTable(RoutingContext context) { } JsonObject jsonObject = CatalogueService.getCatalogueItemJson(resourceid); String providerID = jsonObject.getString("provider"); + String type = + jsonObject.containsKey(RESOURCE_GROUP) ? "RESOURCE" : "RESOURCE_GROUP"; + String resourceGroup = + jsonObject.containsKey(RESOURCE_GROUP) + ? jsonObject.getString(RESOURCE_GROUP) + : jsonObject.getString(ID); + request.put(RESOURCE_GROUP, resourceGroup); + request.put(TYPE_KEY, type); request.put(EPOCH_TIME,time); request.put(ISO_TIME,isoTime); request.put(USER_ID, authInfo.getValue(USER_ID)); diff --git a/src/main/java/iudx/rs/proxy/apiserver/util/ApiServerConstants.java b/src/main/java/iudx/rs/proxy/apiserver/util/ApiServerConstants.java index 9bccbe5..7b614b7 100644 --- a/src/main/java/iudx/rs/proxy/apiserver/util/ApiServerConstants.java +++ b/src/main/java/iudx/rs/proxy/apiserver/util/ApiServerConstants.java @@ -104,6 +104,8 @@ public class ApiServerConstants { public static final String IID = "iid"; public static final String API = "api"; public static final String USER_ID = "userid"; + public static final String RESOURCE_GROUP = "resourceGroup"; + public static final String TYPE_KEY = "type"; public static final String GEO_QUERY = "geo-query"; public static final String TEMPORAL_QUERY = "temporal-query";