diff --git a/Jenkinsfile_CNP b/Jenkinsfile_CNP index 070c35b762..5ba4d1260e 100644 --- a/Jenkinsfile_CNP +++ b/Jenkinsfile_CNP @@ -23,6 +23,7 @@ def secrets = [ secret('pcs-prd-admin-password', 'PCS_PRD_ADMIN_PASSWORD'), secret('idam-expired-user-token', 'IDAM_EXPIRED_USER_TOKEN'), secret('s2s-expired-service-token', 'S2S_EXPIRED_TOKEN'), + secret('pcs-solicitor-automation-email','PCS_SOLICITOR_AUTOMATION_EMAIL'), ] ] diff --git a/Jenkinsfile_nightly b/Jenkinsfile_nightly index 6f5fd8fd2f..9e93512f6f 100644 --- a/Jenkinsfile_nightly +++ b/Jenkinsfile_nightly @@ -81,6 +81,7 @@ def pcsE2eVaultSecrets = [ secret('pcs-api-idam-secret', 'PCS_API_IDAM_SECRET'), secret('idam-pcs-user-password', 'IDAM_PCS_USER_PASSWORD'), secret('pcs-solicitor-automation-uid', 'PCS_SOLICITOR_AUTOMATION_UID'), + secret('pcs-solicitor-automation-email','PCS_SOLICITOR_AUTOMATION_EMAIL'), ] withNightlyPipeline(type, product, component) { diff --git a/README.md b/README.md index 1dedde9b13..659d1ab478 100644 --- a/README.md +++ b/README.md @@ -54,18 +54,19 @@ authMode = AuthMode.AAT Then set the following environment variables based on the value below or named secret from the PCS AAT key vault: -| Environment Variable | Value or Secret Name | -| ---------------------------- | ---------------------------------------------------------------------------- | -| LOCATION_REF_URL | http://rd-location-ref-api-aat.service.core-compute-aat.internal | -| DATA_STORE_URL_BASE | https://ccd-data-store-api-pcs-api-pr-{CHANGE_ID}.preview.platform.hmcts.net | -| PCS_API_S2S_SECRET | secret: pcs-api-s2s-secret | -| IDAM_CLIENT_SECRET | secret: pcs-api-idam-secret | -| PCS_IDAM_SYSTEM_USERNAME | secret: idam-system-user-name | -| PCS_IDAM_SYSTEM_PASSWORD | secret: idam-system-user-password | -| PCS_PRD_ADMIN_USERNAME | secret: pcs-prd-admin-username | -| PCS_PRD_ADMIN_PASSWORD | secret: pcs-prd-admin-password | -| IDAM_PCS_USER_PASSWORD | secret: idam-pcs-user-password | -| PCS_SOLICITOR_AUTOMATION_UID | secret: pcs-solicitor-automation-uid | +| Environment Variable | Value or Secret Name | +|--------------------------------|------------------------------------------------------------------------------| +| LOCATION_REF_URL | http://rd-location-ref-api-aat.service.core-compute-aat.internal | +| DATA_STORE_URL_BASE | https://ccd-data-store-api-pcs-api-pr-{CHANGE_ID}.preview.platform.hmcts.net | +| PCS_API_S2S_SECRET | secret: pcs-api-s2s-secret | +| IDAM_CLIENT_SECRET | secret: pcs-api-idam-secret | +| PCS_IDAM_SYSTEM_USERNAME | secret: idam-system-user-name | +| PCS_IDAM_SYSTEM_PASSWORD | secret: idam-system-user-password | +| PCS_PRD_ADMIN_USERNAME | secret: pcs-prd-admin-username | +| PCS_PRD_ADMIN_PASSWORD | secret: pcs-prd-admin-password | +| IDAM_PCS_USER_PASSWORD | secret: idam-pcs-user-password | +| PCS_SOLICITOR_AUTOMATION_UID | secret: pcs-solicitor-automation-uid | +| PCS_SOLICITOR_AUTOMATION_EMAIL | secret: pcs-solicitor-automation-email | Finally, run the service with the `bootWithCCD` task as above. @@ -91,13 +92,13 @@ To access the swagger documentation for the API, go to http://localhost:3206/swa #### Generating the CCD definition XLS We can generate the xlsx spreadsheet by running the script: ``` -./bin/create-xlsx.sh +./bin/create-xlsx.sh ``` -This spreadsheet can be found in: /build/definitions/CCD_Definition_PCS_ENVIRONMENT.xlsx +This spreadsheet can be found in: /build/definitions/CCD_Definition_PCS_ENVIRONMENT.xlsx You can specify which environment to generate the spreadsheet for by passing it in when calling the script. E.g ./bin/create-xlsx.sh preview. -If you encounter the error: +If you encounter the error: ``` [{"code":"UNAUTHORIZED","message":"authentication required,}] ``` diff --git a/src/e2eTest/config/global-setup.config.ts b/src/e2eTest/config/global-setup.config.ts index 94c61a53f4..678435fb0f 100644 --- a/src/e2eTest/config/global-setup.config.ts +++ b/src/e2eTest/config/global-setup.config.ts @@ -44,7 +44,7 @@ async function authenticateAndSaveState(): Promise { ); } if (!user.claimantSolicitor.email || !user.claimantSolicitor.password) { - throw new Error('Login failed: missing credentials. Set IDAM_PCS_USER_PASSWORD.'); + throw new Error('Login failed: missing credentials. Set PCS_SOLICITOR_AUTOMATION_EMAIL and IDAM_PCS_USER_PASSWORD.'); } const authDir = path.dirname(STORAGE_STATE_PATH); diff --git a/src/e2eTest/data/user-data/permanent.user.data.ts b/src/e2eTest/data/user-data/permanent.user.data.ts index 20df3e10ba..a0890fd0d1 100644 --- a/src/e2eTest/data/user-data/permanent.user.data.ts +++ b/src/e2eTest/data/user-data/permanent.user.data.ts @@ -1,6 +1,6 @@ export const user = { claimantSolicitor: { - email: 'pcs-solicitor-automation@test.com', + email: process.env.PCS_SOLICITOR_AUTOMATION_EMAIL, password: process.env.IDAM_PCS_USER_PASSWORD, uid: process.env.PCS_SOLICITOR_AUTOMATION_UID }, diff --git a/src/functionalTest/java/uk/gov/hmcts/reform/pcs/functional/config/TestConstants.java b/src/functionalTest/java/uk/gov/hmcts/reform/pcs/functional/config/TestConstants.java index 01156fa19c..d3403f26c6 100644 --- a/src/functionalTest/java/uk/gov/hmcts/reform/pcs/functional/config/TestConstants.java +++ b/src/functionalTest/java/uk/gov/hmcts/reform/pcs/functional/config/TestConstants.java @@ -10,7 +10,7 @@ public class TestConstants { public static final String SERVICE_AUTHORIZATION = "ServiceAuthorization"; public static final String EXPIRED_S2S_TOKEN = getEnv("S2S_EXPIRED_TOKEN"); public static final String EXPIRED_IDAM_TOKEN = getEnv("IDAM_EXPIRED_USER_TOKEN"); - public static final String PCS_SOLICITOR_USER = "pcs-solicitor-automation@test.com"; + public static final String PCS_SOLICITOR_USER = getEnv("PCS_SOLICITOR_AUTOMATION_EMAIL"); public static final String PCS_SOLICITOR_AUTOMATION_IDAM_UID = getEnv("PCS_SOLICITOR_AUTOMATION_UID"); public static final String GENERIC_PASSWORD = getEnv("IDAM_PCS_USER_PASSWORD"); }