Skip to content

Commit bbc9eb0

Browse files
committed
DMP-5252-ARM-5-2-Upgrade
Started to move the ARM clients into a service so the current version and new version can be enabled accordingly
1 parent d821b5a commit bbc9eb0

File tree

44 files changed

+150
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+150
-76
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ export AZURE_AD_FUNCTIONAL_TEST_USERNAME=
143143
export AZURE_AD_FUNCTIONAL_TEST_PASSWORD=
144144
export ARM_SAS_ENDPOINT=
145145
export ARM_URL=
146+
export ARM_AUTH_URL=
147+
export ARM_API_URL=
146148
export ARM_USERNAME=
147149
export ARM_PASSWORD=
148150
export DARTS_INBOUND_STORAGE_SAS_URL=
@@ -328,12 +330,12 @@ There is no need to remove postgres and java or similar core images.
328330
The following Spring Profiles are defined. "External Components" are defined as any service upon which the application
329331
is dependent, such as database servers, web services etc.
330332
331-
| Profile | Config Location | Purpose | External Components |
332-
|------------------|----------------------------------------------------------------|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
333-
| `local` | `src/main/resources/application-local.yaml` | For running the application locally as a docker compose stack with `docker-compose-local.yml`. | Provided as needed by `docker-compose-local.yml`. No external connectivity permitted outside the network boundary of the stack. |
333+
| Profile | Config Location | Purpose | External Components |
334+
|------------------|----------------------------------------------------------------|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
335+
| `local` | `src/main/resources/application-local.yaml` | For running the application locally as a docker compose stack with `docker-compose-local.yml`. | Provided as needed by `docker-compose-local.yml`. No external connectivity permitted outside the network boundary of the stack. |
334336
| `intTest` | `src/integrationTest/resources/application-intTest.yaml` | For running integration tests under `src/integrationTest`. | No interaction required or permitted, all external calls are mocked via embedded wiremock (for HTTP requests), an embedded database (for db queries) or `@MockitoBean` for anything else. Spring Security is explicitly disabled. |
335-
| `functionalTest` | `src/functionalTest/resources/application-functionalTest.yaml` | For running functional tests under `src/functionalTest`. | Functional tests execute API calls against the application deployed in the PR environment. That application is deployed with the `dev` profile (see below). |
336-
| `dev` | `src/main/resources/application-dev.yaml` | For running the application in the Pull Request (dev) environment. | Interaction permitted with "real" components, which may be services deployed to a test environment. |
337+
| `functionalTest` | `src/functionalTest/resources/application-functionalTest.yaml` | For running functional tests under `src/functionalTest`. | Functional tests execute API calls against the application deployed in the PR environment. That application is deployed with the `dev` profile (see below). |
338+
| `dev` | `src/main/resources/application-dev.yaml` | For running the application in the Pull Request (dev) environment. | Interaction permitted with "real" components, which may be services deployed to a test environment. |
337339
338340
## Automated Tasks
339341

bin/secrets-stg-environment.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ echo "ARM_SAS_ENDPOINT=$(az keyvault secret show --vault-name darts-stg --name A
3333
echo "ARM_USERNAME=$(az keyvault secret show --vault-name darts-stg --name ArmUsername | jq .value -r)"
3434
echo "ARM_PASSWORD=$(az keyvault secret show --vault-name darts-stg --name ArmPassword | jq .value -r)"
3535
echo "ARM_URL=$(az keyvault secret show --vault-name darts-stg --name ArmUrl | jq .value -r)"
36+
echo "ARM_AUTH_URL=$(az keyvault secret show --vault-name darts-stg --name ArmAuthUrl | jq .value -r)"
37+
echo "ARM_API_URL=$(az keyvault secret show --vault-name darts-stg --name ArmApiUrl | jq .value -r)"
3638
echo "DETS_SAS_URL_ENDPOINT=$(az keyvault secret show --vault-name darts-stg --name DETSSasURLEndpoint | jq .value -r)"
3739
echo "AAD_TENANT_ID_JUSTICE=$(az keyvault secret show --vault-name darts-stg --name AzureADTenantIdJustice | jq .value -r)"
3840
echo "AAD_CLIENT_ID_JUSTICE=$(az keyvault secret show --vault-name darts-stg --name AzureADClientIdJustice | jq .value -r)"

charts/darts-api/values.dev.template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ function:
321321
ACTIVE_DIRECTORY_B2C_BASE_URI: https://hmctsstgextid.b2clogin.com
322322
ACTIVE_DIRECTORY_B2C_AUTH_URI: https://hmctsstgextid.b2clogin.com/hmctsstgextid.onmicrosoft.com
323323
ARM_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
324+
ARM_AUTH_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
325+
ARM_API_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
324326
FEIGN_LOG_LEVEL: none
325327
IS_MOCK_ARM_RPO_DOWNLOAD_CSV: false
326328
ARM_RPO_THREAD_SLEEP_DURATION: 60s

