diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index d6861e78..64335f51 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -37,11 +37,6 @@ on: description: 'The github tag to run the test pack from' required: false default: "main" - run_sha1_tests: - description: whether to also run against a sha1 enabled apigee app - required: false - type: boolean - default: false jobs: regression_tests: @@ -64,6 +59,22 @@ jobs: echo run identifier "$ID"-"$PRODUCT"-"$ENV"-"$PULL_REQUEST_ID" echo run identifier "$ID"-"$PRODUCT"-"$ENV"-"$PULL_REQUEST_ID" >> "$GITHUB_STEP_SUMMARY" + - name: show_input_parameters + env: + tags: ${{ inputs.tags }} + environment: ${{ inputs.environment }} + product: ${{ inputs.product }} + id: ${{ inputs.id }} + pull_request_id: ${{ inputs.pull_request_id }} + github_tag: ${{ inputs.github_tag }} + run: | + echo "tags: ${tags}" + echo "environment: ${environment}" + echo "product: ${product}" + echo "id: ${id}" + echo "pull_request_id: ${pull_request_id}" + echo "github_tag: ${github_tag}" + # using git commit sha for version of action to ensure we have stable version - name: Install asdf uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 @@ -103,41 +114,39 @@ jobs: ENVIRONMENT: ${{ inputs.environment }} PULL_REQUEST_ID: ${{ inputs.pull_request_id }} TAGS: ${{ inputs.tags }} - CLIENT_ID: ${{ secrets.CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} - CERTIFICATE: ${{ secrets.CERTIFICATE }} - PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} - JWT_KID: ${{ secrets.JWT_KID }} - JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }} - run: | - export CLIENT_ID="$CLIENT_ID" - export CLIENT_SECRET="$CLIENT_SECRET" - export CERTIFICATE="$CERTIFICATE" - export PRIVATE_KEY="$PRIVATE_KEY" - export JWT_KID="$JWT_KID" - export JWT_PRIVATE_KEY="$JWT_PRIVATE_KEY" - export PULL_REQUEST_ID="$PULL_REQUEST_ID" - echo Pull request ID = "$PULL_REQUEST_ID" - poetry run python ./runner.py --env="$ENVIRONMENT" --product="$PRODUCT" --tags="$TAGS" - - - name: SHA1 Regression Tests - id: sha1_tests - continue-on-error: true - if: inputs.run_sha1_tests == true - env: - PRODUCT: ${{ inputs.product }} - ENVIRONMENT: ${{ inputs.environment }} - PULL_REQUEST_ID: ${{ inputs.pull_request_id }} - TAGS: ${{ inputs.tags }} - CLIENT_ID: ${{ secrets.SHA1_CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.SHA1_CLIENT_SECRET }} + EPS_FHIR_CLIENT_ID: ${{ secrets.EPS_FHIR_CLIENT_ID }} + EPS_FHIR_CLIENT_SECRET: ${{ secrets.EPS_FHIR_CLIENT_SECRET }} + EPS_FHIR_SHA1_CLIENT_ID: ${{ secrets.EPS_FHIR_SHA1_CLIENT_ID }} + EPS_FHIR_SHA1_CLIENT_SECRET: ${{ secrets.EPS_FHIR_SHA1_CLIENT_SECRET }} + EPS_FHIR_PRESCRIBING_CLIENT_ID: ${{ secrets.EPS_FHIR_PRESCRIBING_CLIENT_ID }} + EPS_FHIR_PRESCRIBING_CLIENT_SECRET: ${{ secrets.EPS_FHIR_PRESCRIBING_CLIENT_SECRET }} + EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID: ${{ secrets.EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID }} + EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET: ${{ secrets.EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET }} + EPS_FHIR_DISPENSING_CLIENT_ID: ${{ secrets.EPS_FHIR_DISPENSING_CLIENT_ID }} + EPS_FHIR_DISPENSING_CLIENT_SECRET: ${{ secrets.EPS_FHIR_DISPENSING_CLIENT_SECRET }} + PFP_CLIENT_ID: ${{ secrets.PFP_CLIENT_ID }} + PFP_CLIENT_SECRET: ${{ secrets.PFP_CLIENT_SECRET }} + PSU_CLIENT_ID: ${{ secrets.PSU_CLIENT_ID }} + PSU_CLIENT_SECRET: ${{ secrets.PSU_CLIENT_SECRET }} CERTIFICATE: ${{ secrets.CERTIFICATE }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} JWT_KID: ${{ secrets.JWT_KID }} JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }} run: | - export CLIENT_ID="$CLIENT_ID" - export CLIENT_SECRET="$CLIENT_SECRET" + export EPS_FHIR_CLIENT_ID="$EPS_FHIR_CLIENT_ID" + export EPS_FHIR_CLIENT_SECRET="$EPS_FHIR_CLIENT_SECRET" + export EPS_FHIR_SHA1_CLIENT_ID="$EPS_FHIR_SHA1_CLIENT_ID" + export EPS_FHIR_SHA1_CLIENT_SECRET="$EPS_FHIR_SHA1_CLIENT_SECRET" + export EPS_FHIR_PRESCRIBING_CLIENT_ID="$EPS_FHIR_PRESCRIBING_CLIENT_ID" + export EPS_FHIR_PRESCRIBING_CLIENT_SECRET="$EPS_FHIR_PRESCRIBING_CLIENT_SECRET" + export EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID="$EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID" + export EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET="$EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET" + export EPS_FHIR_DISPENSING_CLIENT_ID="$EPS_FHIR_DISPENSING_CLIENT_ID" + export EPS_FHIR_DISPENSING_CLIENT_SECRET="$EPS_FHIR_DISPENSING_CLIENT_SECRET" + export PFP_CLIENT_ID="$PFP_CLIENT_ID" + export PFP_CLIENT_SECRET="$PFP_CLIENT_SECRET" + export PSU_CLIENT_ID="$PSU_CLIENT_ID" + export PSU_CLIENT_SECRET="$PSU_CLIENT_SECRET" export CERTIFICATE="$CERTIFICATE" export PRIVATE_KEY="$PRIVATE_KEY" export JWT_KID="$JWT_KID" @@ -163,7 +172,7 @@ jobs: repositories: "electronic-prescription-service-api-regression-tests,eps-test-reports" - name: Report failure on test failure - if: steps.tests.outcome != 'success' || ( steps.sha1_tests.outcome != 'success' && steps.sha1_tests.outcome != 'skipped' ) + if: steps.tests.outcome != 'success' run: | poetry run python scripts/send_test_results.py --token=${{ steps.generate-token.outputs.token }} --run_id ${{GITHUB.RUN_ID}} echo The regression tests step failed, this likely means there are test failures. diff --git a/features/environment.py b/features/environment.py index fba983ef..47f267d1 100644 --- a/features/environment.py +++ b/features/environment.py @@ -49,6 +49,36 @@ "SANDBOX": f".sandbox.dev{AWS_BASE_URL}", } +APIGEE_APPS = { + "EPS-FHIR": { + "client_id": os.getenv("EPS_FHIR_CLIENT_ID"), + "client_secret": os.getenv("EPS_FHIR_CLIENT_SECRET"), + }, + "EPS-FHIR-SHA1": { + "client_id": os.getenv("EPS_FHIR_SHA1_CLIENT_ID"), + "client_secret": os.getenv("EPS_FHIR_SHA1_CLIENT_SECRET"), + }, + "EPS-FHIR-PRESCRIBING": { + "client_id": os.getenv("EPS_FHIR_PRESCRIBING_CLIENT_ID"), + "client_secret": os.getenv("EPS_FHIR_PRESCRIBING_CLIENT_SECRET"), + }, + "EPS-FHIR-PRESCRIBING-SHA1": { + "client_id": os.getenv("EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID"), + "client_secret": os.getenv("EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET"), + }, + "EPS-FHIR-DISPENSING": { + "client_id": os.getenv("EPS_FHIR_DISPENSING_CLIENT_ID"), + "client_secret": os.getenv("EPS_FHIR_DISPENSING_CLIENT_SECRET"), + }, + "PFP-APIGEE": { + "client_id": os.getenv("PFP_CLIENT_ID"), + "client_secret": os.getenv("PFP_CLIENT_SECRET"), + }, + "PSU": { + "client_id": os.getenv("PSU_CLIENT_ID"), + "client_secret": os.getenv("PSU_CLIENT_SECRET"), + }, +} CIS2_USERS = { "prescriber": {"user_id": "656005750107", "role_id": "555254242105"}, "dispenser": {"user_id": "555260695103", "role_id": "555265434108"}, @@ -79,8 +109,6 @@ CERTIFICATE = os.getenv("CERTIFICATE") PRIVATE_KEY = os.getenv("PRIVATE_KEY") -CLIENT_ID = os.getenv("CLIENT_ID") -CLIENT_SECRET = os.getenv("CLIENT_SECRET") PULL_REQUEST_ID = os.getenv("PULL_REQUEST_ID") JWT_PRIVATE_KEY = os.getenv("JWT_PRIVATE_KEY") JWT_KID = os.getenv("JWT_KID") @@ -108,7 +136,24 @@ def count_of_scenarios_to_run(context): return total_scenarios +def before_feature(context, feature): + if "skip" in feature.tags: + feature.skip("Marked with @skip") + return + environment = context.config.userdata["env"].lower() + if "skip-sandbox" in feature.tags and "sandbox" in environment: + feature.skip("Marked with @skip-sandbox") + return + + def before_scenario(context, scenario): + if "skip" in scenario.effective_tags: + scenario.skip("Marked with @skip") + return + environment = context.config.userdata["env"].lower() + if "skip-sandbox" in scenario.effective_tags and "sandbox" in environment: + scenario.skip("Marked with @skip-sandbox") + return product = context.config.userdata["product"].upper() if product == "CPTS-UI": global _playwright @@ -120,9 +165,11 @@ def before_scenario(context, scenario): def after_scenario(context, scenario): - if context.page is not None: - global _page - _page.close() + product = context.config.userdata["product"].upper() + if product == "CPTS-UI": + if context.page is not None: + global _page + _page.close() def before_all(context): diff --git a/features/eps_fhir/cancel_prescriptions.feature b/features/eps_fhir/cancel_prescriptions.feature index 63c948bd..d6083bca 100644 --- a/features/eps_fhir/cancel_prescriptions.feature +++ b/features/eps_fhir/cancel_prescriptions.feature @@ -2,9 +2,13 @@ @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-3869 Feature: I can cancel prescriptions - Scenario: I can cancel a prescription - Given I am an authorised prescriber + Scenario Outline: I can cancel a prescription + Given I am an authorised prescriber with app And I successfully prepare and sign a non-nominated prescription When I cancel all line items on the prescription Then the response indicates a success And the response body indicates a successful cancel action + Examples: + | App | + | EPS-FHIR | + | EPS-FHIR-SHA1 | diff --git a/features/eps_fhir/create_prescriptions.feature b/features/eps_fhir/create_prescriptions.feature index 3cf87bc0..5ba1bebb 100644 --- a/features/eps_fhir/create_prescriptions.feature +++ b/features/eps_fhir/create_prescriptions.feature @@ -3,13 +3,27 @@ Feature: I can create prescriptions Scenario Outline: I can create, sign and release a prescription - Given I am an authorised prescriber + Given I am an authorised prescriber with app And I successfully prepare and sign a prescription - When I am an authorised dispenser + When I am an authorised dispenser with EPS-FHIR app And I release the prescription Then the response indicates a success And the response body indicates a successful release action Examples: - | Type | - | nominated | - | non-nominated | + | Type | App | + | nominated | EPS-FHIR | + | non-nominated | EPS-FHIR | + | nominated | EPS-FHIR-SHA1 | + | non-nominated | EPS-FHIR-SHA1 | + + @skip-sandbox + Scenario: I can create a prescription with sha256 + Given I am an authorised prescriber with EPS-FHIR app + And I successfully prepare a nominated prescription + Then the signing algorithm is RS256 + + @skip-sandbox + Scenario: I can create a prescription with sha1 + Given I am an authorised prescriber with EPS-FHIR-SHA1 app + And I successfully prepare a nominated prescription + Then the signing algorithm is RS1 diff --git a/features/eps_fhir/dispense_prescriptions.feature b/features/eps_fhir/dispense_prescriptions.feature index 0b84ac2c..14d03be4 100644 --- a/features/eps_fhir/dispense_prescriptions.feature +++ b/features/eps_fhir/dispense_prescriptions.feature @@ -3,14 +3,14 @@ Feature: I can dispense prescriptions @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-3865 Scenario: I can dispense a prescription - Given a prescription has been created and released + Given a prescription has been created and released using apim apis When I dispense the prescription Then the response indicates a success And the response body indicates a successful dispense action @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-3868 Scenario: I can amend a single dispense notification - Given a new prescription has been dispensed + Given a new prescription has been dispensed using apim apis When I amend the dispense notification Then the response indicates a success And the response body indicates a successful amend dispense action @@ -18,7 +18,7 @@ Feature: I can dispense prescriptions @withdraw @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-3867 Scenario: I can withdraw a dispense notification - Given a new prescription has been dispensed + Given a new prescription has been dispensed using apim apis When I withdraw the dispense notification Then the response indicates a success And the response body indicates a successful dispense withdrawal action diff --git a/features/eps_fhir/return_prescriptions.feature b/features/eps_fhir/return_prescriptions.feature index 245978fe..fd74df53 100644 --- a/features/eps_fhir/return_prescriptions.feature +++ b/features/eps_fhir/return_prescriptions.feature @@ -3,7 +3,7 @@ Feature: I can return prescriptions Scenario: I can return a prescription - Given a prescription has been created and released + Given a prescription has been created and released using apim apis When I return the prescription Then the response indicates a success And the response body indicates a successful return action diff --git a/features/eps_fhir/validator.feature b/features/eps_fhir/validator.feature index 9123b42b..0ea94851 100644 --- a/features/eps_fhir/validator.feature +++ b/features/eps_fhir/validator.feature @@ -4,57 +4,62 @@ Feature: I can call the validator endpoint Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to false - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a valid request to the eps_fhir validator endpoint with show validation set to false Then the response indicates a success And the validator response has 1 information issue Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to true - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a valid request to the eps_fhir validator endpoint with show validation set to true Then the response indicates a bad request And the validator response has many information issue And the validator response has 0 error issue Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to unset - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a valid request to the eps_fhir validator endpoint with show validation set to unset Then the response indicates a success And the validator response has 1 information issue Scenario: I can call the validator endpoint with invalid fhir - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a invalid request to the eps_fhir validator endpoint with show validation set to false Then the response indicates a bad request And the validator response has many error issue And the validator response has error with diagnostic containing Failed to parse JSON encoded FHIR content + @skip Scenario: I can call the validator endpoint with missing dosage instructions message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a request with file missing_dosage_instructions/request.json to the eps_fhir validator endpoint Then the response indicates a bad request And the validator response matches missing_dosage_instructions/response.json + @skip Scenario: I can call the validator endpoint with missing dispense request quantity message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a request with file missing_dispense_request_quantity/request.json to the eps_fhir validator endpoint Then the response indicates a bad request And the validator response matches missing_dispense_request_quantity/response.json + @skip Scenario: I can call the validator endpoint with missing medication message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a request with file missing_medication/request.json to the eps_fhir validator endpoint Then the response indicates a bad request And the validator response matches missing_medication/response.json + @skip Scenario: I can call the validator endpoint with too many medication requests message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a request with file too_many_medication_requests/request.json to the eps_fhir validator endpoint Then the response indicates a bad request And the validator response matches too_many_medication_requests/response.json + @skip Scenario: I can call the validator endpoint with unknown endorsement message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app When I make a request with file unknown_endorsement/request.json to the eps_fhir validator endpoint Then the response indicates a bad request And the validator response matches unknown_endorsement/response.json diff --git a/features/eps_fhir_dispensing/dispense_prescriptions.feature b/features/eps_fhir_dispensing/dispense_prescriptions.feature index f7c8ed4c..a7a32aeb 100644 --- a/features/eps_fhir_dispensing/dispense_prescriptions.feature +++ b/features/eps_fhir_dispensing/dispense_prescriptions.feature @@ -4,21 +4,21 @@ Feature: I can dispense prescriptions @dispense Scenario: I can dispense a prescription - Given a prescription has been created and released + Given a prescription has been created and released using proxygen apis When I dispense the prescription Then the response indicates a success And the response body indicates a successful dispense action @amend Scenario: I can amend a single dispense notification - Given a new prescription has been dispensed + Given a new prescription has been dispensed using proxygen apis When I amend the dispense notification Then the response indicates a success And the response body indicates a successful amend dispense action @withdraw Scenario: I can withdraw a dispense notification - Given a new prescription has been dispensed + Given a new prescription has been dispensed using proxygen apis When I withdraw the dispense notification Then the response indicates a success And the response body indicates a successful dispense withdrawal action diff --git a/features/eps_fhir_dispensing/return_prescriptions.feature b/features/eps_fhir_dispensing/return_prescriptions.feature index 36de5f14..1827b217 100644 --- a/features/eps_fhir_dispensing/return_prescriptions.feature +++ b/features/eps_fhir_dispensing/return_prescriptions.feature @@ -3,7 +3,7 @@ Feature: I can return prescriptions Scenario: I can return a prescription - Given a prescription has been created and released + Given a prescription has been created and released using proxygen apis When I return the prescription Then the response indicates a success And the response body indicates a successful return action diff --git a/features/eps_fhir_dispensing/validator.feature b/features/eps_fhir_dispensing/validator.feature index 768bd83a..f7a76471 100644 --- a/features/eps_fhir_dispensing/validator.feature +++ b/features/eps_fhir_dispensing/validator.feature @@ -4,57 +4,62 @@ Feature: I can call the validator endpoint Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to false - Given I am an authorised dispenser + Given I am an authorised dispenser with EPS-FHIR-DISPENSING app When I make a valid request to the eps_fhir_dispensing validator endpoint with show validation set to false Then the response indicates a success And the validator response has 1 information issue Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to true - Given I am an authorised dispenser + Given I am an authorised dispenser with EPS-FHIR-DISPENSING app When I make a valid request to the eps_fhir_dispensing validator endpoint with show validation set to true Then the response indicates a bad request And the validator response has many information issue And the validator response has 0 error issue Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to unset - Given I am an authorised dispenser + Given I am an authorised dispenser with EPS-FHIR-DISPENSING app When I make a valid request to the eps_fhir_dispensing validator endpoint with show validation set to unset Then the response indicates a success And the validator response has 1 information issue Scenario: I can call the validator endpoint with invalid fhir - Given I am an authorised dispenser + Given I am an authorised dispenser with EPS-FHIR-DISPENSING app When I make a invalid request to the eps_fhir_dispensing validator endpoint with show validation set to false Then the response indicates a bad request And the validator response has many error issue And the validator response has error with diagnostic containing Failed to parse JSON encoded FHIR content + @skip Scenario: I can call the validator endpoint with missing dosage instructions message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file missing_dosage_instructions/request.json to the eps_fhir_dispensing validator endpoint Then the response indicates a bad request And the validator response matches missing_dosage_instructions/response.json + @skip Scenario: I can call the validator endpoint with missing dispense request quantity message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file missing_dispense_request_quantity/request.json to the eps_fhir_dispensing validator endpoint Then the response indicates a bad request And the validator response matches missing_dispense_request_quantity/response.json + @skip Scenario: I can call the validator endpoint with missing medication message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file missing_medication/request.json to the eps_fhir_dispensing validator endpoint Then the response indicates a bad request And the validator response matches missing_medication/response.json + @skip Scenario: I can call the validator endpoint with too many medication requests message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file too_many_medication_requests/request.json to the eps_fhir_dispensing validator endpoint Then the response indicates a bad request And the validator response matches too_many_medication_requests/response.json + @skip Scenario: I can call the validator endpoint with unknown endorsement message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file unknown_endorsement/request.json to the eps_fhir_dispensing validator endpoint Then the response indicates a bad request And the validator response matches unknown_endorsement/response.json diff --git a/features/eps_fhir_prescribing/cancel_prescriptions.feature b/features/eps_fhir_prescribing/cancel_prescriptions.feature index 1e67448b..be923cd0 100644 --- a/features/eps_fhir_prescribing/cancel_prescriptions.feature +++ b/features/eps_fhir_prescribing/cancel_prescriptions.feature @@ -2,9 +2,13 @@ @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4432 Feature: I can cancel prescriptions - Scenario: I can cancel a prescription - Given I am an authorised prescriber + Scenario Outline: I can cancel a prescription + Given I am an authorised prescriber with app And I successfully prepare and sign a non-nominated prescription When I cancel all line items on the prescription Then the response indicates a success And the response body indicates a successful cancel action + Examples: + | App | + | EPS-FHIR-PRESCRIBING | + | EPS-FHIR-PRESCRIBING-SHA1 | diff --git a/features/eps_fhir_prescribing/create_prescriptions.feature b/features/eps_fhir_prescribing/create_prescriptions.feature index 12935cd4..20fc1dc5 100644 --- a/features/eps_fhir_prescribing/create_prescriptions.feature +++ b/features/eps_fhir_prescribing/create_prescriptions.feature @@ -3,13 +3,27 @@ Feature: I can create prescriptions Scenario Outline: I can create, sign and release a prescription - Given I am an authorised prescriber + Given I am an authorised prescriber with app And I successfully prepare and sign a prescription - When I am an authorised dispenser + When I am an authorised dispenser with EPS-FHIR-DISPENSING app And I release the prescription Then the response indicates a success And the response body indicates a successful release action Examples: - | Type | - | nominated | - | non-nominated | + | Type | App | + | nominated | EPS-FHIR-PRESCRIBING | + | non-nominated | EPS-FHIR-PRESCRIBING | + | nominated | EPS-FHIR-PRESCRIBING-SHA1 | + | non-nominated | EPS-FHIR-PRESCRIBING-SHA1 | + + @skip-sandbox + Scenario: I can create a prescription with sha256 + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app + And I successfully prepare a nominated prescription + Then the signing algorithm is RS256 + + @skip-sandbox + Scenario: I can create a prescription with sha1 + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING-SHA1 app + And I successfully prepare a nominated prescription + Then the signing algorithm is RS1 diff --git a/features/eps_fhir_prescribing/validator.feature b/features/eps_fhir_prescribing/validator.feature index 120d0c6b..ee8edfb1 100644 --- a/features/eps_fhir_prescribing/validator.feature +++ b/features/eps_fhir_prescribing/validator.feature @@ -4,57 +4,62 @@ Feature: I can call the validator endpoint Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to false - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a valid request to the eps_fhir_prescribing validator endpoint with show validation set to false Then the response indicates a success And the validator response has 1 information issue Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to true - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a valid request to the eps_fhir_prescribing validator endpoint with show validation set to true Then the response indicates a bad request And the validator response has many information issue And the validator response has 0 error issue Scenario: I can call the validator endpoint with valid fhir with x-show-validation-warnings set to false - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a valid request to the eps_fhir_prescribing validator endpoint with show validation set to unset Then the response indicates a success And the validator response has 1 information issue Scenario: I can call the validator endpoint with invalid fhir - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a invalid request to the eps_fhir_prescribing validator endpoint with show validation set to false Then the response indicates a bad request And the validator response has many error issue And the validator response has error with diagnostic containing Failed to parse JSON encoded FHIR content + @skip Scenario: I can call the validator endpoint with missing dosage instructions message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file missing_dosage_instructions/request.json to the eps_fhir_prescribing validator endpoint Then the response indicates a bad request And the validator response matches missing_dosage_instructions/response.json + @skip Scenario: I can call the validator endpoint with missing dispense request quantity message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file missing_dispense_request_quantity/request.json to the eps_fhir_prescribing validator endpoint Then the response indicates a bad request And the validator response matches missing_dispense_request_quantity/response.json + @skip Scenario: I can call the validator endpoint with missing medication message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file missing_medication/request.json to the eps_fhir_prescribing validator endpoint Then the response indicates a bad request And the validator response matches missing_medication/response.json + @skip Scenario: I can call the validator endpoint with too many medication requests message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file too_many_medication_requests/request.json to the eps_fhir_prescribing validator endpoint Then the response indicates a bad request And the validator response matches too_many_medication_requests/response.json + @skip Scenario: I can call the validator endpoint with unknown endorsement message - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR-PRESCRIBING app When I make a request with file unknown_endorsement/request.json to the eps_fhir_prescribing validator endpoint Then the response indicates a bad request And the validator response matches unknown_endorsement/response.json diff --git a/features/pfp/view_prescriptions.feature b/features/pfp/view_prescriptions.feature index 250ca903..89d56735 100644 --- a/features/pfp/view_prescriptions.feature +++ b/features/pfp/view_prescriptions.feature @@ -3,8 +3,8 @@ Feature: I can see my prescriptions @blocker @smoke @e2e @allure.tms:https://nhsd-jira.digital.nhs.uk/browse/AEA-4222 Scenario: I can see a single prescription - Given I am an authorised prescriber + Given I am an authorised prescriber with EPS-FHIR app And I successfully prepare and sign a prescription - When I am authenticated + When I am authenticated with PFP-APIGEE app And I request my prescriptions Then I can see my prescription diff --git a/features/psu/send_status_update.feature b/features/psu/send_status_update.feature index efe8bf8f..26bc69e5 100644 --- a/features/psu/send_status_update.feature +++ b/features/psu/send_status_update.feature @@ -10,7 +10,7 @@ Feature: I can send an update to PSU @e2e Scenario: I can send and confirm an update to a prescription - Given a prescription has been created and released + Given a prescription has been created and released using apim apis When I am authorised to send prescription updates And I send an Collected update with a terminal status of completed Then The prescription item has a status of Collected with a terminal status of completed diff --git a/features/steps/eps_api_steps.py b/features/steps/eps_api_steps.py index b061ea4b..6bce8033 100644 --- a/features/steps/eps_api_steps.py +++ b/features/steps/eps_api_steps.py @@ -37,36 +37,45 @@ def i_prepare_and_sign_a_type_prescription(context, prescription_type): i_sign_a_new_prescription(context=context) -@given("a prescription has been created and released") -def a_prescription_has_been_created_and_released(context): +@given("a prescription has been created and released using {deployment_method} apis") +def a_prescription_has_been_created_and_released(context, deployment_method): if "sandbox" in context.config.userdata["env"].lower(): return - i_am_an_authorised_user(context, "prescriber") + if deployment_method == "apim": + prescribe_product = "EPS-FHIR" + dispense_product = "EPS-FHIR" + elif deployment_method == "proxygen": + prescribe_product = "EPS-FHIR-PRESCRIBING" + dispense_product = "EPS-FHIR-DISPENSING" + else: + raise ValueError(f"Unknown deployment_method {deployment_method}") + i_am_an_authorised_user(context, "prescriber", prescribe_product) i_prepare_and_sign_a_prescription(context) - i_am_an_authorised_user(context, "dispenser") + i_am_an_authorised_user(context, "dispenser", dispense_product) i_release_the_prescription(context) indicate_successful_response(context) -@given("a new prescription has been dispensed") -def a_new_prescription_has_been_dispensed(context): +@given("a new prescription has been dispensed using {deployment_method} apis") +def a_new_prescription_has_been_dispensed(context, deployment_method): if "sandbox" in context.config.userdata["env"].lower(): return - a_prescription_has_been_created_and_released(context) + a_prescription_has_been_created_and_released(context, deployment_method) i_dispense_the_prescription(context) indicate_successful_response(context) -@given("I am an authorised {user}") -@when("I am an authorised {user}") -def i_am_an_authorised_user(context, user): +@given("I am an authorised {user} with {app} app") +@when("I am an authorised {user} with {app} app") +def i_am_an_authorised_user(context, user, app): if "sandbox" in context.config.userdata["env"].lower(): return env = context.config.userdata["env"] context.user = user - context.auth_token = get_auth(env, "EPS-FHIR", user) + context.auth_token = get_auth(env, app, user) +@given("I successfully prepare a {prescription_type} prescription") def i_prepare_a_new_prescription(context, prescription_type): context.nhs_number = generate_single() if prescription_type == "non-nominated": @@ -229,3 +238,8 @@ def validator_response_matches_file(context, filename): diff_result = ycm.get_diff() # and there should be none assert_that(diff_result).is_equal_to({"just4vis:pairs": []}) + + +@then("the signing algorithm is {algorithm}") +def the_signing_algoritm_is(context, algorithm): + assert_that(algorithm).is_equal_to(context.algorithm) diff --git a/features/steps/pfp_api_steps.py b/features/steps/pfp_api_steps.py index 822a9602..a4dd4b28 100644 --- a/features/steps/pfp_api_steps.py +++ b/features/steps/pfp_api_steps.py @@ -7,12 +7,12 @@ from methods.shared.common import assert_that, get_auth -@when("I am authenticated") -def i_am_authenticated(context): +@when("I am authenticated with {app} app") +def i_am_authenticated(context, app): env = context.config.userdata["env"].lower() if "sandbox" in env: return - context.auth_token = get_auth(env, "PFP-APIGEE") + context.auth_token = get_auth(env, app) @when("I request my prescriptions") diff --git a/features/steps/psu_api_steps.py b/features/steps/psu_api_steps.py index a3f49bd7..6e5224de 100644 --- a/features/steps/psu_api_steps.py +++ b/features/steps/psu_api_steps.py @@ -40,7 +40,7 @@ def i_send_an_update(context, status, terminal): def prescription_has_status_with_terminal_status(context): if "sandbox" in context.config.userdata["env"].lower(): return - pfp_api_steps.i_am_authenticated(context) + pfp_api_steps.i_am_authenticated(context, "PFP-APIGEE") pfp_api_steps.i_request_my_prescriptions(context) json_response = json.loads(context.response.content) logging.debug(context.response.content) diff --git a/methods/shared/common.py b/methods/shared/common.py index b17d9461..0689a517 100644 --- a/methods/shared/common.py +++ b/methods/shared/common.py @@ -12,20 +12,20 @@ from features.environment import ( CIS2_USERS, LOGIN_USERS, - CLIENT_ID, - CLIENT_SECRET, + APIGEE_APPS, JWT_PRIVATE_KEY, JWT_KID, ) def get_psu_authenticator(env, url): - if CLIENT_ID is None or JWT_KID is None or JWT_PRIVATE_KEY is None: + client_id = APIGEE_APPS["PSU"]["client_id"] + if client_id is None or JWT_KID is None or JWT_PRIVATE_KEY is None: raise ValueError("You must provide CLIENT_ID, JWT_KID and JWT_PRIVATE_KEY") config = ClientCredentialsConfig( environment=env, identity_service_base_url=url, # pyright: ignore [reportArgumentType] - client_id=CLIENT_ID, + client_id=client_id, jwt_private_key=JWT_PRIVATE_KEY, jwt_kid=JWT_KID, ) @@ -37,17 +37,19 @@ def get_psu_authenticator(env, url): return authenticator -def get_eps_fhir_authenticator(user, env, url): +def get_eps_fhir_authenticator(user, env, url, product): scope = "nhs-cis2" login_form = {"username": CIS2_USERS[user]["user_id"]} - if CLIENT_ID is None or CLIENT_SECRET is None: + client_id = APIGEE_APPS[product]["client_id"] + client_secret = APIGEE_APPS[product]["client_secret"] + if client_id is None or client_secret is None: raise ValueError("You must provide BOTH CLIENT_ID and CLIENT_SECRET") config = AuthorizationCodeConfig( environment=env, identity_service_base_url=url, # pyright: ignore [reportArgumentType] callback_url="https://example.org/", # pyright: ignore [reportArgumentType] - client_id=CLIENT_ID, - client_secret=CLIENT_SECRET, + client_id=client_id, + client_secret=client_secret, scope=scope, login_form=login_form, ) @@ -60,14 +62,16 @@ def get_eps_fhir_authenticator(user, env, url): def get_pfp_apigee_authenticator(env, url): scope = "nhs-login" login_form = {"username": LOGIN_USERS["user_id"]} - if CLIENT_ID is None or CLIENT_SECRET is None: + client_id = APIGEE_APPS["PFP-APIGEE"]["client_id"] + client_secret = APIGEE_APPS["PGP-APIGEE"]["client_secret"] + if client_id is None or client_secret is None: raise ValueError("You must provide BOTH CLIENT_ID and CLIENT_SECRET") config = AuthorizationCodeConfig( environment=env, identity_service_base_url=url, # pyright: ignore [reportArgumentType] callback_url="https://example.org/", # pyright: ignore [reportArgumentType] - client_id=CLIENT_ID, - client_secret=CLIENT_SECRET, + client_id=client_id, + client_secret=client_secret, scope=scope, login_form=login_form, ) @@ -79,12 +83,26 @@ def get_pfp_apigee_authenticator(env, url): def get_auth(env, product, user="prescriber"): authenticator = None - if product != "EPS-FHIR" and product != "PFP-APIGEE" and product != "PSU": + if product not in [ + "EPS-FHIR", + "EPS-FHIR-SHA1", + "EPS-FHIR-PRESCRIBING", + "EPS-FHIR-PRESCRIBING-SHA1", + "EPS-FHIR-DISPENSING", + "PFP-APIGEE", + "PSU", + ]: raise ValueError(f"Unknown product {product}") env = env.lower() url = f"https://{env}.api.service.nhs.uk/oauth2-mock" - if product in ["EPS-FHIR", "EPS-FHIR-DISPENSING", "EPS-FHIR-PRESCRIBING"]: - authenticator = get_eps_fhir_authenticator(user, env, url) + if product in [ + "EPS-FHIR", + "EPS-FHIR-DISPENSING", + "EPS-FHIR-PRESCRIBING", + "EPS-FHIR-SHA1", + "EPS-FHIR-PRESCRIBING-SHA1", + ]: + authenticator = get_eps_fhir_authenticator(user, env, url, product) if product == "PFP-APIGEE": authenticator = get_pfp_apigee_authenticator(env, url) if product == "PSU": diff --git a/scripts/set_secrets.sh b/scripts/set_secrets.sh index 9ede1e6d..2af314ea 100755 --- a/scripts/set_secrets.sh +++ b/scripts/set_secrets.sh @@ -48,18 +48,100 @@ set_repository_secret() { } check_gh_logged_in -set_environment_secret CLIENT_ID "${REF_CLIENT_ID}" REF -set_environment_secret CLIENT_ID "${INTERNAL_DEV_SANDBOX_CLIENT_ID}" INTERNAL-DEV-SANDBOX -set_environment_secret CLIENT_ID "${INTERNAL_DEV_CLIENT_ID}" INTERNAL-DEV -set_environment_secret CLIENT_ID "${INT_CLIENT_ID}" INT -set_environment_secret CLIENT_ID "${INTERNAL_QA_CLIENT_ID}" INTERNAL-QA - -set_environment_secret CLIENT_SECRET "${REF_CLIENT_SECRET}" REF -set_environment_secret CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX -set_environment_secret CLIENT_SECRET "${INTERNAL_DEV_CLIENT_SECRET}" INTERNAL-DEV -set_environment_secret CLIENT_SECRET "${INT_CLIENT_SECRET}" INT -set_environment_secret CLIENT_SECRET "${INTERNAL_QA_CLIENT_SECRET}" INTERNAL-QA +# EPS_FHIR credentials +set_environment_secret EPS_FHIR_CLIENT_ID "${REF_EPS_FHIR_CLIENT_ID}" REF +set_environment_secret EPS_FHIR_CLIENT_ID "${INTERNAL_DEV_SANDBOX_EPS_FHIR_CLIENT_ID}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_CLIENT_ID "${INTERNAL_DEV_EPS_FHIR_CLIENT_ID}" INTERNAL-DEV +set_environment_secret EPS_FHIR_CLIENT_ID "${INT_EPS_FHIR_CLIENT_ID}" INT +set_environment_secret EPS_FHIR_CLIENT_ID "${INTERNAL_QA_EPS_FHIR_CLIENT_ID}" INTERNAL-QA +set_environment_secret EPS_FHIR_CLIENT_SECRET "${REF_EPS_FHIR_CLIENT_SECRET}" REF +set_environment_secret EPS_FHIR_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_EPS_FHIR_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_CLIENT_SECRET "${INTERNAL_DEV_EPS_FHIR_CLIENT_SECRET}" INTERNAL-DEV +set_environment_secret EPS_FHIR_CLIENT_SECRET "${INT_EPS_FHIR_CLIENT_SECRET}" INT +set_environment_secret EPS_FHIR_CLIENT_SECRET "${INTERNAL_QA_EPS_FHIR_CLIENT_SECRET}" INTERNAL-QA + +# EPS_FHIR_SHA1 credentials +set_environment_secret EPS_FHIR_SHA1_CLIENT_ID "${REF_EPS_FHIR_SHA1_CLIENT_ID}" REF +set_environment_secret EPS_FHIR_SHA1_CLIENT_ID "${INTERNAL_DEV_SANDBOX_EPS_FHIR_SHA1_CLIENT_ID}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_SHA1_CLIENT_ID "${INTERNAL_DEV_EPS_FHIR_SHA1_CLIENT_ID}" INTERNAL-DEV +set_environment_secret EPS_FHIR_SHA1_CLIENT_ID "${INT_EPS_FHIR_SHA1_CLIENT_ID}" INT +set_environment_secret EPS_FHIR_SHA1_CLIENT_ID "${INTERNAL_QA_EPS_FHIR_SHA1_CLIENT_ID}" INTERNAL-QA + +set_environment_secret EPS_FHIR_SHA1_CLIENT_SECRET "${REF_EPS_FHIR_SHA1_CLIENT_SECRET}" REF +set_environment_secret EPS_FHIR_SHA1_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_EPS_FHIR_SHA1_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_SHA1_CLIENT_SECRET "${INTERNAL_DEV_EPS_FHIR_SHA1_CLIENT_SECRET}" INTERNAL-DEV +set_environment_secret EPS_FHIR_SHA1_CLIENT_SECRET "${INT_EPS_FHIR_SHA1_CLIENT_SECRET}" INT +set_environment_secret EPS_FHIR_SHA1_CLIENT_SECRET "${INTERNAL_QA_EPS_FHIR_SHA1_CLIENT_SECRET}" INTERNAL-QA + + +# EPS_FHIR_PRESCRIBING credentials +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_ID "${REF_EPS_FHIR_PRESCRIBING_CLIENT_ID}" REF +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_ID "${INTERNAL_DEV_SANDBOX_EPS_FHIR_PRESCRIBING_CLIENT_ID}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_ID "${INTERNAL_DEV_EPS_FHIR_PRESCRIBING_CLIENT_ID}" INTERNAL-DEV +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_ID "${INT_EPS_FHIR_PRESCRIBING_CLIENT_ID}" INT +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_ID "${INTERNAL_QA_EPS_FHIR_PRESCRIBING_CLIENT_ID}" INTERNAL-QA + +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_SECRET "${REF_EPS_FHIR_PRESCRIBING_CLIENT_SECRET}" REF +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_EPS_FHIR_PRESCRIBING_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_SECRET "${INTERNAL_DEV_EPS_FHIR_PRESCRIBING_CLIENT_SECRET}" INTERNAL-DEV +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_SECRET "${INT_EPS_FHIR_PRESCRIBING_CLIENT_SECRET}" INT +set_environment_secret EPS_FHIR_PRESCRIBING_CLIENT_SECRET "${INTERNAL_QA_EPS_FHIR_PRESCRIBING_CLIENT_SECRET}" INTERNAL-QA + + +# EPS_FHIR_SHA1_PRESCRIBING credentials +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID "${REF_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID}" REF +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID "${INTERNAL_DEV_SANDBOX_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID "${INTERNAL_DEV_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID}" INTERNAL-DEV +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID "${INT_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID}" INT +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID "${INTERNAL_QA_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_ID}" INTERNAL-QA + +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET "${REF_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET}" REF +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET "${INTERNAL_DEV_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET}" INTERNAL-DEV +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET "${INT_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET}" INT +set_environment_secret EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET "${INTERNAL_QA_EPS_FHIR_PRESCRIBING_SHA1_CLIENT_SECRET}" INTERNAL-QA + +# EPS_FHIR_DISPENSING credentials +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_ID "${REF_EPS_FHIR_DISPENSING_CLIENT_ID}" REF +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_ID "${INTERNAL_DEV_SANDBOX_EPS_FHIR_DISPENSING_CLIENT_ID}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_ID "${INTERNAL_DEV_EPS_FHIR_DISPENSING_CLIENT_ID}" INTERNAL-DEV +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_ID "${INT_EPS_FHIR_DISPENSING_CLIENT_ID}" INT +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_ID "${INTERNAL_QA_EPS_FHIR_DISPENSING_CLIENT_ID}" INTERNAL-QA + +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_SECRET "${REF_EPS_FHIR_DISPENSING_CLIENT_SECRET}" REF +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_EPS_FHIR_DISPENSING_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_SECRET "${INTERNAL_DEV_EPS_FHIR_DISPENSING_CLIENT_SECRET}" INTERNAL-DEV +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_SECRET "${INT_EPS_FHIR_DISPENSING_CLIENT_SECRET}" INT +set_environment_secret EPS_FHIR_DISPENSING_CLIENT_SECRET "${INTERNAL_QA_EPS_FHIR_DISPENSING_CLIENT_SECRET}" INTERNAL-QA + +# PFP credentials +set_environment_secret PFP_CLIENT_ID "${REF_PFP_CLIENT_ID}" REF +set_environment_secret PFP_CLIENT_ID "${INTERNAL_DEV_SANDBOX_PFP_CLIENT_ID}" INTERNAL-DEV-SANDBOX +set_environment_secret PFP_CLIENT_ID "${INTERNAL_DEV_PFP_CLIENT_ID}" INTERNAL-DEV +set_environment_secret PFP_CLIENT_ID "${INT_PFP_CLIENT_ID}" INT +set_environment_secret PFP_CLIENT_ID "${INTERNAL_QA_PFP_CLIENT_ID}" INTERNAL-QA + +set_environment_secret PFP_CLIENT_SECRET "${REF_PFP_CLIENT_SECRET}" REF +set_environment_secret PFP_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_PFP_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX +set_environment_secret PFP_CLIENT_SECRET "${INTERNAL_DEV_PFP_CLIENT_SECRET}" INTERNAL-DEV +set_environment_secret PFP_CLIENT_SECRET "${INT_PFP_CLIENT_SECRET}" INT +set_environment_secret PFP_CLIENT_SECRET "${INTERNAL_QA_PFP_CLIENT_SECRET}" INTERNAL-QA + +# PSU credentials +set_environment_secret PSU_CLIENT_ID "${REF_PSU_CLIENT_ID}" REF +set_environment_secret PSU_CLIENT_ID "${INTERNAL_DEV_SANDBOX_PSU_CLIENT_ID}" INTERNAL-DEV-SANDBOX +set_environment_secret PSU_CLIENT_ID "${INTERNAL_DEV_PSU_CLIENT_ID}" INTERNAL-DEV +set_environment_secret PSU_CLIENT_ID "${INT_PSU_CLIENT_ID}" INT +set_environment_secret PSU_CLIENT_ID "${INTERNAL_QA_PSU_CLIENT_ID}" INTERNAL-QA + +set_environment_secret PSU_CLIENT_SECRET "${REF_PSU_CLIENT_SECRET}" REF +set_environment_secret PSU_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_PSU_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX +set_environment_secret PSU_CLIENT_SECRET "${INTERNAL_DEV_PSU_CLIENT_SECRET}" INTERNAL-DEV +set_environment_secret PSU_CLIENT_SECRET "${INT_PSU_CLIENT_SECRET}" INT +set_environment_secret PSU_CLIENT_SECRET "${INTERNAL_QA_PSU_CLIENT_SECRET}" INTERNAL-QA + +# jwt set_environment_secret JWT_KID "${REF_JWT_KID}" REF set_environment_secret JWT_KID "${INTERNAL_DEV_SANDBOX_JWT_KID}" INTERNAL-DEV-SANDBOX set_environment_secret JWT_KID "${INTERNAL_DEV_JWT_KID}" INTERNAL-DEV @@ -72,21 +154,15 @@ set_environment_secret JWT_PRIVATE_KEY "${INTERNAL_DEV_JWT_PRIVATE_KEY}" INTERNA set_environment_secret JWT_PRIVATE_KEY "${INT_JWT_PRIVATE_KEY}" INT set_environment_secret JWT_PRIVATE_KEY "${INTERNAL_QA_JWT_PRIVATE_KEY}" INTERNAL-QA -set_environment_secret SHA1_CLIENT_ID "${REF_SHA1_CLIENT_ID}" REF -set_environment_secret SHA1_CLIENT_ID "${INTERNAL_DEV_SANDBOX_SHA1_CLIENT_ID}" INTERNAL-DEV-SANDBOX -set_environment_secret SHA1_CLIENT_ID "${INTERNAL_DEV_SHA1_CLIENT_ID}" INTERNAL-DEV -set_environment_secret SHA1_CLIENT_ID "${INT_SHA1_CLIENT_ID}" INT -set_environment_secret SHA1_CLIENT_ID "${INTERNAL_QA_SHA1_CLIENT_ID}" INTERNAL-QA - -set_environment_secret SHA1_CLIENT_SECRET "${REF_SHA1_CLIENT_SECRET}" REF -set_environment_secret SHA1_CLIENT_SECRET "${INTERNAL_DEV_SANDBOX_SHA1_CLIENT_SECRET}" INTERNAL-DEV-SANDBOX -set_environment_secret SHA1_CLIENT_SECRET "${INTERNAL_DEV_SHA1_CLIENT_SECRET}" INTERNAL-DEV -set_environment_secret SHA1_CLIENT_SECRET "${INT_SHA1_CLIENT_SECRET}" INT -set_environment_secret SHA1_CLIENT_SECRET "${INTERNAL_QA_SHA1_CLIENT_SECRET}" INTERNAL-QA - +# automerge apps set_repository_secret AUTOMERGE_APP_ID "${AUTOMERGE_APP_ID}" set_repository_secret AUTOMERGE_PEM "${AUTOMERGE_PEM}" + +# signing certificate set_repository_secret CERTIFICATE "${CERTIFICATE}" set_repository_secret PRIVATE_KEY "${PRIVATE_KEY}" + set_repository_secret REGRESSION_TESTS_PEM "${REGRESSION_TESTS_PEM}" + +# sonar token set_repository_secret SONAR_TOKEN "${SONAR_TOKEN}"