README.md 2.23 KB
Newer Older
1
# Office API gateway
Enriko Käsper's avatar
Enriko Käsper committed
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Office API Gateway application provides public REST interface for TeIS official user methods. 

## Features

The project contains 2 modules:

1. **api-gateway** - is a Spring Boot application providing the following functionality:

    * API methods consumed by official user front-end application.
    * checks the validity of client JWT access token issued by SSO (Keycloak).
    * sends requests to microservices via Rabbit Exchange (gw_exchange) queues.
    * generates unique request IDs forwarded to microservices along with the request data. 

2. **api-gateway-lib** - Java library containing common Data Transfer Objects (DTO) exchanged in the 
communication between gateway and microservices. All microservices consuming official user gateway messages depend on 
Office API Gateway library. 

## Requirements

* [OpenJDK 11](https://openjdk.java.net/projects/jdk/11/)
* [Rabbit MQ](https://www.rabbitmq.com/)
* [PostgreSQL](https://www.postgresql.org/)

Office API Gateway depends on other TeIS libraries:

* [TeIS Gradle plugin](../teis-gradle-plugin)
* [TeIS public commons libraries](../commons-public)
* [TeIS commons libraries](../commons)
* [TeIS common API gateway libraries](../common-api-gateway)

See [how to run required dependencies](../docs/run-requirements.md).

## Run application

Spring Boot project can be run directly from [OfficeApiGateway.main()](api-gateway/src/main/java/ee/sm/ti/teis/OfficeApiGateway.java) 
method or via executable jar file. More info on running Spring applications: 
[running your application.](https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-running-your-application.html)

Visit [how to run application](../docs/run-application.md).

## Build and configure
Visit [how to build](../docs/build-configure.md) for more info.

## Default profiles
Visit [environment profiles](../docs/default-profiles.md) for more info.

## Additional profiles

### mockauth

Application allows authenticating users with mocked authentication method.

### no_keycloak

Application will not use Keycloak authentication mechanism.

## Tests

Run [integration](api-gateway/src/integTest) and [unit tests](api-gateway/src/test) via IDE or with Gradle in command line:

```jshelllanguage
./gradlew test
```