Giter Club home page Giter Club logo

ministryofjustice.crime-portal-gateway-client's Introduction

crime-portal-gateway-client

A client to exercise the Crime Portal Gateway.

This is implemented as a simple Spring Boot command line application. It will construct a SOAP request and send it to the crime portal gateway SOAP endpoint with necessary SOAP security headers. The payload of this SOAP request is the XML found in the project file art src/main/resources/requests/external-document-request.xml.

The intention is that initially the project will offer a simple means of testing our secured SOAP endpoints in dev and preprod namespaces. It could be extended to provide a means of load testing the endpoint.

JKS

When the application runs it requires a java keystore (JKS) in order to sign and encrypt messages. This will be provided separately.

Environment variables

Syntax Description Example
soap_default_uri The WS endpoint to call http://localhost:8080/crime-portal-gateway/ws
keystore_password Password used for the JKS changeit
trusted_cert_alias_name Alias for the trusted certificate in the JKS server-public
private_key_alias_name Password used for the JKS client

Instructions

The application has pre-configured profiles - local, dev and preprod.

Pre-requisites

You will need

  • JDK at version 11 or higher
  • Gradle at version 6.3 or higher

Crime Portal Gateway

CPG exposes endpoints for health (/health) and WSDL (/crime-portal-gateway/ws/ExternalDocumentRequest.wsdl). These can be checked prior to running the test. The hosts are as follows

Running the client

If running securely, then copy the client.jks file to src/main/resources.

Start the LOCAL spring profile. Communicates to the SOAP endpoint running at localhost, unencrypted by default.

KEYSTORE_PASSWORD=[insert password] SPRING_PROFILES_ACTIVE=local ./gradlew bootRun

Start the app with the CPG DEV spring profile. Communicates to the SOAP endpoint at https://crime-portal-gateway-dev.apps.live-1.cloud-platform.service.justice.gov.uk/crime-portal-gateway/ws/, with an unencrypted and unsigned message.

KEYSTORE_PASSWORD=[insert password] SPRING_PROFILES_ACTIVE=cpg-dev ./gradlew bootRun

Start the app with the CPG PRE-PROD profile. Communicates to the SOAP endpoint at https://crime-portal-gateway-preprod.apps.live-1.cloud-platform.service.justice.gov.uk/crime-portal-gateway/ws/, with an encrypted and signed message. The environment variables shown are samples and may be adjusted for the key pair being used.

KEYSTORE_PASSWORD=[insert password] SPRING_PROFILES_ACTIVE=cpg-preprod ./gradlew bootRun

ministryofjustice.crime-portal-gateway-client's People

Contributors

chris-faulkner-mojdt avatar jhevans avatar sarahyjja avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.