Remove default password from application.yml 42/120542/3
authorRenu Kumari <renu.kumari@bell.ca>
Wed, 14 Apr 2021 14:14:13 +0000 (10:14 -0400)
committerRishi Chail <rishi.chail@est.tech>
Thu, 15 Apr 2021 16:36:48 +0000 (16:36 +0000)
Issue-ID: CPS-319
Signed-off-by: Renu Kumari <renu.kumari@bell.ca>
Change-Id: I61a5e098ffa173721cfa48aa0b992610f6a6e1a0

cps-application/src/main/resources/application.yml
docker-compose/README.md
docker-compose/docker-compose.yml

index 1bcb496..3edb20c 100644 (file)
@@ -61,8 +61,8 @@ security:
     # comma-separated uri patterns which do not require authorization\r
     permit-uri: /manage/health/**,/manage/info,/swagger-ui/**,/swagger-resources/**,/v3/api-docs\r
     auth:\r
-        username: ${CPS_USERNAME:cpsuser}\r
-        password: ${CPS_PASSWORD:cpsr0cks!}\r
+        username: ${CPS_USERNAME}\r
+        password: ${CPS_PASSWORD}\r
 \r
 # Actuator\r
 management:\r
index 3e9cd63..4d20ece 100644 (file)
@@ -55,7 +55,7 @@ Then CPS can be started either using a Java Archive previously built or directly
 Following command starts the application using JAR file:
 
 ```bash
-DB_HOST=localhost DB_USERNAME=cps DB_PASSWORD=cps \
+DB_HOST=localhost DB_USERNAME=cps DB_PASSWORD=cps CPS_USERNAME=cpsuser CPS_PASSWORD=cpsr0cks! \
   java -jar cps-application/target/cps-application-x.y.z-SNAPSHOT.jar
 ```
 
@@ -65,7 +65,8 @@ Here are the steps to run or debug the application from Intellij:
 
 1. Enable the desired maven profile form Maven Tool Window
 2. Run a configuration from `Run -> Edit configurations` with following settings:
-   * `Environment variables`: `DB_HOST=localhost;DB_USERNAME=cps;DB_PASSWORD=cps`
+   * `Environment variables`: `DB_HOST=localhost;DB_USERNAME=cps;DB_PASSWORD=cps
+                                CPS_USERNAME=cpsuser CPS_PASSWORD=cpsr0cks!`
 
 ## Accessing services
 
index 0cd4951..2251304 100644 (file)
@@ -55,6 +55,8 @@ services:
     ports:
       - "8883:8080"
     environment:
+      CPS_USERNAME: ${CPS_USERNAME:-cpsuser}
+      CPS_PASSWORD: ${CPS_PASSWORD:-cpsr0cks!}
       DB_HOST: dbpostgresql
       DB_USERNAME: ${DB_USERNAME}
       DB_PASSWORD: ${DB_PASSWORD}