Updated Koral version for InfoController.
Change-Id: I2f395450e27b8573057a38bd13d73124feca71be
diff --git a/core/Changes b/core/Changes
index 3861484..7d3e66f 100644
--- a/core/Changes
+++ b/core/Changes
@@ -1,3 +1,7 @@
+# version 0.63.1
+2021-03-25
+ - Updated Koral version for InfoController.
+
# version 0.63
14/01/2021
- Updated Flyway (margaretha)
diff --git a/core/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java b/core/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java
index f2691da..fa83ebc 100644
--- a/core/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java
+++ b/core/src/main/java/de/ids_mannheim/korap/utils/ServiceInfo.java
@@ -1,6 +1,7 @@
package de.ids_mannheim.korap.utils;
import de.ids_mannheim.korap.config.ConfigLoader;
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
import lombok.Getter;
import java.io.IOException;
@@ -44,6 +45,7 @@
private void load () {
Properties props = new Properties();
try {
+
InputStream stream = getStream();
props.load(stream);
stream.close();
@@ -55,7 +57,9 @@
this.cache_store = (String) props.get("kustvakt.cache_store");
this.krillVersion=(String) props.get("krill.version");
- this.koralVersion=(String) props.get("koral.version");
+
+ QuerySerializer s = new QuerySerializer();
+ this.koralVersion = s.getVersion() ;
}
catch (IOException e) {
this.version = UNKNOWN;
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2RefreshTokenDto.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2TokenDto.java
similarity index 97%
rename from full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2RefreshTokenDto.java
rename to full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2TokenDto.java
index 8fac3ca..ef2cbfc 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2RefreshTokenDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2TokenDto.java
@@ -8,7 +8,7 @@
* @author margaretha
*
*/
-public class OAuth2RefreshTokenDto {
+public class OAuth2TokenDto {
private String token;
private String createdDate;
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java
index bbf7f04..abab7ce 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java
@@ -28,7 +28,7 @@
import de.ids_mannheim.korap.oauth2.constant.OAuth2Error;
import de.ids_mannheim.korap.oauth2.dao.AccessTokenDao;
import de.ids_mannheim.korap.oauth2.dao.RefreshTokenDao;
-import de.ids_mannheim.korap.oauth2.dto.OAuth2RefreshTokenDto;
+import de.ids_mannheim.korap.oauth2.dto.OAuth2TokenDto;
import de.ids_mannheim.korap.oauth2.entity.AccessScope;
import de.ids_mannheim.korap.oauth2.entity.AccessToken;
import de.ids_mannheim.korap.oauth2.entity.Authorization;
@@ -512,7 +512,7 @@
}
}
- public List<OAuth2RefreshTokenDto> listUserRefreshToken (String username, String clientId,
+ public List<OAuth2TokenDto> listUserRefreshToken (String username, String clientId,
String clientSecret) throws KustvaktException {
OAuth2Client client = clientService.authenticateClient(clientId, clientSecret);
@@ -523,13 +523,13 @@
}
List<RefreshToken> tokens = refreshDao.retrieveRefreshTokenByUser(username);
- List<OAuth2RefreshTokenDto> dtoList = new ArrayList<>(tokens.size());
+ List<OAuth2TokenDto> dtoList = new ArrayList<>(tokens.size());
for (RefreshToken t : tokens){
OAuth2Client tokenClient = t.getClient();
if (tokenClient.getId().equals(client.getId())){
continue;
}
- OAuth2RefreshTokenDto dto = new OAuth2RefreshTokenDto();
+ OAuth2TokenDto dto = new OAuth2TokenDto();
dto.setClientId(tokenClient.getId());
dto.setClientName(tokenClient.getName());
dto.setClientUrl(tokenClient.getUrl());
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
index 68f991c..17fb0a4 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
@@ -30,7 +30,7 @@
import de.ids_mannheim.korap.constant.OAuth2Scope;
import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.dto.OAuth2RefreshTokenDto;
+import de.ids_mannheim.korap.oauth2.dto.OAuth2TokenDto;
import de.ids_mannheim.korap.oauth2.oltu.OAuth2AuthorizationRequest;
import de.ids_mannheim.korap.oauth2.oltu.OAuth2RevokeAllTokenSuperRequest;
import de.ids_mannheim.korap.oauth2.oltu.OAuth2RevokeTokenRequest;
@@ -341,7 +341,7 @@
@ResourceFilters({ AuthenticationFilter.class, BlockingFilter.class })
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
- public List<OAuth2RefreshTokenDto> listUserRefreshToken (
+ public List<OAuth2TokenDto> listUserRefreshToken (
@Context SecurityContext context,
@FormParam("client_id") String clientId,
@FormParam("client_secret") String clientSecret) {
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java
index e9fdd12..68b7f3b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/InfoControllerTest.java
@@ -12,6 +12,7 @@
import de.ids_mannheim.korap.config.KustvaktConfiguration;
import de.ids_mannheim.korap.config.SpringJerseyTest;
import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.query.serialize.QuerySerializer;
import de.ids_mannheim.korap.utils.JsonUtils;
import de.ids_mannheim.korap.utils.ServiceInfo;
import de.ids_mannheim.korap.web.SearchKrill;
@@ -41,7 +42,7 @@
node.at("/kustvakt_version").asText());
assertEquals(krill.getIndex().getVersion(),
node.at("/krill_version").asText());
- assertEquals(ServiceInfo.getInfo().getKoralVersion(),
- node.at("/koral_version").asText());
+ QuerySerializer s = new QuerySerializer();
+ assertEquals(s.getVersion(), node.at("/koral_version").asText());
}
}