Skip to content

Commit

Permalink
Remove CMA client configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
karlbaker02 committed Oct 25, 2024
1 parent e28c412 commit efe1b92
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,12 @@
@ConfigurationProperties(prefix = "services")
public class ServicesConfiguration {

@NotNull
private CmaApi cmaApi;

@NotNull
private MaatApi maatApi;

@NotNull
private boolean oAuthEnabled;

@Data
@AllArgsConstructor
@NoArgsConstructor
public static class CmaApi {
@NotNull
private String baseUrl;

@NotNull
private Endpoints endpoints;

@Data
@NoArgsConstructor
@AllArgsConstructor
public static class Endpoints {
@NotNull
private String findUrl;

@NotNull
private String updateUrl;
}
}

@Data
@AllArgsConstructor
@NoArgsConstructor
Expand Down
11 changes: 0 additions & 11 deletions crime-evidence/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,9 @@ spring:
oauth2:
client:
provider:
cma:
token-uri: ${CMA_API_OAUTH_URL}
maat-api:
token-uri: ${MAAT_API_OAUTH_URL}
registration:
cma:
client-id: ${CMA_API_OAUTH_CLIENT_ID}
client-secret: ${CMA_API_OAUTH_CLIENT_SECRET}
authorization-grant-type: client_credentials
maat-api:
client-id: ${MAAT_API_OAUTH_CLIENT_ID}
client-secret: ${MAAT_API_OAUTH_CLIENT_SECRET}
Expand All @@ -79,11 +73,6 @@ retry-config:
jitter-value: 0.75

services:
cma-api:
base-url: ${CMA_API_BASE_URL}
endpoints:
find-url: ${services.cma-api.base-url}/api/internal/v1/assessment/means/{financialAssessmentId}
update-url: ${services.cma-api.base-url}/api/internal/v1/assessment/means
maat-api:
base-url: ${MAAT_API_BASE_URL}
assessments-domain: ${services.maat-api.base-url}/api/internal/v1/assessment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,17 @@ public static ServicesConfiguration getConfiguration(int port) {

ServicesConfiguration servicesConfiguration = new ServicesConfiguration();
ServicesConfiguration.MaatApi maatApiConfiguration = new ServicesConfiguration.MaatApi();
ServicesConfiguration.CmaApi cmaApiConfiguration = new ServicesConfiguration.CmaApi();

ServicesConfiguration.MaatApi.RepOrderEndpoints repOrderEndpoints =
new ServicesConfiguration.MaatApi.RepOrderEndpoints(
"/rep-orders/capital/reporder/{repId}"
);

ServicesConfiguration.CmaApi.Endpoints cmaEndpoints =
new ServicesConfiguration.CmaApi.Endpoints(
"/assessment/means/{financialAssessmentId}",
"/assessment/means");

maatApiConfiguration.setBaseUrl(host);
maatApiConfiguration.setRepOrderEndpoints(repOrderEndpoints);

cmaApiConfiguration.setBaseUrl(host);
cmaApiConfiguration.setEndpoints(cmaEndpoints);

servicesConfiguration.setOAuthEnabled(false);
servicesConfiguration.setMaatApi(maatApiConfiguration);
servicesConfiguration.setCmaApi(cmaApiConfiguration);

return servicesConfiguration;
}
Expand Down
11 changes: 0 additions & 11 deletions crime-evidence/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@ spring:
oauth2:
client:
provider:
cma:
token-uri: http://localhost:${wiremock.server.port}/oauth2/token
maat-api:
token-uri: http://localhost:9999/oauth2/token
registration:
cma:
client-id: dummy-client
client-secret: dummy-client
authorization-grant-type: client_credentials
maat-api:
client-id: dummy-client
client-secret: dummy-secret
Expand All @@ -51,11 +45,6 @@ springdoc:
operationsSorter: method

services:
cma-api:
base-url: http://localhost:${wiremock.server.port}
endpoints:
find-url: ${services.cma-api.base-url}/api/internal/v1/assessment/means/{financialAssessmentId}
update-url: ${services.cma-api.base-url}/api/internal/v1/assessment/means
maat-api:
oAuthEnabled: true
baseUrl: http://localhost:9999
Expand Down
14 changes: 0 additions & 14 deletions helm_deploy/laa-crime-evidence/templates/_environment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@ env:
value: {{ .Values.sentry.sampleRate | quote }}
- name: LOG_LEVEL
value: {{ .Values.logging.level }}
- name: CMA_API_BASE_URL
value: {{ .Values.cmaApi.baseUrl }}
- name: CMA_API_OAUTH_URL
value: {{ .Values.cmaApi.oauthUrl }}
- name: CMA_API_OAUTH_CLIENT_ID
valueFrom:
secretKeyRef:
name: cma-api-oauth-client-id
key: CMA_API_OAUTH_CLIENT_ID
- name: CMA_API_OAUTH_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: cma-api-oauth-client-secret
key: CMA_API_OAUTH_CLIENT_SECRET
- name: MAAT_API_BASE_URL
value: {{ .Values.maatApi.baseUrl }}
- name: MAAT_API_OAUTH_URL
Expand Down
Binary file modified helm_deploy/laa-crime-evidence/values-dev.yaml
Binary file not shown.
Binary file modified helm_deploy/laa-crime-evidence/values-prod.yaml
Binary file not shown.
Binary file modified helm_deploy/laa-crime-evidence/values-test.yaml
Binary file not shown.
Binary file modified helm_deploy/laa-crime-evidence/values-uat.yaml
Binary file not shown.

0 comments on commit efe1b92

Please sign in to comment.