OS Core Common - Spring 5 merge requestshttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests2023-08-18T13:08:50Zhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/43Added new custom headers in the DpsHeaders library2023-08-18T13:08:50ZPreksha Beohar-SlbAdded new custom headers in the DpsHeaders library[Related Issue Link](https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/20)[Related Issue Link](https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/20)M4 - Release 0.7Preksha Beohar-SlbPreksha Beohar-Slbhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/77add overloaded constructors for RedisCache2023-08-18T13:08:06ZKelly Zhouadd overloaded constructors for RedisCacheHere is the best practice for Azure Cache for Redis: [Documentation](https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-best-practices?WT.mc_id=Portal-Microsoft_Azure_Support)
To follow the best practice "Configure your ...Here is the best practice for Azure Cache for Redis: [Documentation](https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-best-practices?WT.mc_id=Portal-Microsoft_Azure_Support)
To follow the best practice "Configure your client library to use a connect timeout of at least 15 seconds", we would like to set the redisClient connection timeout as 15 seconds.
However, this is a common library which can be used for any provider, and the recommended value of connection timeout may be different. So we consider to have overloaded constructor where ClientOptions can be passed when initialize RedisCache.M5 - Release 0.8https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/75Fix CVE security vulnerabilities2023-08-18T13:08:09ZAlok JoshiFix CVE security vulnerabilitiesCurrent versions of tomcat-embed-core and jackson-dataformat-cbor have known CVE vulnerabilities. This change addresses the issue by upgrading to the higher minor versions, which don't have any vulnerability.
Below are the listed vulner...Current versions of tomcat-embed-core and jackson-dataformat-cbor have known CVE vulnerabilities. This change addresses the issue by upgrading to the higher minor versions, which don't have any vulnerability.
Below are the listed vulnerabilities for the library versions
`tomcat-embed-core-9.0.37.jar` : [CVE-2021-25122](https://nvd.nist.gov/vuln/detail/CVE-2021-25122), [CVE-2021-24122](https://nvd.nist.gov/vuln/detail/CVE-2021-24122), [CVE-2021-25329](https://nvd.nist.gov/vuln/detail/CVE-2021-25329)
`jackson-dataformat-cbor-2.11.3.jar` : [CVE-2020-28491](https://nvd.nist.gov/vuln/detail/CVE-2020-28491)
We plan to create a release candidate with this change and use it in services to resolve the same issue there too.
The vulnerabilities were flagged in SLB's internal Whitesource scanM5 - Release 0.8Alok JoshiAlok Joshihttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/74add check for null tags on read2023-08-18T13:08:10ZNeelesh Thakuradd check for null tags on readAdd check for null tags on record read. Storage GET getLatestRecordVersion & GET getSpecificRecordVersion fails if a record ingested without any tags and users tries retrieved records by above two APIs.Add check for null tags on record read. Storage GET getLatestRecordVersion & GET getSpecificRecordVersion fails if a record ingested without any tags and users tries retrieved records by above two APIs.M5 - Release 0.8https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/72Add support for ttl in milliseconds2023-08-18T13:08:14ZRostislav Vatolinvatolinrp@gmail.comAdd support for ttl in millisecondsMore info here: https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/36
Entitlement service requires configurable caching. We need different cache expiration time set when we create and update cache. Exi...More info here: https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/36
Entitlement service requires configurable caching. We need different cache expiration time set when we create and update cache. Existing functionality doesn't allow us to include ttl (expiration time) when we create and update cache. This is why I created this MRM5 - Release 0.8https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/71Reverting the version to 0.8.0-SNAPSHOT for default branch2023-08-18T13:08:15ZDavid Diederichd.diederich@opengroup.orgReverting the version to 0.8.0-SNAPSHOT for default branchThe patch version, `0.8.1-SNAPSHOT`, will be used by the release/0.8 branch after tagging the first release. It will refer to patches
on 0.8 that are in development. Version `0.8.0-SNAPSHOT` is used by the default branch (master) during ...The patch version, `0.8.1-SNAPSHOT`, will be used by the release/0.8 branch after tagging the first release. It will refer to patches
on 0.8 that are in development. Version `0.8.0-SNAPSHOT` is used by the default branch (master) during development of features for the
upcoming 0.8 release.
This should not be incremented by MRs. Instead, once merged, create a release candidate version on a tag commit that is separate
from the development line. Until I get some time to write tooling to do this automatically, I'll take on the responsibility of making the RC versions.
This MR will revert the version of master to `0.8.0-SNAPSHOT`. After it merges, I'll immediately create a release candidate version on it. That version will be functionally equivalent to what's currently building as `0.8.1-SNAPSHOT`, in case anybody needs that particular version. Then, I'll purge all packages in the registry that have a `0.8.1-SNAPSHOT` version so they don't create confusion later on when the `0.8.1-SNAPSHOT` version goes into use on the `release/0.8` branch. If that breaks anybody's build, they can use the release candidate version instead.M5 - Release 0.8David Diederichd.diederich@opengroup.orgDavid Diederichd.diederich@opengroup.orghttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/70Fixing AppException to get informative stack traces2023-08-18T13:08:17ZKrishna Nikhil VedurumudiFixing AppException to get informative stack tracesIssue link - https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/37
Fixes AppException stacktrace such that cause exception's stacktrace is captured in the logs
Stacktrace after applying the fix.
```...Issue link - https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/37
Fixes AppException stacktrace such that cause exception's stacktrace is captured in the logs
Stacktrace after applying the fix.
```
021-04-07 20:29:23.858 ERROR LAPTOP-TS9M1QFT --- [nio-8082-exec-2] o.o.o.a.l.Slf4JLogger correlation-id=56bbc5c2-19e8-4aef-a449-3c684d733326 data-partition-id=opendes: storage.app null {correlation-id=56bbc5c2-19e8-4aef-a449-3c684d733326, data-partition-id=opendes}
AppException(error=AppError(code=500, reason=Server error., message=An unknown error has occurred., errors=null, debuggingInfo=null, originalException=java.lang.NullPointerException), originalException=java.lang.NullPointerException)
at org.opengroup.osdu.storage.util.GlobalOtherExceptionMapper.handleGeneralException(GlobalOtherExceptionMapper.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
Caused by: java.lang.NullPointerException
at org.opengroup.osdu.storage.service.QueryServiceImpl.getRecordInfo(QueryServiceImpl.java:72)
at org.opengroup.osdu.storage.api.RecordApi.getLatestRecordVersion(RecordApi.java:113)
at org.opengroup.osdu.storage.api.RecordApi$$FastClassBySpringCGLIB$$495e8f0c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
... 100 more
```M5 - Release 0.8https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/69Fix headers for CORS preflight request (GONRG-2138)2023-08-18T13:08:19ZRustam Lotsmanenko (EPAM)rustam_lotsmanenko@epam.comFix headers for CORS preflight request (GONRG-2138)# Description:
https://community.opengroup.org/osdu/ui/admin-ui uses preflight requests for CORS, which cannot be processed
by services, due to lack `access-control-allow-origin` in `Access-Control-Allow-Headers` response.
Added `access...# Description:
https://community.opengroup.org/osdu/ui/admin-ui uses preflight requests for CORS, which cannot be processed
by services, due to lack `access-control-allow-origin` in `Access-Control-Allow-Headers` response.
Added `access-control-allow-origin` to `Access-Control-Allow-Headers` for CORS preflight request.<br/>
![storage](/uploads/d212d1991553b780e31d90e6f4763702/storage.PNG)
# How to test:
After header added, preflight requests can be processed normally <br/>
![fix](/uploads/b8c549588102fd2a6fbf9388612572b0/fix.PNG)
# Changes include:
- [ ] Refactor (a non-breaking change that improves code maintainability).
- [x] Bugfix (a non-breaking change that solves an issue).
- [ ] New feature (a non-breaking change that adds functionality).
- [ ] Breaking change (a change that is not backward-compatible and/or changes current functionality).
# Changes in:
- [x] Common code
# Dev Checklist:
- [ ] Added Unit Tests, wherever applicable.
- [ ] Updated the Readme, if applicable.
- [x] Existing Tests pass
- [x] Verified functionality locally
- [x] Self Reviewed my code for formatting and complex business logic.M5 - Release 0.8Rostislav Dublin (EPAM)Rostislav Dublin (EPAM)https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/68add a config to enable tracking total hits for search service response2023-08-18T13:08:20ZNeelesh Thakuradd a config to enable tracking total hits for search service responseAllows user to track accurate hits matching the query when set to true. By default it's disabled and more performant when partial results are requested.
Addresses the search service issue [29](https://community.opengroup.org/osdu/platfo...Allows user to track accurate hits matching the query when set to true. By default it's disabled and more performant when partial results are requested.
Addresses the search service issue [29](https://community.opengroup.org/osdu/platform/system/search-service/-/issues/29)M5 - Release 0.8https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/67Array of Objects support by Indexer (GONRG-2028)2023-08-18T13:08:22ZRustam Lotsmanenko (EPAM)rustam_lotsmanenko@epam.comArray of Objects support by Indexer (GONRG-2028)Fix for https://community.opengroup.org/osdu/platform/system/indexer-service/-/issues/16
# Changes include:
* [x] Breaking change (a change that is not backward-compatible and/or changes current functionality).
# Changes in:
* [x] Co...Fix for https://community.opengroup.org/osdu/platform/system/indexer-service/-/issues/16
# Changes include:
* [x] Breaking change (a change that is not backward-compatible and/or changes current functionality).
# Changes in:
* [x] Common codeM5 - Release 0.8Dmitriy RudkoRostislav Dublin (EPAM)Dmitriy Rudkohttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/65Adding configurable caching strategy in VmCache2023-08-18T13:08:23ZKrishna Nikhil VedurumudiAdding configurable caching strategy in VmCacheIssue link - https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/35
Using `expireAfterAccess` can cause issues where frequently used data will never get updated as it never gets evicted from Cache.
So,...Issue link - https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/35
Using `expireAfterAccess` can cause issues where frequently used data will never get updated as it never gets evicted from Cache.
So, where ever needed, we should use `expireAfterWrite`.
Added overloaded constructor to VmCache using which this can be achieved.
This MR does not break backward compatibility as default behavior will not changeM5 - Release 0.8David Diederichd.diederich@opengroup.orgDavid Diederichd.diederich@opengroup.orghttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/63add batch policy signature for search integration2023-08-18T13:08:25ZAlok Joshiadd batch policy signature for search integrationAdding required dependencies and methods in for search service integration with Policy service
https://community.opengroup.org/osdu/platform/system/search-service/-/issues/27Adding required dependencies and methods in for search service integration with Policy service
https://community.opengroup.org/osdu/platform/system/search-service/-/issues/27M5 - Release 0.8Alok JoshiAlok Joshihttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/61Support Patch "Add" operation for ACL and Legal2023-08-18T13:08:27ZLarissa PereiraSupport Patch "Add" operation for ACL and LegalM5 - Release 0.8ethiraj krishnamanaiduNitin-slbNeelesh ThakurAlok Joshiethiraj krishnamanaiduhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/90Implemented HttpClientHandler to an interface2023-08-18T13:07:47ZMuskan SrivastavaImplemented HttpClientHandler to an interface
This MR implements HttpClientHandler to an interface- IHttpClientHandler. Also, changes RETRY_COUNT and REQUEST_CONFIG from being private final to protected static.
We follow the pattern of implementing to the interface across the ent...
This MR implements HttpClientHandler to an interface- IHttpClientHandler. Also, changes RETRY_COUNT and REQUEST_CONFIG from being private final to protected static.
We follow the pattern of implementing to the interface across the entire project, hence this MR wants to bring HttpClientHandler to the same line. Moreover, doing so will make the class extensible. Making REQUEST_CONFIG and RETRY_COUNT protected static will allow the extended classes to configure these parameters.
<br>
**Impact** : <br>
This will enable us to: -
1. Have same coding pattern across project.
2. Extend HttpClientHandler.
3. Configure REQUEST_CONFIG and RETRY_COUNT in child classes.M6 - Release 0.9Muskan SrivastavaMuskan Srivastavahttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/89Correct page size doc for Query and CursorQuery2023-08-18T13:07:49ZNeelesh ThakurCorrect page size doc for Query and CursorQueryM6 - Release 0.9https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/88fix debug default method implementation in Ilogger2023-08-18T13:07:51ZYauheni Lesnikaufix debug default method implementation in Iloggerfix debug default method implementation in Iloggerfix debug default method implementation in IloggerM6 - Release 0.9ethiraj krishnamanaiduNeelesh ThakurAlok JoshiRostislav Vatolinvatolinrp@gmail.comYauheni Lesnikauethiraj krishnamanaiduhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/87Upgrade elastic libraries2023-08-18T13:07:53ZRostislav Vatolinvatolinrp@gmail.comUpgrade elastic librariesMore details: https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/42More details: https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/issues/42M6 - Release 0.9https://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/86update legal service interface populateLegalInfoFromParents hold version as w...2023-08-18T13:07:54ZYauheni Lesnikauupdate legal service interface populateLegalInfoFromParents hold version as well as parentId;This MR related to the changes into the Storage service where we need to hold version as well as parentId of the parent records
Related to the MR in storage servive: https://community.opengroup.org/osdu/platform/system/storage/-/merge_re...This MR related to the changes into the Storage service where we need to hold version as well as parentId of the parent records
Related to the MR in storage servive: https://community.opengroup.org/osdu/platform/system/storage/-/merge_requests/198
Related to the issue: https://community.opengroup.org/osdu/platform/system/storage/-/issues/72M6 - Release 0.9ethiraj krishnamanaiduNitin-slbNeelesh ThakurSherman YangAlok Joshiashley kelhamYauheni LesnikauSanjeev-SLBethiraj krishnamanaiduhttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/85Made the constructor of services public2023-08-18T13:07:56ZMuskan SrivastavaMade the constructor of services publicThis MR makes constructor of following classes as public: -
- CrsConverterService
- EntitlementsService
- LegalService
- SubscriptionService(notification)
- PolicyService
- SearchService
- StorageService
------------------
Currently, th...This MR makes constructor of following classes as public: -
- CrsConverterService
- EntitlementsService
- LegalService
- SubscriptionService(notification)
- PolicyService
- SearchService
- StorageService
------------------
Currently, there are 2 services - PartitionService and EntitlementsService V2, which have public constructors and rest have package-private.
Making the constructor public will increase the accessibility and extensibility of <Service>Service classes (<Service> used as placeholder).
As of now, <Service>Factory classes which return an instance to <Service>Service (for example, EntitlementsFactory returns instance of EntitlementsService) acts as the only access point to <Service>Service classes. By making the constructor public of the above mentioned classes will enable us to extend those classes, write our own <Service>Factory classes that or use Http Client of our choice.
<br>
**Impact** : <br>
This will enable us to: -
1. Have parity in SDK.
2. The factories can be overloaded. This will enable us to plug in HttpClient.
3. Opens up Service classes being used as SDK to be able to be extensible and configurable.M6 - Release 0.9Muskan SrivastavaMuskan Srivastavahttps://community.opengroup.org/osdu/platform/system/lib/core/os-core-common/-/merge_requests/84Add a default constructor for RecordData2023-08-18T13:07:57ZMina OtgonboldAdd a default constructor for RecordDataNeed to add a default constructor for RecordData in order to change gson to jackson in storage service which is a fix for the issue below.
- Actual MR fixing the issue below: https://community.opengroup.org/osdu/platform/system/storage/...Need to add a default constructor for RecordData in order to change gson to jackson in storage service which is a fix for the issue below.
- Actual MR fixing the issue below: https://community.opengroup.org/osdu/platform/system/storage/-/merge_requests/196
- The issue on Gitlab: https://community.opengroup.org/osdu/platform/system/storage/-/issues/67M6 - Release 0.9