Skip to content

Commit

Permalink
Merge pull request #38 from catenax-ng/lib-updates
Browse files Browse the repository at this point in the history
Lib updates and QG change
  • Loading branch information
almadigabor authored May 9, 2023
2 parents c71182b + be353f6 commit c4df63b
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 167 deletions.
2 changes: 2 additions & 0 deletions .tractusx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
product: "SDFactory"
leadingRepository: "https://github.com/eclipse-tractusx/sd-factory"
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]
- NA
- Updated README.md
- a figure for arc42


## [2.0.6] - 2023-05-02

### Added

- Added .tractusx file

### Changed
- Updated librabries and upgrade spring boot


## [2.0.5] - 2023-04-24

Expand All @@ -17,7 +28,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [2.0.4] - 2023-04-19

### Added

- Added spring expression 6.0.8


Expand Down
180 changes: 69 additions & 111 deletions DEPENDENCIES

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ How to install application using helm: <br />
a.) Add helm repository in tractusx:
helm repo add sd-factory https://eclipse-tractusx.github.io/charts/dev
b.) To search the specific repo in helm repositories
helm search repo tractusx-dev
helm search repo sd-factory/sdfactory
c.) To install using helm command:
helm install sd-factory tractusx-dev/sd-factory
helm install sdf sd-factory/sdfactory


2.) Local installation:
Expand All @@ -37,4 +37,4 @@ How to install application using helm: <br />
d.) These secrets should be defined in Hashicorp vault
e.) Deploy in a kubernetes cluster
helm install sdfactory charts/SDFactory/ -n NameSpace
60 changes: 29 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# <a id="introduction"></a>Self-Description Factory

