> On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > Please make sure to run 'mvn clean verify' and address PMD violations > > (missing license text, unused imports).
addressed all PMD violations > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-audit/src/main/java/org/apache/ranger/audit/provider/MiscUtil.java > > Line 83 (original), 83 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288208#file2288208line84> > > > > Consider using ThreadLocal<ObjectMapper>, similar to JsonUtilsV2. updated MiscUtil.java with ThreadLocal<ObjectMapper> > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-audit/src/main/java/org/apache/ranger/audit/provider/MiscUtil.java > > Lines 96 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288208#file2288208line97> > > > > Currently Gson date format 'yyyyMMdd-HH:mm:ss.SSS-Z' is used - see line > > #138 in BaseAuditHandler.java. > > > > Please ensure that the format specified here produces the same output > > as the current version. Corrected dateformat > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-audit/src/main/java/org/apache/ranger/audit/queue/AuditFileCacheProviderSpool.java > > Line 127 (original), 144 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288209#file2288209line144> > > > > To avoid code duplication, consider replacing objectMapper with use of > > methods in MiscUtil. updated the code with appropriate methods in MiscUtil > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-audit/src/main/java/org/apache/ranger/audit/queue/AuditFileQueueSpool.java > > Line 142 (original), 141 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288210#file2288210line145> > > > > To avoid code duplication, consider replacing objectMapper with use of > > methods in MiscUtil. MiscUtil.stringify(). updated the code with appropriate methods in MiscUtil > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-audit/src/main/java/org/apache/ranger/audit/queue/AuditFileSpool.java > > Line 137 (original), 136 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288211#file2288211line140> > > > > To avoid code duplication, consider replacing objectMapper with use of > > methods in MiscUtil. MiscUtil.stringify(). updated the code with appropriate methods in MiscUtil > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerFileBasedTagRetriever.java > > Line 53 (original), 56 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288214#file2288214line56> > > > > To avoid code duplication, consider replacing objectMapper with use of > > methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java > > Line 884 (original), 886 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288215#file2288215line888> > > > > To avoid code duplication, consider replacing objectMapper with use of > > methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerUserStoreRefresher.java > > Line 61 (original), 62 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288216#file2288216line62> > > > > To avoid code duplication, consider replacing objectMapper with use of > > methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/externalretrievers/GetFromURL.java > > Line 54 (original), 57 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288217#file2288217line57> > > > > To avoid code duplication, consider replacing objectMapper with use of > > methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java > > Line 132 (original), 134 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288218#file2288218line134> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java > > Line 61 (original), 60 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288219#file2288219line64> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/util/RangerMetricsUtil.java > > Line 190 (original), 192 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288220#file2288220line192> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java > > Line 105 (original), 107 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288221#file2288221line109> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRolesProvider.java > > Line 52 (original), 53 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288222#file2288222line55> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/biz/KmsKeyMgr.java > > Line 161 (original), 163 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288223#file2288223line165> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java > > Lines 91 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288224#file2288224line92> > > > > Can the text contain any other offset like 0800, 0530? If the intention > > is to replace "-+" with "+", is it necessary to look for "-+0000"? additional setup for Date (serialization options, and deserialization) not needed is not needed with correct dateformat used in jsonUtils and MiscUtil. > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java > > Lines 106 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288224#file2288224line107> > > > > Aren't these additional setup for Date (serialization options, and > > deserialization) not needed in ObjectMapper instances in MiscUtil and > > JsonUtil? additional setup for Date (serialization options, and deserialization) not needed is not needed with correct dateformat used in jsonUtils and MiscUtil. > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java > > Lines 399 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288226#file2288226line399> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/common/RangerServicePoliciesCache.java > > Line 59 (original), 61 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288228#file2288228line61> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/db/XXGroupDao.java > > Line 134 (original), 133 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288229#file2288229line135> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/db/XXUserDao.java > > Line 204 (original), 205 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288230#file2288230line207> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/patch/PatchForSyncSourceUpdate_J10054.java > > Line 93 (original), 96 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288231#file2288231line96> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/patch/PatchForXGlobalState_J10036.java > > Line 75 (original), 78 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288232#file2288232line78> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/patch/cliutil/MetricUtil.java > > Lines 122 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288233#file2288233line125> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/service/RangerRoleService.java > > Line 48 (original), 50 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288235#file2288235line51> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java > > Line 68 (original), 67 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288236#file2288236line69> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > tagsync/src/main/java/org/apache/ranger/tagsync/model/AbstractTagSource.java > > Lines 36 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288241#file2288241line36> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasTagSource.java > > Line 284 (original), 284 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288242#file2288242line284> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > tagsync/src/main/java/org/apache/ranger/tagsync/source/atlasrest/AtlasRESTTagSource.java > > Line 233 (original), 233 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288243#file2288243line233> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > tagsync/src/main/java/org/apache/ranger/tagsync/source/file/FileTagSource.java > > Line 48 (original), 49 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288244#file2288244line49> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java > > Line 268 (original), 269 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288247#file2288247line269> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils > On May 30, 2024, 3:01 a.m., Madhan Neethiraj wrote: > > ugsync/src/main/java/org/apache/ranger/unixusersync/process/PolicyMgrUserGroupBuilder.java > > Lines 155 (patched) > > <https://reviews.apache.org/r/75015/diff/1/?file=2288248#file2288248line156> > > > > To avoid code duplication, consider replacing objectMapper with use of > > appropriate methods in JsonUtils. updated the code with appropriate methods in JsonUtils - Monika ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/75015/#review226497 ----------------------------------------------------------- On June 3, 2024, 5:14 p.m., Monika Kachhadiya wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/75015/ > ----------------------------------------------------------- > > (Updated June 3, 2024, 5:14 p.m.) > > > Review request for ranger, Anand Nadar, Asit Vadhavkar, Madhan Neethiraj, > Siddhesh Phatak, and Subhrat Chaudhary. > > > Bugs: RANGER-4806 > https://issues.apache.org/jira/browse/RANGER-4806 > > > Repository: ranger > > > Description > ------- > > The root as mentioned here: > https://github.com/google/gson/issues/1979#issuecomment-927943566 > > Similar to #1963 and other existing reports. Apparently you are deserializing > a JDK class (java.security.KeyFactory) without having specified a custom type > adapter for it. Gson will then by default use a reflection based type > adapter. You have to write a custom type adapter to solve this issue or move > to jackson fasterxml. > > This patch is to move from Gson to jackson fasterxml. > > > Diffs > ----- > > > agents-audit/src/main/java/org/apache/ranger/audit/model/AuditIndexRecord.java > PRE-CREATION > > agents-audit/src/main/java/org/apache/ranger/audit/model/AuthzAuditEvent.java > 2e32fb5794 > > agents-audit/src/main/java/org/apache/ranger/audit/model/SPOOL_FILE_STATUS.java > PRE-CREATION > > agents-audit/src/main/java/org/apache/ranger/audit/provider/BaseAuditHandler.java > 68c33c90db > agents-audit/src/main/java/org/apache/ranger/audit/provider/MiscUtil.java > 1e5d1d8d8e > > agents-audit/src/main/java/org/apache/ranger/audit/queue/AuditFileCacheProviderSpool.java > bc8f685c3b > > agents-audit/src/main/java/org/apache/ranger/audit/queue/AuditFileQueueSpool.java > 26e11aba99 > > agents-audit/src/main/java/org/apache/ranger/audit/queue/AuditFileSpool.java > 3f40861b06 > agents-audit/src/main/java/org/apache/ranger/audit/utils/ORCFileUtil.java > f73df2c207 > > agents-common/src/main/java/org/apache/ranger/authorization/utils/JsonUtils.java > 8113e4280f > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerFileBasedTagRetriever.java > df2c7ccf15 > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java > c5f5fc3be6 > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerUserStoreRefresher.java > fe0b923341 > > agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/externalretrievers/GetFromURL.java > f9eae35747 > > agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java > 92ce183bbd > > agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java > aa0c801199 > > agents-common/src/main/java/org/apache/ranger/plugin/util/RangerMetricsUtil.java > 588605a6ac > > agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java > e54313403d > > agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRolesProvider.java > 58a47cf1b0 > security-admin/src/main/java/org/apache/ranger/biz/KmsKeyMgr.java > c9a9987c86 > > security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java > 321148307c > security-admin/src/main/java/org/apache/ranger/biz/RoleDBStore.java > a15ceac561 > security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java > 7ac16a9eee > security-admin/src/main/java/org/apache/ranger/biz/TagDBStore.java > 63bde37d8b > > security-admin/src/main/java/org/apache/ranger/common/RangerServicePoliciesCache.java > c768f1c346 > security-admin/src/main/java/org/apache/ranger/db/XXGroupDao.java > f910e92ee5 > security-admin/src/main/java/org/apache/ranger/db/XXUserDao.java 8af4448b5d > > security-admin/src/main/java/org/apache/ranger/patch/PatchForSyncSourceUpdate_J10054.java > 99de47310a > > security-admin/src/main/java/org/apache/ranger/patch/PatchForXGlobalState_J10036.java > 5506625bce > > security-admin/src/main/java/org/apache/ranger/patch/cliutil/MetricUtil.java > 7d4828ed00 > security-admin/src/main/java/org/apache/ranger/rest/RoleREST.java > b35b8af658 > > security-admin/src/main/java/org/apache/ranger/service/RangerRoleService.java > b815b1d37b > > security-admin/src/main/java/org/apache/ranger/service/RangerSecurityZoneServiceService.java > 48be2b5fe6 > > security-admin/src/main/java/org/apache/ranger/service/RangerServiceResourceService.java > 918c8d0091 > > security-admin/src/main/java/org/apache/ranger/service/RangerServiceResourceWithTagsService.java > 2b3acd17a7 > > security-admin/src/main/java/org/apache/ranger/service/RangerTagDefService.java > c779b77466 > > security-admin/src/main/java/org/apache/ranger/service/RangerTagService.java > fe79c3e5f0 > > tagsync/src/main/java/org/apache/ranger/tagsync/model/AbstractTagSource.java > ff9937628f > > tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasTagSource.java > 9a761b33c3 > > tagsync/src/main/java/org/apache/ranger/tagsync/source/atlasrest/AtlasRESTTagSource.java > 792ced1329 > > tagsync/src/main/java/org/apache/ranger/tagsync/source/file/FileTagSource.java > 65deccd14a > > ugsync/src/main/java/org/apache/ranger/unixusersync/model/GetXGroupListResponse.java > c0e8a0986a > > ugsync/src/main/java/org/apache/ranger/unixusersync/model/GetXUserListResponse.java > 16ad7d6e44 > > ugsync/src/main/java/org/apache/ranger/unixusersync/process/FileSourceUserGroupBuilder.java > 9c951a6685 > > ugsync/src/main/java/org/apache/ranger/unixusersync/process/PolicyMgrUserGroupBuilder.java > fecd96de01 > > > Diff: https://reviews.apache.org/r/75015/diff/2/ > > > Testing > ------- > > Sanity test of CRUD policies/users/groups from ranger UI > Verified existing junits test cases are working as expected > verified audit spool is generated as expected in case of java 17 > > > Thanks, > > Monika Kachhadiya > >
