Sign inSign up

difi/sp-selfservice-web

By difi

•Updated almost 7 years ago

Selfservice of serviceproviders

Image
0

653

difi/sp-selfservice-web repository overview

⁠Difi Integration Management Portal

A web application that offers GUI for self-service operation for Difi's ID-porten customers. Self-service is done against the ID-porten's external administration API provided by Difi.

⁠Development

By default, the application uses the 'dev' profile, so you don't need to configure anything.

⁠Running the Java Server

You can launch the Java Server with Maven. The project is configured with a Maven wrapper, so you don't need to install Maven. This is a guarantee that all project collaborators have the same Maven version.

We have created a script that builds all the modules, and then run the main application in local (dev profile).

From the project's root, run:

./build.sh && ./run.sh

Or, using your own local Maven installation. From the project's root, run:

mvn clean install

Then

cd management-ui
mvnw (on MacOS/Linux) or mvnw (on Windows)
(This will run our default Maven task, spring-boot:run)
⁠Working with the frontend (Webpack)

Running Webpack is the default task in the package.json file, so you just need to run the above command from the main application folder (management-ui):

npm start
(You need to start the server (backend) in a separate terminal tab before starting the webpack dev server)

⁠Building for production

To optimize the application for production, run:

[TODO]

⁠Testing

The application comes with a set of tests:

  • Integration tests using the Spring Test Context framework
  • UI tests with Jest
⁠Integration tests

Integration tests are done with the Spring Test Context framework, and are located in the src/test/java folder. These tests can be run directly from the IDE, by right-click on each test class, or by running (in project's root folder):

./mvnw clean test
⁠UI tests

For UI tests, only unit tests with Jest are provided. These tests are located in the management-ui/src/test/javascript/spec folder. These tests will mock up the access to the application's REST endpoints, so we can test the UI layer without having to start the java backend. UI tests can be run using (inside management-ui folder)

npm start test

If the tests can't run because of linting issues, run the following command to fix linting issues, before running the tests:

npm run lint:fix
⁠Helper scripts

Running UI tests from the project's root folder:

./ui-test.sh

⁠Audit Log

In runtime, the application captures some of the user's action and persists the information in ELF (Extended Log Format) formatted log file. Only sensitive user actions are captured. This includes, updating and deleting integration resources. The log files are located in the folder /auditlogs and organized by date.

⁠Accessing the Audit Log (Requires shell access server )

Only manager are supposed to have access to the audit logs. A manager is seen here as person with shell access to the application server.

⁠Access Audit logs during development & acceptance

During the development, Kubernetes engine (GKE) is used as the infrastructure to run the application for acceptance testing and validation. To access the audit logs in this environment, one needs cluster access with permissions to run interactive shell commands on kubernetes pods where the application is running.

  • Figure out which pod (in test environment) our application is running on:

    kubectl get pods -n test

  • After the pod is identified, run this one command to interactively open the audit log file. Assuming [management-ui-56697bdf75-wwllx] is the pod where the application is running:

    kubectl exec -it management-ui-56697bdf75-wwllx -n test -- vi auditlogs/elf-audit.log

⁠Using Docker to simplify development (optional)

You can use docker to improve your development experience.

[TODO]

Tag summary

Content type

Image

Digest

Size

119.1 MB

Last updated

almost 7 years ago

docker pull difi/sp-selfservice-web