Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/init integrations #348

Merged
merged 26 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
da815ad
:memo: integrations mv READMEs to vitepress
simonhir Jan 10, 2025
fcabaa0
:memo: integrations fix links
simonhir Jan 10, 2025
baae56d
:memo: integrations describe modules and graph
simonhir Jan 13, 2025
c98ac28
:bug: docs integrations fix broken links
simonhir Jan 13, 2025
958dc1f
:memo: integrations additional modules text
simonhir Jan 13, 2025
9b064fd
:memo: integrations graph description
simonhir Jan 13, 2025
fe89436
:memo: integrations fix typo
simonhir Jan 13, 2025
953dba0
:pencil2: docs fix cosys sidebar link case
simonhir Jan 16, 2025
95fccf5
:pencil2: docs cosys add s3 link
simonhir Jan 16, 2025
bcb2c6f
:pencil2: docs link s3 mentions
simonhir Jan 16, 2025
028f56d
:pencil2: docs integrations index update address description
simonhir Jan 16, 2025
8c6411f
Apply suggestions from code review
simonhir Jan 16, 2025
b08264b
Merge remote-tracking branch 'origin/docs/init-integrations' into doc…
simonhir Jan 16, 2025
0fb3626
Apply suggestions from code review
simonhir Jan 16, 2025
d7166de
:pencil2: docs integrations index update description
simonhir Jan 17, 2025
9096b4f
:pencil2: docs integrations update s3 client starter reference
simonhir Jan 17, 2025
5d58af2
:pencil2: docs integrations dms rest-api description
simonhir Jan 17, 2025
87a6922
:pencil2: docs integrations mail rm s3 properties reference
simonhir Jan 17, 2025
a5be4dd
:pencil2: docs integrations s3 update service reference
simonhir Jan 17, 2025
2e85c5d
Merge remote-tracking branch 'origin/docs/init-integrations' into doc…
simonhir Jan 17, 2025
fec4085
:pencil2: docs integrations implement review
simonhir Jan 17, 2025
4c9909c
:pencil2: docs integrations implement review
simonhir Jan 17, 2025
0f68d47
:pencil2: docs integrations implement review
simonhir Jan 17, 2025
77d257a
Merge branch 'main' into docs/init-integrations
simonhir Jan 17, 2025
1a5b188
:pencil2: docs integrations implement review
simonhir Jan 17, 2025
efbd4cb
Merge remote-tracking branch 'origin/docs/init-integrations' into doc…
simonhir Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ const vitepressConfig = defineConfig({
{
text: "Integrations",
link: "/integrations",
items: [{ text: "S3", link: "/integrations/s3" }],
items: [
{ text: "S3", link: "/integrations/s3" },
{ text: "Address", link: "/integrations/address" },
{ text: "CoSys", link: "/integrations/cosys" },
{ text: "DMS", link: "/integrations/dms" },
{ text: "E-Mail", link: "/integrations/email" },
],
},
],
outline: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# RefArch address integration
# Address Integration

Integration for reading, searching and validating addresses via the LHM address service.

## Modules

The modules follow the [default naming convention](./index.md#naming-conventions).

## Usage

```xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# RefArch CoSys integration
# CoSys Integration

Integration for creating documents with [coSys](https://www.cib.de/cosys/). Uses s3-integration for file handling.
Integration for creating documents with [coSys](https://www.cib.de/cosys/). Uses [s3-integration](./s3.md) for file handling.

## Modules

The modules follow the [default naming convention](./index.md#naming-conventions).

### Dependency graph

The following graph shows the relationships between the various modules and how they interact and rely on each other.

```mermaid
flowchart RL
example --> starter --> core --> client
core --> s3-client
```

## Usage

Expand All @@ -15,7 +29,8 @@ Integration for creating documents with [coSys](https://www.cib.de/cosys/). Uses
</dependencies>
```

and a [s3-integration starter](../refarch-s3-integration/README.md#usage).
Additionally, a specific `s3-integration-*-client-starter` is required as dependency, because S3 is used for file handling.
See [according documentation](./s3.md#usage).

## Configuration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
# RefArch DMS integration
# DMS Integration

Integration for CRUD operations on a dms system in specific fabasoft. Uses
s3-integration for file handling.
Integration for CRUD operations on a dms system in specific fabasoft. Uses [s3-integration](./s3.md) for file handling.

## Modules

The modules follow the [default naming convention](./index.md#naming-conventions).

Besides the default modules we provide the additional ones:

- `soap-api`: Interface for accessing the SOAP-API of the underlying service.
- `soap-mock`: Mock for testing purposes of soap-api.
- `rest-api`: Interface for accessing the REST-API of the underlying service. Alternative to soap-api but can't currently be used as drop-in-replacement.

### Dependency graph

The following graph shows the relationships between the various modules and how they interact and rely on each other.

```mermaid
flowchart RL
starter --> core --> fabasoft-soap-api
core --> s3-client
fabasoft-soap-mock-service --> fabasoft-soap-mock --> fabasoft-soap-api
fabasoft-rest-api
```

## Usage

Expand All @@ -16,7 +37,8 @@ s3-integration for file handling.
</dependencies>
```

and a [s3-integration starter](../refarch-s3-integration/README.md#usage).
Additionally, a specific `s3-integration-*-client-starter` is required as dependency, because S3 is used for file handling.
See [according documentation](./s3.md#usage).

## Configuration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
# RefArch email integration
# Email Integration

Integration for sending text and html emails with attachments. Uses [s3-integration](../refarch-s3-integration) for file
handling.
Integration for sending text and HTML mails with attachments. Uses [s3-integration](./s3.md) for file handling.

## Modules

The modules follow the [default naming convention](./index.md#naming-conventions).

Besides the default modules we provide the additional ones:

- `email-api`: Implementation of core email functionality. Will be included in core in the future.
- `rest-example`: Example which uses s3-rest-client.
- `java-example`: Example which uses s3-java-client.

### Dependency graph

The following graph shows the relationships between the various modules and how they interact and rely on each other.

```mermaid
flowchart RL
starter --> core --> api-starter --> api
core --> s3-client
rest-example --> starter
rest-example --> s3-rest-client-starter
java-example --> starter
java-example --> s3-java-client-starter
```

## Usage

Expand All @@ -16,7 +39,8 @@ handling.
</dependencies>
```

and a [s3-integration starter](../refarch-s3-integration/README.md#usage).
Additionally, a specific `s3-integration-*-client-starter` is required as dependency, because S3 is used for file handling.
See [according documentation](./s3.md#usage).

## Configuration

Expand All @@ -30,5 +54,3 @@ and a [s3-integration starter](../refarch-s3-integration/README.md#usage).
| `spring.mail.password` | Password of smtp server. | |
| `refarch.mail.from-address` | Default from address used when sending mails. | `[email protected]` |
| `refarch.mail.default-reply-to-address` | Default reply to address used when sending mails. | `[email protected]` |

In addition, properties of selected [s3-integration starter](../refarch-s3-integration/README.md#usage).
34 changes: 34 additions & 0 deletions docs/integrations/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# Integrations

Integrations are ready to use implementations for accessing often used services in own applications without re-implementing the same logic.
These enable reduced coding effort and maintenance as well as standardized programming interfaces.

## Integrations

- [s3-integration](./s3.md): For CRUD operations on a S3 storage. Also used for file handling
in other integrations.
- [email-integration](./email.md): For sending text and HTML emails with attachments. Uses
s3-integration for file handling.
- [dms-integration](./dms.md): For CRUD operations on a DMS system in specific fabasoft. Uses
s3-integration for file handling.
- [cosys-integration](./cosys.md): For creating documents with coSys. Uses
s3-integration for file handling.
- [address-integration](./address.md): For reading, searching and validating addresses via the LHM address service.

## Naming conventions

The different submodules of integrations follow following naming conventions:

- `*-client`: Interface for accessing the API of the underlying service.
- `*-core`: Implementation of the base functionality of the integration in hexagonal architecture.
- `*-starter`: Provides Beans of core services.
- `*-service`: A Spring application using the starter. It is provided as container image and should not be used as dependency.
- `*-example`: An example Spring application for testing and reference. It should not be used as dependency or in real environments.

### Dependency graph

The following graph shows the relationships between the various modules and how they interact and rely on each other.

```mermaid
flowchart RL
service --> starter --> core --> client
```
128 changes: 127 additions & 1 deletion docs/integrations/s3.md
Original file line number Diff line number Diff line change
@@ -1 +1,127 @@
# S3-Integration
# S3 Integration

Integration for CRUD operations on a S3 storage. Also used for file handling in other integrations.

## Modules

The S3 integration follows the [default naming conventions](./index.md#naming-conventions).

Beside the default integration it contains different client libraries for accessing the integration. The client
libraries are especially provided for usage in other integrations.

- REST: The REST client uses the REST endpoints of the `s3-rest-service` module to manage data in S3.
- Java: The Java client directly uses the in ports of the `s3-core` module.

### Dependency graph

The following graph shows the relationships between the various modules and how they interact and rely on each other.

```mermaid
flowchart RL
rest-service --> rest-starter --> rest-core --> core
rest-starter --> starter --> core

java-client-starter --> java-client --> client-core
java-client --> core
java-client-starter --> starter
rest-client-starter --> rest-client --> client-core
rest-client -.REST.-> rest-service
```

## Usage

```xml

<dependencies>
<!-- REST -->
<!-- requires running instance of s3-rest-service -->
<dependency>
<groupId>de.muenchen.refarch</groupId>
<artifactId>refarch-s3-integration-rest-starter</artifactId>
<version>...</version>
</dependency>
<!-- or Java -->
<dependency>
<groupId>de.muenchen.refarch</groupId>
<artifactId>refarch-s3-integration-java-starter</artifactId>
<version>...</version>
</dependency>
</dependencies>
```

## Configuration

Following are the properties to configure the different modules. Some of them are custom defined and others are synonyms
for spring package properties.
Whether a property is an alias can be checked in the corresponding `application.yml` of each module.

### s3-integration-rest-service

| Property | Description | Example |
|-------------------------------------------------|-----------------------------------|------------------|
| `refarch.s3.url` | URL of S3 endpoint to connect to. | `s3.example.com` |
| `refarch.s3.bucket-name` | Name of the bucket to connect to. | `refarch-bucket` |
| `refarch.s3.access-key` | Access key to use for connection. | |
| `refarch.s3.secret-key` | Secret key to use for connection. | |
| `refarch.s3.initial-connection-test` (optional) | Test connection to S3 at startup. | `true` (default) |

For authenticating the different endpoints OAuth 2.0 authentication needs to be configured.
See below example or the [according Spring documentation](https://docs.spring.io/spring-security/reference/servlet/oauth2/index.html#oauth2-resource-server).

```yml
spring:
security:
oauth2:
resourceserver:
jwt:
issuer-uri: https://sso.example.com/auth/realms/refarch
security:
oauth2:
resource:
user-info-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri}/protocol/openid-connect/userinfo
```

### s3-integration-java-client-starter

| Property | Description | Example |
|------------------------------------------------------------|-------------------------------------------------------|--------------------------|
| `refarch.s3.client.max-file-size` (optional) | Single file limit for up- or downloading in byte. | `10MB` |
| `refarch.s3.client.max-batch-size` (optional) | Limit for up- or downloading a list of files in byte. | `100MB` |
| `refarch.s3.client.supported-file-extensions.*` (optional) | Map of allowed file extensions for up- and download. | `pdf: "application/pdf"` |

### s3-integration-rest-client-starter

All properties of [s3-integration-java-client-starter](#s3-integration-java-client-starter) and following:

| Property | Description | Example |
|------------------------------------------|----------------------------------------------------------------------------|-----------------------------------------------|
| `refarch.s3.client.document-storage-url` | URL to the RefArch S3 integration service. | `http://s3-integration-service:8080` |
| `refarch.s3.client.enable-security` | Switch to enable or disable OAuth 2.0 authentication against S3 service. | `true` |

For authentication against the `s3-service` a OAuth 2.0 registration with the name `s3` needs to be provided.
See following example or the [according Spring documentation](https://docs.spring.io/spring-security/reference/servlet/oauth2/index.html#oauth2-client).

```yml
spring:
security:
oauth2:
client:
provider:
sso:
issuer-uri: https://sso.example.com/auth/realms/refarch
user-info-uri: ${spring.security.oauth2.client.provider.sso.issuer-uri}/protocol/openid-connect/userinfo
jwk-set-uri: ${spring.security.oauth2.client.provider.sso.issuer-uri}/protocol/openid-connect/certs
# used for RequestResponseLoggingFilter in s3-rest-service
# only required if filter is explicitly enabled
user-name-attribute: user_name
registration:
s3:
provider: sso
authorization-grant-type: client_credentials
client-id: refarch_client
client-secret: client_secret_123
# profile required for username used in s3-rest-service RequestResponseLoggingFilter
# openid required for user info endpoint used in s3-rest-service JwtUserInfoAuthenticationConverter
# both scopes are only required if the according functions are explicitly used
scope: profile, openid
```
23 changes: 0 additions & 23 deletions refarch-integrations/README.md

This file was deleted.

Loading
Loading