Skip to content

Commit

Permalink
V1.13.1 temp (#80)
Browse files Browse the repository at this point in the history
* MODNCIP-49

* temporary change for testing

* testing encode

* testing encoding

* encoding

* encoding

* encoding

* logging test

* pom logging

* logging test

* testing logging

* logging

* logging test

* testing logging

* logging test

* update for orchid

* merge prep

* logging

* nolana test

* remove logging

* correction to logging class name

* PercentCodec corrections

* fix pom and type cqlEncode

* log4j properties

* adding limits

* changed type check and added default config values

* corrected mod-inventory version

* update news for release

* mentioned logging in news

* [maven-release-plugin] prepare release v1.13.0

* [maven-release-plugin] prepare for next development iteration

* test build

* Logging on MockServer

* encoding

* encoding

* encoding

* testing mock server

* Mockserver logging & one other cqlEncode

* remove target

* update readme

* MODNCIP-55

* MODNCIP-55

* move limit

* remove cql

* remove cql

* PercentCodec.encode added

* PercentCodec.encode

* externalSystemId case sensitive

* externalsystemid is case sensitive

* check user type

* remove log statement

* Update NEWS.md

* [maven-release-plugin] prepare release v1.13.1

* [maven-release-plugin] prepare for next development iteration
  • Loading branch information
mis306lu authored Apr 13, 2023
1 parent 2e58323 commit 2c9456f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.13.1 2023-04-05
* [MODNCIP-55](https://issues.folio.org/browse/MODNCIP-55)- alternate user lookup service fix
## 1.13.0 2023-02-23
* [MODNCIP-49](https://issues.folio.org/browse/MODNCIP-49) -CQL and URL injection
* Updated logging - common logging
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.folio</groupId>
<artifactId>mod-ncip</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.13.2-SNAPSHOT</version>
<name>NCIP</name>
<description>NCIP responder for FOLIO (internal module)</description>

Expand Down
10 changes: 7 additions & 3 deletions src/main/java/org/folio/ncip/FolioRemoteServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@ private void initProperties(String requesterAgencyId, String baseUrl) throws Exc
//LOOKUP LOCATION DOESN'T WORK UNLESS THE LOCATION CODE
//IS SURROUNDED BY QUOTES
if (lookupValue.contains("/")) lookupValue = '"' + lookupValue + '"';
url = url.replace("{lookup}", StringUtil.cqlEncode(lookupValue));
url = url.replace("{lookup}", PercentCodec.encode(lookupValue));


final String timeoutString = System.getProperty(Constants.SERVICE_MGR_TIMEOUT,Constants.DEFAULT_TIMEOUT);
int timeout = Integer.parseInt(timeoutString);
Expand Down Expand Up @@ -781,10 +782,13 @@ public JsonObject lookupPatronRecordBy(String type, String value) throws Excepti
if (!validTypes.contains(type)) {
throw new Exception("invalid patron lookup type provided: " + type);
}

if (type != null && type.equalsIgnoreCase("externalSystemId")) type = "externalSystemId";
value = StringUtil.cqlEncode(value);
String baseUrl = okapiHeaders.get(Constants.X_OKAPI_URL);
String query = "(" + type + "==" + value + "&limit=1";
String userApiUri = baseUrl + "/users?query=" + PercentCodec.encode(query.toString());
String query = "(" + type + "==" + value + ")";
String userApiUri = baseUrl + "/users?query=" + PercentCodec.encode(query.toString()) + "&limit=1";

String response = callApiGet(userApiUri);

// WAS THE PATRON FOUND?
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/folio/ncip/NcipConfigCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void process(RoutingContext routingContext) throws Exception {
logger.info(" using lookup value ");
logger.info(value);
if (value.contains("/")) value = '"' + value + '"';
url = url.replace("{lookup}", StringUtil.cqlEncode(value));
url = url.replace("{lookup}", PercentCodec.encode(value));
logger.info("WILL LOOKUP " + lookup + " WITH URL " + url + " USING VALUE " + value);


Expand Down

0 comments on commit 2c9456f

Please sign in to comment.