Skip to content

Commit

Permalink
CCD-5327 - Updated DEFINITION_STORE_S2S_AUTHORISED_SERVICES variable …
Browse files Browse the repository at this point in the history
…to include … (#1513)

* Updated DEFINITION_STORE_S2S_AUTHORISED_SERVICES variable to include xui_webapp.
Also added a test for EventEnablingCondition to test combination of AND|OR

* Bumping chart version/ fixing aliases

* check style error

---------

Co-authored-by: hmcts-jenkins-a-to-c <62422075+hmcts-jenkins-a-to-c[bot]@users.noreply.github.com>
Co-authored-by: bharatkumarpatel1 <Bharatkumar.Patel1@HMCTS.NET>
Co-authored-by: dinesh1patel <74076102+dinesh1patel@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 11, 2024
1 parent c1eb882 commit 3d55c05
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ simply ignored

The following environment variables are required:

| Name | Default | Description |
|------|---------|-------------|
| DEFINITION_STORE_DB_USERNAME | - | Username for database |
| DEFINITION_STORE_DB_PASSWORD | - | Password for database |
| DEFINITION_STORE_DB_USE_SSL | - | set to `true` if SSL is to be enabled. `false` recommended for local environments. |
| DEFINITION_STORE_IDAM_KEY | - | Definition store's IDAM S2S micro-service secret key. This must match the IDAM instance it's being run against. |
| DEFINITION_STORE_S2S_AUTHORISED_SERVICES | ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment | Authorised micro-service names for S2S calls |
| IDAM_USER_URL | - | Base URL for IdAM's User API service (idam-app). `http://localhost:4501` for the dockerised local instance or tunneled `dev` instance. |
| IDAM_S2S_URL | - | Base URL for IdAM's S2S API service (service-auth-provider). `http://localhost:4502` for the dockerised local instance or tunneled `dev` instance. |
| USER_PROFILE_HOST | - | Base URL for the User Profile service. `http://localhost:4453` for the dockerised local instance. |
| AZURE_APPLICATIONINSIGHTS_INSTRUMENTATIONKEY | - | secrets for Microsoft Insights logging, can be a dummy string in local |
| Name | Default | Description |
|------|-----------------------------------------------------------------------------|-------------|
| DEFINITION_STORE_DB_USERNAME | - | Username for database |
| DEFINITION_STORE_DB_PASSWORD | - | Password for database |
| DEFINITION_STORE_DB_USE_SSL | - | set to `true` if SSL is to be enabled. `false` recommended for local environments. |
| DEFINITION_STORE_IDAM_KEY | - | Definition store's IDAM S2S micro-service secret key. This must match the IDAM instance it's being run against. |
| DEFINITION_STORE_S2S_AUTHORISED_SERVICES | ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment,xui_webapp | Authorised micro-service names for S2S calls |
| IDAM_USER_URL | - | Base URL for IdAM's User API service (idam-app). `http://localhost:4501` for the dockerised local instance or tunneled `dev` instance. |
| IDAM_S2S_URL | - | Base URL for IdAM's S2S API service (service-auth-provider). `http://localhost:4502` for the dockerised local instance or tunneled `dev` instance. |
| USER_PROFILE_HOST | - | Base URL for the User Profile service. `http://localhost:4453` for the dockerised local instance. |
| AZURE_APPLICATIONINSIGHTS_INSTRUMENTATIONKEY | - | secrets for Microsoft Insights logging, can be a dummy string in local |

### Building

Expand Down
2 changes: 1 addition & 1 deletion application/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ oidc.issuer = ${OIDC_ISSUER:http://fr-am:8080/openam/oauth2/hmcts}
idam.s2s-auth.url=${IDAM_S2S_URL:http://localhost:4502}
idam.s2s-auth.microservice=ccd_definition
idam.s2s-auth.totp_secret=${DEFINITION_STORE_IDAM_KEY:AAAAAAAAAAAAAAAA}
idam.s2s-authorised.services=${DEFINITION_STORE_S2S_AUTHORISED_SERVICES:ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment}
idam.s2s-authorised.services=${DEFINITION_STORE_S2S_AUTHORISED_SERVICES:ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment,xui_webapp}

ccd.user-profile.host=${USER_PROFILE_HOST:http://localhost:4453}

Expand Down
2 changes: 1 addition & 1 deletion charts/ccd-definition-store-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description: Helm chart for the HMCTS CCD Definition Store
name: ccd-definition-store-api
apiVersion: v2
home: https://github.com/hmcts/ccd-definition-store-api
version: 1.6.18
version: 1.6.19
maintainers:
- name: HMCTS CCD Dev Team
email: ccd-devops@HMCTS.NET
Expand Down
2 changes: 1 addition & 1 deletion charts/ccd-definition-store-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ java:
DEFINITION_STORE_DB_MAX_POOL_SIZE: 25


DEFINITION_STORE_S2S_AUTHORISED_SERVICES: ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment
DEFINITION_STORE_S2S_AUTHORISED_SERVICES: ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment,xui_webapp

# Storage Account
AZURE_STORAGE_BLOB_CONTAINER_REFERENCE: ccd-definition-store-api-imports-{{ .Values.global.environment }}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
- DEFINITION_STORE_DB_USERNAME=definition_store
- DEFINITION_STORE_DB_PASSWORD=definition_store
- DEFINITION_STORE_IDAM_KEY
- DEFINITION_STORE_S2S_AUTHORISED_SERVICES=ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment
- DEFINITION_STORE_S2S_AUTHORISED_SERVICES=ccd_data,ccd_gw,ccd_admin,jui_webapp,pui_webapp,aac_manage_case_assignment,xui_webapp
- USER_PROFILE_HOST
- IDAM_USER_URL
- IDAM_S2S_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ public void shouldParseEventWithoutRestrictionDataItem() {
assertThat(entity.getPreStates(), empty());

assertLogged(listAppender,
"Parsing event case fields for case type Some Case Type and event event id: No event case fields found");
"Parsing event case fields for case type Some Case Type and event event id: No event case fields"
+ " found");
}

@Test
Expand Down Expand Up @@ -262,6 +263,18 @@ public void shouldParseEventWithEventEnablingCondition() {
assertEvent(entity);
}

@Test
public void shouldParseEventWithChainedEventEnablingCondition() {
final String validEventEnablingCondition = "(FieldA!=\"\" AND FieldB=\"I'm innocent\") "
+ "OR (FieldC=\"I'm guilty\")";
item.addAttribute(ColumnName.EVENT_ENABLING_CONDITION.toString(), validEventEnablingCondition);
definitionSheet.addDataItem(item);
final Collection<EventEntity> eventEntities = eventParser.parseAll(definitionSheets, caseType);
assertThat(eventEntities.size(), is(1));
entity = new ArrayList<>(eventEntities).get(0);
assertEvent(entity);
}

@Test
public void shouldFailParseEventWithEmptyEventEnablingCondition() {
final String validEventEnablingCondition = " ";
Expand Down

0 comments on commit 3d55c05

Please sign in to comment.