diff options
author | PatrikBuhr <patrik.buhr@est.tech> | 2022-08-05 08:27:39 +0200 |
---|---|---|
committer | PatrikBuhr <patrik.buhr@est.tech> | 2022-08-05 08:35:54 +0200 |
commit | ff5190fa7b40386658eb20ebba5b4d885cd98ba3 (patch) | |
tree | 8bbc797a359e3fa62ddfeb9ad06d64411d05042d /a1-policy-management/src/main/java/org | |
parent | 685520fc0bd6f302c3ee99ddccc71618807b70a3 (diff) |
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 <patrik.buhr@est.tech>
Change-Id: I6957762ac0df2c159a8273f3bf161b1a68ab85e7
Diffstat (limited to 'a1-policy-management/src/main/java/org')
-rw-r--r-- | a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/SecurityContext.java | 4 |
1 files 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; } |