From ff5190fa7b40386658eb20ebba5b4d885cd98ba3 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Fri, 5 Aug 2022 08:27:39 +0200 Subject: NONRTRIC PMS, Bugfix If the auth-token-file parameter in the file application.yaml is missing, it would not default to an empty file name. Issue-ID: CCSDK-3683 Signed-off-by: PatrikBuhr Change-Id: I6957762ac0df2c159a8273f3bf161b1a68ab85e7 --- .../ccsdk/oran/a1policymanagementservice/clients/SecurityContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SecurityContext.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SecurityContext.java index 3566aada..fe7c11f0 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SecurityContext.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SecurityContext.java @@ -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; } -- cgit 1.2.3-korg