diff --git a/pom.xml b/pom.xml
index 3921015a8..27833900f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
io.mosip
mimoto
- 0.2.0-SNAPSHOT
+ 1.2.0-SNAPSHOT
mimoto
Mobile server backend supporting Inji.
@@ -529,14 +529,14 @@
true
- ${project.build.outputDirectory}/build.json
+ ${project.build.outputDirectory}/git.properties
- ^git.build.(time|version)$
+ ^git.build.(time|version|host)$
+ ^git.(branch|tags)$
^git.commit.id.(abbrev|full)$
^git.branch$
full
- json
diff --git a/src/main/java/io/mosip/mimoto/MimotoServiceApplication.java b/src/main/java/io/mosip/mimoto/MimotoServiceApplication.java
index b89cf5fa0..425fa2d63 100644
--- a/src/main/java/io/mosip/mimoto/MimotoServiceApplication.java
+++ b/src/main/java/io/mosip/mimoto/MimotoServiceApplication.java
@@ -1,8 +1,5 @@
package io.mosip.mimoto;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import org.json.simple.JSONObject;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration;
@@ -44,27 +41,7 @@ public ThreadPoolTaskScheduler taskScheduler() {
return threadPoolTaskScheduler;
}
- public static JSONObject getGitProp() {
- try {
- return (new ObjectMapper()).readValue(
- MimotoServiceApplication.class.getClassLoader().getResourceAsStream("build.json"),
- JSONObject.class
- );
- } catch (Exception e) {
- System.err.println("Error when trying to read build.json file: " + e);
- }
- return new JSONObject();
- }
-
public static void main(String[] args) {
- JSONObject gitProp = getGitProp();
- System.out.println(
- String.format(
- "Mimoto Service version: %s - revision: %s @ branch: %s | build @ %s",
- gitProp.get("git.build.version"),
- gitProp.get("git.commit.id.abbrev"),
- gitProp.get("git.branch"),
- gitProp.get("git.build.time")));
SpringApplication.run(MimotoServiceApplication.class, args);
}
diff --git a/src/main/java/io/mosip/mimoto/config/Config.java b/src/main/java/io/mosip/mimoto/config/Config.java
index 51be07df1..7f59224ae 100644
--- a/src/main/java/io/mosip/mimoto/config/Config.java
+++ b/src/main/java/io/mosip/mimoto/config/Config.java
@@ -41,14 +41,7 @@ protected void configure(HttpSecurity http) throws Exception {
if (!isCSRFEnable) {
http = http.csrf().disable();
}
- // http.authorizeRequests().antMatchers("*").authenticated().and().exceptionHandling()
- // .authenticationEntryPoint(new AuthEntryPoint()).and().sessionManagement()
- // .sessionCreationPolicy(SessionCreationPolicy.STATELESS);
- // http.addFilterBefore(authFilter(),
- // UsernamePasswordAuthenticationFilter.class);
-
- // FIXME: web security is disabled for all enpoints
http.authorizeRequests().antMatchers("*").authenticated().anyRequest().permitAll().and().exceptionHandling();
if (isCORSEnable) {
http.addFilterBefore(new CorsFilter(origins), AuthFilter.class);
diff --git a/src/main/java/io/mosip/mimoto/controller/AttestationServiceController.java b/src/main/java/io/mosip/mimoto/controller/AttestationServiceController.java
index ca4a52afb..cec9cdff6 100644
--- a/src/main/java/io/mosip/mimoto/controller/AttestationServiceController.java
+++ b/src/main/java/io/mosip/mimoto/controller/AttestationServiceController.java
@@ -1,7 +1,6 @@
package io.mosip.mimoto.controller;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -17,7 +16,6 @@
import io.mosip.mimoto.util.AttestationOnlineVerify;
import io.mosip.mimoto.util.LoggerUtil;
-@SpringBootApplication
@RestController
@RequestMapping(value = "/safetynet")
public class AttestationServiceController {
diff --git a/src/main/java/io/mosip/mimoto/controller/CredentialShareController.java b/src/main/java/io/mosip/mimoto/controller/CredentialShareController.java
index aa2d9677a..b1c1fd326 100644
--- a/src/main/java/io/mosip/mimoto/controller/CredentialShareController.java
+++ b/src/main/java/io/mosip/mimoto/controller/CredentialShareController.java
@@ -82,7 +82,7 @@ public class CredentialShareController {
* @throws Exception
*/
@PostMapping(path = "/callback/notify", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
- @PreAuthenticateContentAndVerifyIntent(secret = "${mosip.event.secret}", callback = "/v1/mimoto/credentialshare/callback/notify", topic = "${mosip.event.topic}")
+ @PreAuthenticateContentAndVerifyIntent(secret = "${mosip.event.secret}", callback = "/credentialshare/callback/notify", topic = "${mosip.event.topic}")
public ResponseEntity handleSubscribeEvent(@RequestBody EventModel eventModel)
throws Exception {
logger.info("Received websub event:: transaction id = " + eventModel.getEvent().getTransactionId());
diff --git a/src/main/java/io/mosip/mimoto/controller/MimotoServiceController.java b/src/main/java/io/mosip/mimoto/controller/MimotoServiceController.java
new file mode 100644
index 000000000..f8591866c
--- /dev/null
+++ b/src/main/java/io/mosip/mimoto/controller/MimotoServiceController.java
@@ -0,0 +1,24 @@
+package io.mosip.mimoto.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.mosip.mimoto.util.VersionInfo;
+
+@RestController
+public class MimotoServiceController {
+ @Autowired
+ VersionInfo versionInfo;
+
+ /**
+ * Return build properties with git revision and version information.
+ *
+ * @return
+ */
+ @GetMapping("/info")
+ public ResponseEntity