This repository contains a suite of Spring Boot applications that work together to provide security services for the jpo-ode.
The three main directories and components in this repository are:
-
jpo-security-svcs:
- This is the core service of the suite and provides actual security-related functionalities.
- The goal of this application is to offer secure operations like managing authentication, authorization, and other core security-related tasks.
-
mock-signing-svc:
- A mock service that simulates signature-related operations during development and testing.
- It is used for scenarios where an external signature service is required but either unavailable or unnecessary for local testing.
-
tmca-tester:
- A simple Node.js application to enable testing of the TMC REST interface with certificates.
- It is used for scenarios where an external signature service using MTLS is required.
Follow the steps below to run the applications locally for development and testing purposes.
Ensure you have the following tools installed and configured on your machine:
- Java Development Kit (JDK): Version 21 or later
- Maven: For building the applications
- Docker: Optional, for running the services in a containerized environment
Make a copy of the contents of the sample.env file and paste them into a file named .env.
Populate the relevant environment variables following the instructions in the comments.
The jpo-security-svcs directory contains the main security service. Follow these steps to build and run it:
Navigate to the jpo-security-svcs directory and build the project:
cd jpo-security-svcs
mvn clean packageRun the jpo-security-svcs application:
java -jar target/jpo-security-svcs.jarBy default, this service runs on http://localhost:8090. You can change the port using the application.properties
file or through environment variables.
The mock-signing-svc simulates the external signature service. Follow these steps to build and run it:
Navigate to the mock-signing-svc directory and build the mock service:
cd mock-signing-svc
mvn clean packageRun mock-signing-svc:
java -jar target/mock-signing-svc.jarBy default, this service runs on http://localhost:8091. You can update the port similarly using
application.properties or environment variables.
Once both applications are running:
- You can use tools like Postman or cURL to send requests to the services.
- The
jpo-security-svcswill rely onmock-signing-svcfor signature-related operations when performing security-related validations in testing environments.
If you want to run the applications in Docker containers, you can use the provided Dockerfile in each subdirectory or
the docker-compose.yaml file in the root directory (this directory).
From this directory:
docker-compose --profile local up --build -dFrom the root of the jpo-security-svcs directory:
# Build image
docker build -t jpo-security-svcs .
# Run container
docker run -p 8080:8080 jpo-security-svcsFrom the root of the mock-signing-svc directory:
# Build image
docker build -t mock-signing-svc .
# Run container
docker run -p 9090:9090 mock-signing-svc