From adbd67438322f3ef62f38d2bf49b3b880a04c735 Mon Sep 17 00:00:00 2001 From: Chiara Date: Wed, 5 Jun 2024 12:47:33 +0100 Subject: [PATCH 1/6] Changed name --- docs/diagrams/container.puml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/diagrams/container.puml b/docs/diagrams/container.puml index 26ca790ec..0fde73364 100644 --- a/docs/diagrams/container.puml +++ b/docs/diagrams/container.puml @@ -20,13 +20,14 @@ Boundary(aws_cloudplatform, "Cloud Platform", "A Kubernetes cluster using Amazon Boundary(upstream, "Legacy Upstream Systems", "Various HMPPS upstream systems, some of these will eventually be replaced"){ Container(prison_api, "Prison API", "Spring Boot Java API", "API over NOMIS DB used by Digital Prison team applications and services", $link="https://github.com/ministryofjustice/prison-api") - Container(probation_offender_search, "Probation Offender Search", "Springoot Kotlin API", "API over the nDelius offender data held in Elasticsearch", $link="https://probation-offender-search-dev.hmpps.service.justice.gov.uk/swagger-ui/index.html") + Container(probation_offender_search, "Probation Offender Search", "Springboot Kotlin API", "API over the nDelius offender data held in Elasticsearch", $link="https://probation-offender-search-dev.hmpps.service.justice.gov.uk/swagger-ui/index.html") Container(prisoner_search, "Prisoner Search", "Spring Boot Kotlin API", "API over the NOMIS prisoner data held in OpenSearch", $link="https://github.com/ministryofjustice/hmpps-prisoner-search") Container(oasys, "OASys", "Spring Boot Kotlin API", "REST access to the OASys Oracle DB offender assessment information", $link="https://github.com/ministryofjustice/offender-assessments-api-kotlin", $tags="not_yet_implemented") Container(oasys_arn, "Assess Risks and Needs", "Spring Boot Kotlin API", "API over the Risks, Needs and Responsivity (RNR) data for an offender held in the Assess Risks and Needs Service", $link="https://github.com/ministryofjustice/hmpps-assess-risks-and-needs") Container(adjudications, "Adjudications", "Spring Boot Kotlin API", "Adjudications related to an offender", $link="https://github.com/ministryofjustice/hmpps-manage-adjudications-api") Container(case_notes, "Case Notes", "Spring Boot Kotlin API", "Case Notes related to an offender", $link="https://github.com/ministryofjustice/offender-case-notes") Container(effective_proposal_framework, "EPF and nDelius", "Spring Boot Kotlin API") + Container(manage_POM_cases, "Offender Management Allocation Manager", "Ruby on Rails app", "A Ruby On Rails application for allocating Prisoners to Prisoner Offender Managers (POMs)", $link="https://github.com/ministryofjustice/offender-management-allocation-manager") Container(create_and_vary_license, "Create and Vary License", "Spring Boot Kotlin API", "Licenses related to an offender", $link="https://github.com/ministryofjustice/create-and-vary-a-licence-api") Container(hmpps_auth, "HMPPS Auth", "Spring Boot Kotlin API", "HMPPS Auth Server For HMPPS Digital Services", $link="https://github.com/ministryofjustice/hmpps-auth") Lay_L(prisoner_search, prison_api) From f353050e0d0f9c3c866ba20f8ed09fc904c9e604 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 5 Jun 2024 11:48:09 +0000 Subject: [PATCH 2/6] Exported .PUML PlantUML diagrams to .SVG --- docs/diagrams/container.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/diagrams/container.svg b/docs/diagrams/container.svg index 7f04df85f..46fe4ec50 100644 --- a/docs/diagrams/container.svg +++ b/docs/diagrams/container.svg @@ -1 +1 @@ -[Container] HMPPS Integration APICloud Platform[A Kubernetes cluster using Amazon Web Services]HMPPS Integration API[A single point of entry for services to retrieve data from multiple HMPPS systems.]Legacy Upstream Systems[Various HMPPS upstream systems, some of these will eventually be replaced]HMPPS Auth[Spring Boot Kotlin API] HMPPS Auth Server ForHMPPS Digital ServicesREST API[Spring Boot Kotlin API] Pulls data from upstreamsystems. Data is formattedinto standardised modelsMessaging System SNS/SQS Service.Prison API[Spring Boot Java API] API over NOMIS DB used byDigital Prison teamapplications and servicesProbation OffenderSearch[Springoot Kotlin API] API over the nDelius offenderdata held in ElasticsearchPrisoner Search[Spring Boot Kotlin API] API over the NOMIS prisonerdata held in OpenSearchOASys[Spring Boot Kotlin API] REST access to the OASysOracle DB offenderassessment informationAssess Risks andNeeds[Spring Boot Kotlin API] API over the Risks, Needsand Responsivity (RNR) datafor an offender held in theAssess Risks and NeedsServiceAdjudications[Spring Boot Kotlin API] Adjudications related to anoffenderCase Notes[Spring Boot Kotlin API] Case Notes related to anoffenderEPF and nDelius[Spring Boot Kotlin API]Create and VaryLicense[Spring Boot Kotlin API] Licenses related to anoffenderConsumer Application An authenticated consumerof the Integration API.Makes API calls to[JSON/HTTPS]Retrieves updatesPosts updatesAuthenticates[Bearer Token]Makes API calls to[JSON/HTTPS]Legend  container  external_system  boundary(dashed)  not_yet_implemented  \ No newline at end of file +[Container] HMPPS Integration APICloud Platform[A Kubernetes cluster using Amazon Web Services]HMPPS Integration API[A single point of entry for services to retrieve data from multiple HMPPS systems.]Legacy Upstream Systems[Various HMPPS upstream systems, some of these will eventually be replaced]HMPPS Auth[Spring Boot Kotlin API] HMPPS Auth Server ForHMPPS Digital ServicesREST API[Spring Boot Kotlin API] Pulls data from upstreamsystems. Data is formattedinto standardised modelsMessaging System SNS/SQS Service.Prison API[Spring Boot Java API] API over NOMIS DB used byDigital Prison teamapplications and servicesProbation OffenderSearch[Springboot Kotlin API] API over the nDelius offenderdata held in ElasticsearchPrisoner Search[Spring Boot Kotlin API] API over the NOMIS prisonerdata held in OpenSearchOASys[Spring Boot Kotlin API] REST access to the OASysOracle DB offenderassessment informationAssess Risks andNeeds[Spring Boot Kotlin API] API over the Risks, Needsand Responsivity (RNR) datafor an offender held in theAssess Risks and NeedsServiceAdjudications[Spring Boot Kotlin API] Adjudications related to anoffenderCase Notes[Spring Boot Kotlin API] Case Notes related to anoffenderEPF and nDelius[Spring Boot Kotlin API]OffenderManagementAllocation Manager[Ruby on Rails app] A Ruby On Rails applicationfor allocating Prisoners toPrisoner Offender Managers(POMs)Create and VaryLicense[Spring Boot Kotlin API] Licenses related to anoffenderConsumer Application An authenticated consumerof the Integration API.Makes API calls to[JSON/HTTPS]Retrieves updatesPosts updatesAuthenticates[Bearer Token]Makes API calls to[JSON/HTTPS]Legend  container  external_system  boundary(dashed)  not_yet_implemented  \ No newline at end of file From d22d4dedbfb8953677bf17233606c9e7132d46de Mon Sep 17 00:00:00 2001 From: Chiara Date: Wed, 5 Jun 2024 13:28:34 +0100 Subject: [PATCH 3/6] Corrected environment merge style --- docs/environments.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/environments.md b/docs/environments.md index a31ec6021..aac744468 100644 --- a/docs/environments.md +++ b/docs/environments.md @@ -2,9 +2,9 @@ This API is designed to run in 4 environments: -| Name | Deployed | Data | Purpose | -|------|----------|----------------------------------------------------|---------------------------------------------------| -| Local | N/A | Prism Stub | Local Feature Development | -| Dev | On Merge | T3/Development Seed | Internal Testing | +| Name | Deployed | Data | Purpose | +|---------|----------|----------------------------------------------------|---------------------------------------------------| +| Local | N/A | Prism Stub | Local Feature Development | +| Dev | On Merge | T3/Development Seed | Internal Testing | | Preprod | On Merge | Real - copy of live imported every couple of weeks | Internal Testing / QA / External Consumer Testing | -| Prod | Manually | Real | Live Services | +| Prod | On Merge | Real | Live Services | From d8a193ffe306428afe2d684ada04fc5b4ba0bf3f Mon Sep 17 00:00:00 2001 From: Chiara Date: Wed, 5 Jun 2024 14:37:40 +0100 Subject: [PATCH 4/6] Various corrections --- docs/high-availability.md | 2 +- docs/monitoring-and-alerting/gateway-api-log.md | 4 ++-- openapi.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/high-availability.md b/docs/high-availability.md index 8a00b54a3..48c8e09f3 100644 --- a/docs/high-availability.md +++ b/docs/high-availability.md @@ -11,7 +11,7 @@ Nodes are spread across multiple (up to 3) Availability Zones. ## Deployment health checks -Healthchecks are run by Kubernetes to assess the health of each node. If a node fails 3 times in a row, it is declared unhealthy and a new one put in to take its place. +Health checks are run by Kubernetes to assess the health of each node. If a node fails 3 times in a row, it is declared unhealthy and a new one put in to take its place. Kubernetes with auto heal and prevent any corrupt nodes from replacing existing healthy ones. ## Heartbeat diff --git a/docs/monitoring-and-alerting/gateway-api-log.md b/docs/monitoring-and-alerting/gateway-api-log.md index 216321d4c..4caf5c180 100644 --- a/docs/monitoring-and-alerting/gateway-api-log.md +++ b/docs/monitoring-and-alerting/gateway-api-log.md @@ -2,7 +2,7 @@ Data related to the identity of the caller, the request, and the response of requests made against our API. These logs can be helpful for monitoring, troubleshooting, and analyzing the usage of the API. ## Setup -If you're a member of the github team "hmpps-integration-api" you should be able to view log in AWS Console +If you're a member of the GitHub team "hmpps-integration-api" you should be able to view log in AWS Console ## Steps 1. Follow Cloud Platform's [documentation](https://user-guide.cloud-platform.service.justice.gov.uk/documentation/getting-started/accessing-the-cloud-console.html#login-to-the-aws-console) to log in AWS Console @@ -12,4 +12,4 @@ If you're a member of the github team "hmpps-integration-api" you should be able 5. Choose a log stream by click on the name ## Example Use Case -We'd like to debug a request. Gateway API excution log can provide details on the request payload, the endpoint and response of the request. This helps in troubleshooting and identifying the root cause of issues. \ No newline at end of file +We'd like to debug a request. Gateway API execution log can provide details on the request payload, the endpoint and response of the request. This helps in troubleshooting and identifying the root cause of issues. diff --git a/openapi.yml b/openapi.yml index 99ed7a0f1..8b4dc24ec 100644 --- a/openapi.yml +++ b/openapi.yml @@ -167,7 +167,7 @@ paths: NoQueryParametersBadRequestError: $ref: "#/components/examples/InternalServerError" - /v1/images/{id}: + /v1/images/{hmppsId}: get: tags: - images @@ -770,7 +770,7 @@ paths: NoQueryParametersBadRequestError: $ref: "#/components/examples/InternalServerError" - /v1/persons/{Id}/adjudications: + /v1/persons/{hmppsId}/adjudications: get: summary: Returns adjudications associated with a person. parameters: From af01eb69cbfcec053e72198344216dc3cbcfbb6d Mon Sep 17 00:00:00 2001 From: Chiara Date: Wed, 5 Jun 2024 14:44:32 +0100 Subject: [PATCH 5/6] Removing TBC endpoints --- openapi.yml | 76 +---------------------------------------------------- 1 file changed, 1 insertion(+), 75 deletions(-) diff --git a/openapi.yml b/openapi.yml index 8b4dc24ec..f21bf5d9c 100644 --- a/openapi.yml +++ b/openapi.yml @@ -960,80 +960,6 @@ paths: examples: NoQueryParametersBadRequestError: $ref: "#/components/examples/InternalServerError" - - /{TBC}/v1/persons/{Id}/accommodations: - get: - summary: FUTURE ENDPOINT - Returns accommodation and referral information associated with a person. - parameters: - - $ref: "#/components/parameters/Id" - responses: - "200": - description: Success. - "500": - description: An upstream service was not responding, so we cannot verify the accuracy of any data we did get. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - examples: - NoQueryParametersBadRequestError: - $ref: "#/components/examples/InternalServerError" - - /{TBC}/v1/persons/{Id}/interventions: - get: - summary: FUTURE ENDPOINT - Returns activities and Non-Statutory Interventions (NSIs) associated with a person. - parameters: - - $ref: "#/components/parameters/Id" - responses: - "200": - description: Success. - "500": - description: An upstream service was not responding, so we cannot verify the accuracy of any data we did get. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - examples: - NoQueryParametersBadRequestError: - $ref: "#/components/examples/InternalServerError" - - - /{TBC}/v1/persons/{Id}/prisoner-visits: - get: - summary: FUTURE ENDPOINT - Returns prisoner visits associated with a person. - parameters: - - $ref: "#/components/parameters/Id" - responses: - "200": - description: Success. - "500": - description: An upstream service was not responding, so we cannot verify the accuracy of any data we did get. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - examples: - NoQueryParametersBadRequestError: - $ref: "#/components/examples/InternalServerError" - - /{TBC}/v1/persons/{Id}/probation-contact-events: - get: - summary: FUTURE ENDPOINT - Returns probation contact events associated with a person. - parameters: - - $ref: "#/components/parameters/Id" - responses: - "200": - description: Success. - "500": - description: An upstream service was not responding, so we cannot verify the accuracy of any data we did get. - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - examples: - NoQueryParametersBadRequestError: - $ref: "#/components/examples/InternalServerError" - components: parameters: HmppsId: @@ -1911,7 +1837,7 @@ components: hmppsId: type: string example: 2008/0545166T - description: Currently a hmppsId is a PNC identifier however this will change in the near future to be a CRN identifier + description: A CRN identifier offenderNumber: type: string example: Z1234ZZ From 2c62b3525518bfd24d19211c6a7d1669297f1ad0 Mon Sep 17 00:00:00 2001 From: Chiara Date: Thu, 6 Jun 2024 10:13:45 +0100 Subject: [PATCH 6/6] Format --- docs/guides/setting-up-a-new-consumer.md | 4 ++-- docs/security.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guides/setting-up-a-new-consumer.md b/docs/guides/setting-up-a-new-consumer.md index ca58ac246..8f104ca06 100644 --- a/docs/guides/setting-up-a-new-consumer.md +++ b/docs/guides/setting-up-a-new-consumer.md @@ -92,7 +92,7 @@ kubectl -n hmpps-integration-api- get secrets consumer-api-keys -o 2. client certificate 3. API key -## Create new consumer subscriber queue +## Create new consumer subscriber queue for events ### Create basic infrastructure Within the [Cloud Platform Environments GitHub repository](https://github.com/ministryofjustice/cloud-platform-environments/tree/main) and the namespace of the environment: @@ -100,7 +100,7 @@ Within the [Cloud Platform Environments GitHub repository](https://github.com/mi 1. Create a branch. 2. Add new client subscriber terraform file. Example: [event-subscriber-mapps.tf](https://github.com/ministryofjustice/cloud-platform-environments/pull/22091/files#diff-4046866c9398b1db59a427052406a08c2adab45aadbc278f16232157a636f451) 3. Rename client name "mapps" to new client name -4. Add new client filter list secret. exmaple [secret.tf](https://github.com/ministryofjustice/cloud-platform-environments/pull/22091/files#diff-bc13dba50c430d2a667e5b867d2798770e5e8c48697407d93e2febedb3ff46dc) +4. Add new client filter list secret. example [secret.tf](https://github.com/ministryofjustice/cloud-platform-environments/pull/22091/files#diff-bc13dba50c430d2a667e5b867d2798770e5e8c48697407d93e2febedb3ff46dc) 5. Follow steps 3-8 in [Create an API key](#create-an-api-key) to merge branch to main. After the change is merged and applied, you can retrieve client queue name and ARN with the following command: diff --git a/docs/security.md b/docs/security.md index 27e3f04c9..29738ae00 100644 --- a/docs/security.md +++ b/docs/security.md @@ -13,7 +13,7 @@ These tokens have limited read-only access to accomplish only tasks required by Below is a list of protected resources that make up the service, and access levels to those resources. | Access | Controlled by | Limited to | -| -------------------- | --------------------------------------------------------------------- | ------------------------------- | +|----------------------|-----------------------------------------------------------------------|---------------------------------| | API | API Keys, Certificates | Registered External consumers | | AWS Account (Live) | IAM users with access credentials and two-factor authentication (2FA) | Members of Cloud Platform team | | Namespace Secrets | GitHub teams | HMPPS Integration API engineers |