charts/darts-api/values.stg.template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ java:
1212
TESTING_SUPPORT_ENDPOINTS_ENABLED: true
1313
DARTS_GATEWAY_URL: http://darts-gateway.staging.platform.hmcts.net
1414
ARM_URL: http://darts-stub-services.staging.platform.hmcts.net
15+
ARM_AUTH_URL: http://darts-stub-services.staging.platform.hmcts.net
16+
ARM_API_URL: http://darts-stub-services.staging.platform.hmcts.net
1517
FEIGN_LOG_LEVEL: none
1618
IS_MOCK_ARM_RPO_DOWNLOAD_CSV: false
1719
AZCOPY_LOG_LEVEL: "--log-level=ERROR"

charts/darts-api/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ java:
115115
ACTIVE_DIRECTORY_B2C_BASE_URI: https://hmctsstgextid.b2clogin.com
116116
ACTIVE_DIRECTORY_B2C_AUTH_URI: https://hmctsstgextid.b2clogin.com/hmctsstgextid.onmicrosoft.com
117117
ARM_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
118+
ARM_AUTH_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
119+
ARM_API_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
118120
FEIGN_LOG_LEVEL: none
119121
ARM_RPO_THREAD_SLEEP_DURATION: 60s
120122
ARM_RPO_POLL_DURATION: 4h
@@ -234,6 +236,8 @@ function:
234236
ACTIVE_DIRECTORY_B2C_BASE_URI: https://hmctsstgextid.b2clogin.com
235237
ACTIVE_DIRECTORY_B2C_AUTH_URI: https://hmctsstgextid.b2clogin.com/hmctsstgextid.onmicrosoft.com
236238
ARM_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
239+
ARM_AUTH_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
240+
ARM_API_URL: http://darts-stub-services.{{ .Values.global.environment }}.platform.hmcts.net
237241
FEIGN_LOG_LEVEL: none
238242
IS_MOCK_ARM_RPO_DOWNLOAD_CSV: false
239243
ARM_RPO_THREAD_SLEEP_DURATION: 60s

docker-compose-local.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ services:
4949
- ARM_PASSWORD
5050
- ARM_SERVICE_PROFILE
5151
- ARM_URL=http://darts-stub-services:4551
52+
- ARM_AUTH_URL=http://darts-stub-services:4551
53+
- ARM_API_URL=http://darts-stub-services:4551
5254
- ACTIVE_DIRECTORY_B2C_BASE_URI=https://hmctsstgextid.b2clogin.com
5355
- ACTIVE_DIRECTORY_B2C_AUTH_URI=https://hmctsstgextid.b2clogin.com/hmctsstgextid.onmicrosoft.com
5456
- MAX_FILE_UPLOAD_SIZE_MEGABYTES=350
@@ -57,8 +59,6 @@ services:
5759
- DARTS_UNSTRUCTURED_STORAGE_SAS_URL
5860
- ARM_SERVICE_ENTITLEMENT
5961
- ARM_STORAGE_ACCOUNT_NAME
60-
- ARM_AUTH_URL
61-
- ARM_API_URL
6262
build:
6363
context: .
6464
dockerfile: Dockerfile

src/main/java/uk/gov/hmcts/darts/arm/client/version/fivetwo/ArmAuthClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
name = "arm-auth-client",
1212
url = "${darts.storage.arm-api.version5-2.authentication.auth-base-url}"
1313
)
14+
@FunctionalInterface
1415
public interface ArmAuthClient {
1516

1617
@PostMapping(value = "${darts.storage.arm-api.version5-2.authentication.token-path}",

src/main/java/uk/gov/hmcts/darts/arm/component/ArchiveRecordFileGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.List;
88

99
public interface ArchiveRecordFileGenerator {
10+
1011
boolean generateArchiveRecord(ArchiveRecord archiveRecord, File archiveRecordFile, ArchiveRecordType archiveRecordType);
1112

1213
String generateArchiveRecords(String archiveFileName, List<ArchiveRecord> archiveRecords);

src/main/java/uk/gov/hmcts/darts/arm/component/ArmRpoDownloadProduction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
public interface ArmRpoDownloadProduction {
55

66
feign.Response downloadProduction(String bearerToken, Integer executionId, String productionExportFileId);
7+
78
}

src/main/java/uk/gov/hmcts/darts/arm/component/impl/ArmRetentionEventDateCalculatorImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import uk.gov.hmcts.darts.arm.component.ArmRetentionEventDateCalculator;
1111
import uk.gov.hmcts.darts.arm.config.ArmDataManagementConfiguration;
1212
import uk.gov.hmcts.darts.arm.helper.ArmHelper;
13-
import uk.gov.hmcts.darts.authorisation.component.UserIdentity;
1413
import uk.gov.hmcts.darts.common.entity.ConfidenceAware;
1514
import uk.gov.hmcts.darts.common.entity.ExternalObjectDirectoryEntity;
1615
import uk.gov.hmcts.darts.common.enums.ObjectRecordStatusEnum;
@@ -29,7 +28,6 @@
2928
public class ArmRetentionEventDateCalculatorImpl implements ArmRetentionEventDateCalculator {
3029
private final ExternalObjectDirectoryRepository externalObjectDirectoryRepository;
3130
private final ArmDataManagementApi armDataManagementApi;
32-
private final UserIdentity userIdentity;
3331
private final ArmDataManagementConfiguration armDataManagementConfiguration;
3432
private final ArmHelper armHelper;
3533

0 commit comments

Comments
 (0)