README.md 2.25 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
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.
14
    * generates unique request IDs forwarded to microservices along with the request data.
15
16
17

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 
18
Office API Gateway library.
19
20
21
22
23
24

## Requirements

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

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

27
28
Office API Gateway depends on other TeIS libraries:

29
30
31
32
* [TeIS Gradle plugin](../../teis-gradle-plugin)
* [TeIS public commons libraries](../../commons-public)
* [TeIS commons libraries](../../commons)
* [TeIS common API gateway library](../../common-api-gateway)
33
34
35
36
37
38
39

## 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)

40
Visit [how to run application](../../docs/blob/master/run-application.md).
41
42

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

## Default profiles
46
Visit [environment profiles](../../docs/blob/master/default-profiles.md) for more info.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

## 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
```