In Catena-X we provide self-descriptions for any participant of this data space.
The Self Descriptions are stored inside the Self Description Hub. Self-Description
Factory component is responsible for the creation of Self Descriptions. This component
gets input data from the Onboarding Tool, which prepares the data for the SD-Factory,
A Self Description document (SD-document) is provided for any participant of this data
space. The Self Descriptions are stored inside the Self Description Hub. Self-Description
Factory (SD-Factory) component is responsible for the creation of Self Descriptions. This
component gets input data from the Onboarding Tool, which prepares the data for the SD-Factory,
creates a Verifiable Credential and passes the document to the
[Managed Identity Wallet](https://github.com/eclipse-tractusx/managed-identity-wallets)
based on the Custodian for the signature. The result is sent to the Compliance Service for
Expand All @@ -13,15 +13,15 @@ further processing.
## Software Version

```shell
Software version: 2.0.5
Helm Chart version: 2.0.5
Software version: 2.0.6
Helm Chart version: 2.0.6

```


# Solution Strategy

Here the flow of Self-Description creation is shown:-
Here the flow of Self-Description creation is shown:

```mermaid
sequenceDiagram
Expand All @@ -44,25 +44,25 @@ sequenceDiagram
2. User calls On-boarding Service with request for creating and publishing
SD-document. The service authenticates the user and prepare the data
SD-Factory needs for creating SD-document. SDFactory takes document in a format,
specified in [Catena-X Confluence](https://confluence.catena-x.net/display/CORE/Self+Description+Interface)]
and convert it to [Trust Framework V.22.10]. Currently, these documents are supported by SD-Factory:
specified in OpenAPI document [Pre-22.4 schema, AKA 1.06] and convert it to
[Trust Framework V.22.10]. Currently, these documents are supported by SD-Factory:
- LegalPerson;
- ServiceOffering;
**Organization wallet of the company which runs the service shall
**Organization wallet of the company running the service shall
be available at this point of time as it signs the Verifiable Credential
with SD document. The wallet associated with the service shall be available
as well.**
3. On-boarding service (OS) calls SD-Factory for creating SD-document passing this
data as a parameter. OS uses a credential with a role allowing for this request
(e.g. `add_self_descriptions`, the default role for SD-document creation). The
credential for this operation is taken from Identity Provider (keyclock).
credential for this operation is taken from Identity Provider (keycloak).
4. SD-Factory creates a Verifiable Credential based on the information taken from
OS and signs it with organization key. The organization is acting as an Issuer.
The wallet ID of the service is used as Holder Id. The Custodian Wallet is used
for this operation.
5. SD-Factory sends signed Verifiable Credential to the Compliance Service for further (asynchronous) processing.
In the end the Compliance Service sends Self-Description document back to the On-boarding service endpoint.
OS is responsible for storing and publishing it.
OS and passes it to the Custodian Wallet to be signed with organization key. The
organization is acting as an Issuer. The wallet ID of the service is used as a Holder.
5. SD-Factory sends signed Verifiable Credential to the Compliance Service for further
(asynchronous) processing. In the end the Compliance Service sends Self-Description
document back to the On-boarding service endpoint. OS is responsible for storing and
publishing it.

For the VC we have to provide valid JSON context where we have a reference to an object
from known ontology. This object carries the claims the SD-Factory signs. The document
Expand All @@ -74,24 +74,23 @@ when will be provided by Trusted Framework. Currently, we support

The SD-Factory provides interfaces to create Verifiable Credential for one of mentioned documents.
Only the authorized user can call these interfaces. They are protected with keycloak. The configuration
parameters are given in `application.yml`.
The user role for creating Self-Descriptions is specified in `application.yml` as well
parameters are given in `application.yml`. The user role for creating Self-Descriptions is specified in
`application.yml` as well.

To trigger creation of the SD-document one shall call the endpoint available by path :

`POST /api/rel3/selfdescription`

OpenAPI specification is given there:

[Pre-22.4 schema, AKA 1.06](src/main/resources/static/SDFactoryApi-vRel3.yml).
OpenAPI specification is given in [Pre-22.4 schema, AKA 1.06].

An example of the body for LegalPerson is given bellow:

```json
{
"type": "LegalPerson",
"holder": "BPNL000000000000",
"issuer": "CAXSDUMMYCATENAZZ",
"issuer": "CAXSDUMMYCATENAZZ",
"externalId": "ID01234-123-4321",
"registrationNumber": [
{
"type": "local",
Expand All @@ -111,7 +110,7 @@ Verifiable Credentials for LegalPerson:
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://github.com/catenax-ng/tx-sd-factory/raw/main/src/main/resources/verifiablecredentials.jsonld/sd-document-v22.10.jsonld",
"https://raw.githubusercontent.com/eclipse-tractusx/sd-factory/main/src/main/resources/verifiablecredentials.jsonld/sd-document-v22.10.jsonld",
"https://w3id.org/vc/status-list/2021/v1"
],
"type": [
Expand Down Expand Up @@ -155,7 +154,7 @@ Verifiable Credentials for LegalPerson:
}
```

Then Verifiable Credential is sent to the Compliance Service.
Then the Verifiable Credential is sent to the Compliance Service.

# Configuration
The configuration property file is located under `resources` folder and is incorporated
Expand Down Expand Up @@ -241,24 +240,23 @@ java -jar target/sd-factory-2.0.0.jar
```
Please note the name of jar-file as it may differ if version is changed.

<a name="docker"></a>To build a Docker image one can use this command:
To build a Docker image one can use this command:
```shell
docker build .
```
A Docker image will be built and installed to the local repository.

# Testing
SD-Factory can be fired up locally in Docker environment. Before that
the images need to be created as it is [described here](#docker). Do not forget
to provide necessary configuration parameters in application.yml for keycloak
and the Custodian Wallet.
SD-Factory can be fired up locally in Docker environment. Before that the image needs
to be created. Do not forget to provide necessary configuration parameters in `application.yml`
for keycloak and the Custodian Wallet.


## Installation Steps

[INSTALL.md](INSTALL.md)


[Pre-22.4 schema, AKA 1.06]: src/main/resources/static/SDFactoryApi-vRel3.yml
[Trust Framework]: https://gitlab.com/gaia-x/policy-rules-committee/trust-framework
[Trust Framework V.22.10]: https://gitlab.com/gaia-x/policy-rules-committee/trust-framework/-/tree/22.10

4 changes: 2 additions & 2 deletions charts/SDFactory/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.0.5
version: 2.0.6

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.0.5"
appVersion: "2.0.6"



2 changes: 1 addition & 1 deletion charts/SDFactory/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sdfactory

![Version: 2.0.5](https://img.shields.io/badge/Version-2.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.5](https://img.shields.io/badge/AppVersion-2.0.5-informational?style=flat-square)
![Version: 2.0.6](https://img.shields.io/badge/Version-2.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.6](https://img.shields.io/badge/AppVersion-2.0.6-informational?style=flat-square)

Helm Charts for SD Factory application. Self-Description Factory component is responsible for the creation of Self Descriptions.

Expand Down
Binary file modified docs/images/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 47 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.tsystems</groupId>
<artifactId>sd-factory</artifactId>
<version>2.0.5</version>
<version>2.0.6</version>
<name>factory</name>
<description>Self-Description Hub Prototype</description>
<packaging>jar</packaging>
Expand Down Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.0.2</version>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -83,6 +83,11 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.31</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down Expand Up @@ -113,27 +118,27 @@
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>6.0.8</version>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.22.3</version>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>6.0.3</version>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.5</version>
</dependency>



<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<classifier>osx-aarch_64</classifier>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>21.1.1</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.4.10</version>
</dependency>

</dependencies>

<repositories>
Expand Down Expand Up @@ -235,7 +240,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.dash</groupId>
<artifactId>license-tool-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<executions>
<execution>
<id>license-check</id>
<goals>
<goal>license-check</goal>
</goals>
</execution>
</executions>
<configuration>
<summary>DEPENDENCIES</summary>
</configuration>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>dash-licenses-snapshots</id>
<url>https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

</project>

0 comments on commit c4df63b

Please sign in to comment.