NONRTRIC - bugfix 32/8832/1
authorPatrikBuhr <patrik.buhr@est.tech>
Fri, 5 Aug 2022 06:50:01 +0000 (08:50 +0200)
committerPatrikBuhr <patrik.buhr@est.tech>
Fri, 5 Aug 2022 06:50:01 +0000 (08:50 +0200)
If the auth-token-file parameter in the file application.yaml is missing, it would not default to an empty file name.

Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-773
Change-Id: Icb357e7a44968df07d42299650700f1003d30abd

src/main/java/org/oran/dmaapadapter/clients/SecurityContext.java
src/main/java/org/oran/dmaapadapter/configuration/ApplicationConfig.java

index 83c0c42..85a18a9 100644 (file)
@@ -47,7 +47,7 @@ public class SecurityContext {
     @Setter
     private Path authTokenFilePath;
 
-    public SecurityContext(@Value("${app.auth-token-file:\"\"}") String authTokenFilename) {
+    public SecurityContext(@Value("${app.auth-token-file:}") String authTokenFilename) {
         if (!authTokenFilename.isEmpty()) {
             this.authTokenFilePath = Path.of(authTokenFilename);
         }
@@ -63,7 +63,7 @@ public class SecurityContext {
         }
         try {
             long lastModified = authTokenFilePath.toFile().lastModified();
-            if (lastModified != this.tokenTimestamp) {
+            if (tokenTimestamp == 0 || lastModified != this.tokenTimestamp) {
                 this.authToken = Files.readString(authTokenFilePath);
                 this.tokenTimestamp = lastModified;
             }
index e84889d..4e913b6 100644 (file)
@@ -69,7 +69,7 @@ public class ApplicationConfig {
     @Value("${app.webclient.trust-store}")
     private String sslTrustStore = "";
 
-    @Value("${app.webclient.http.proxy-host:\"\"}")
+    @Value("${app.webclient.http.proxy-host:}")
     private String httpProxyHost = "";
 
     @Value("${app.webclient.http.proxy-port:0}")