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

[ 19º ] - Release/v2.1.0 backend agree: Enabled policy selection and handling of more than one contract in the backend #205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
90ec283
Merge branch 'develop' of https://github.com/catenax-ng/tx-digital-pr…
saudkhan116 Jun 26, 2023
bc19394
Merge branch 'main' of https://github.com/catenax-ng/tx-digital-produ…
saudkhan116 Jul 4, 2023
11aa28f
Merge branch 'main' of https://github.com/catenax-ng/tx-digital-produ…
saudkhan116 Aug 18, 2023
f2fcdc2
Merge branch 'main' of https://github.com/catenax-ng/tx-digital-produ…
saudkhan116 Aug 22, 2023
ca85e2d
feat: updated models to fix new generic structures
Dec 5, 2023
1b78248
feat: added policy control by id
Dec 5, 2023
8e89ecf
feat: added policy selection
Dec 5, 2023
ff732fb
fix: renamed from '/sign' api to '/agree'
Dec 8, 2023
e30eddf
Merge branch 'bugfix/cmp-983/dtr-lookup' of https://github.com/catena…
saudkhan116 Dec 14, 2023
09a37b2
Merge branch 'catenax-ng-bugfix/cmp-983/dtr-lookup'
saudkhan116 Dec 14, 2023
fef3acc
merge: merge main and resolved conflicts
Jan 5, 2024
291606a
feat: adapted returns to more than one contract
Jan 5, 2024
51aa877
feat: started frontend refactor
Jan 5, 2024
dd026db
Merge branch 'main' of https://github.com/catenax-ng/tx-digital-produ…
saudkhan116 Jan 5, 2024
811279d
chore: remove passport aspects from dpp helm values to test trivy wor…
saudkhan116 Jan 5, 2024
67d27bf
Merge pull request #216 from catenax-ng/bugfix/trivy-check
saudkhan116 Jan 15, 2024
c0941c3
feat: added two steps negotiation
Jan 16, 2024
021bcf3
feat: added two steps negotiation in frontend
Jan 23, 2024
b28b0bd
fix: fix decline configuration and logic
Jan 23, 2024
244f3db
feat: configured token validation in backend
Jan 23, 2024
de9d9ea
fix: fixed token for decline api
Jan 23, 2024
8a0e659
chore: updated spring boot to version 3.2.2
Jan 26, 2024
f2a8a74
feat: added cancel api method to frontend
Jan 26, 2024
2a0a2d2
fix: added timetoleave and ignored extra fields in bpn, edc and disco…
Jan 29, 2024
1444ce9
chore: updated backend version
Jan 29, 2024
9132c5c
Merge branch 'develop' of https://github.com/catenax-ng/tx-digital-pr…
Jan 29, 2024
80d78df
fix: fixed merge conflicts
Jan 29, 2024
d33b4ec
chore: removed the version parameter
Jan 29, 2024
cdb22cc
feat: added dtr datasets storage in temporary dir until process creation
Jan 29, 2024
b59ae56
feat: added dtr to the status file
Jan 29, 2024
5e2c7db
feat: added dtr contracts and selected contract id
Jan 29, 2024
febce41
chore: updated vite to not vulnerable version and runned IP checks
Jan 30, 2024
5af9cb8
feat: added frontend option to reload
Jan 30, 2024
e0c12cc
fix: solved problem in frontend
Jan 30, 2024
57aef3f
chore: updated response message
Jan 30, 2024
d362f8b
chore: removed console.logs fro debugging
Jan 31, 2024
ca6d236
fix: fixed contract dataset retrival at end
Jan 31, 2024
36a1e06
Merge branch 'main' of https://github.com/catenax-ng/tx-digital-produ…
Jan 31, 2024
74162ad
fix: readedd tranmission pass aspect in frontend schemas
Jan 31, 2024
637609f
feat: re-added passport aspects with dpp v2.0.0
Jan 31, 2024
d294c85
chore: removed debugging logs
Feb 2, 2024
de2de2b
merge: solved all merged conflicts
Feb 2, 2024
9b4fee8
Merge pull request #203 from catenax-ng/feature/cmp-951/policy-selection
matbmoser Feb 2, 2024
860c3f8
merge: resolved conflict in merge
Feb 2, 2024
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: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ repos:
- repo: https://github.com/gitguardian/ggshield
rev: v1.13.6
hooks:
# - id: ggshield
# language_version: python3
# stages: [commit]
- id: ggshield
language_version: python3
stages: [commit]
- id: ggshield
language_version: python3
stages: [push]
stages: [push]
116 changes: 58 additions & 58 deletions DEPENDENCIES_BACKEND

Large diffs are not rendered by default.

101 changes: 43 additions & 58 deletions DEPENDENCIES_FRONTEND

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions charts/digital-product-pass/templates/deployment-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ spec:
- name: "AUTH_BPN_NUMBER"
value: "{{ .Values.oauth.bpnCheck.bpn }}"

- name: "APP_AUTO_SIGN"
value: "{{ .Values.frontend.negotiation.autoSign }}"

- name: "APP_PORTAL_URL"
value: "https://{{ .Values.frontend.portal.hostname }}"

Expand All @@ -87,8 +90,11 @@ spec:
- name: "IDP_URL"
value: "https://{{ .Values.oauth.hostname }}"

- name: "API_TIMEOUT"
value: "{{ .Values.frontend.api.timeout }}"
- name: "API_NEGOTIATE_TIMEOUT"
value: "{{ .Values.frontend.api.negotiateTimeout }}"

- name: "API_SEARCH_TIMEOUT"
value: "{{ .Values.frontend.api.searchTimeout }}"

- name: "API_MAX_RETRIES"
value: "{{ .Values.frontend.api.max_retries }}"
Expand Down
15 changes: 9 additions & 6 deletions charts/digital-product-pass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ backend:
catalog: "/catalog/request"
negotiation: "/contractnegotiations"
transfer: "/transferprocesses"
# -- Negotiation status Delay in milliseconds in between async requests [<= 500]
delay: 100
delay: 100 # -- Negotiation status Delay in milliseconds in between async requests [<= 500]

# -- backend hostname (without protocol prefix [DEFAULT HTTPS] for security )
hostname: *hostname
Expand Down Expand Up @@ -129,13 +128,12 @@ backend:
# -- unique sha512 hash key used for the passport encryption
encryptionKey: ""

# -- passport data transfer configuration
passport:
# -- passport versions and aspects allowed
aspects:
- "urn:bamm:io.catenax.generic.digital_product_passport:1.0.0#DigitalProductPassport"
- "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass"
- "urn:bamm:io.catenax.transmission.transmission_pass:1.0.0#TransmissionPass"
- "urn:samm:io.catenax.generic.digital_product_passport:2.0.0#DigitalProductPassport"

digitalTwinRegistry:
endpoints:
Expand Down Expand Up @@ -183,7 +181,7 @@ frontend:
ingress:
enabled: false
hosts: []

# -- The [pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) defines privilege and access control settings for a Pod within the deployment
podSecurityContext:
seccompProfile:
Expand Down Expand Up @@ -227,12 +225,17 @@ frontend:
portal:
hostname: ""

negotiation:
autoSign: true

# -- api timeouts
api:
# -- max retries for getting status
max_retries: 30
# -- default timeout - 90 seconds in milliseconds
timeout: 90000
negotiateTimeout: 20000
searchTimeout: 40000

# -- delay from getting status
delay: 1000

Expand Down
8 changes: 0 additions & 8 deletions dpp-backend/charts/digital-product-pass-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ process:
# -- unique sha512 hash key used for the passport encryption
encryptionKey: ""

# -- passport data transfer configuration
passport:
# -- passport versions and aspects allowed
aspects:
- "urn:bamm:io.catenax.generic.digital_product_passport:1.0.0#DigitalProductPassport"
- "urn:bamm:io.catenax.battery.battery_pass:3.0.1#BatteryPass"
- "urn:bamm:io.catenax.transmission.transmission_pass:1.0.0#TransmissionPass"

digitalTwinRegistry:
endpoints:
search: "/lookup/shells"
Expand Down
6 changes: 3 additions & 3 deletions dpp-backend/digitalproductpass/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.eclipse.tractusx</groupId>
<artifactId>digitalproductpass</artifactId>
<version>2.0.3</version>
<version>2.1.0</version>
<packaging>jar</packaging>
<name>Catena-X Digital Product Passport Backend</name>
<description>Digital Product Passport Consumer Backend Reference Implementation System for Product Passport Consumer Frontend Application
Expand Down Expand Up @@ -179,7 +179,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.0.3</version>
<version>2.0.2</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.eclipse.tractusx.digitalproductpass.config.DtrConfig;
import org.eclipse.tractusx.digitalproductpass.config.IrsConfig;
import org.eclipse.tractusx.digitalproductpass.config.PassportConfig;
Expand Down Expand Up @@ -232,6 +233,7 @@ public Response getDigitalTwin(@RequestBody Object body, @PathVariable String pr
));
String bpn = dtr.getBpn();
Boolean childrenCondition = search.getChildren();
processManager.saveDtr(processId, endpointId);
processManager.saveTransferInfo(processId, connectorAddress, semanticId, dataPlaneUrl, bpn, childrenCondition);
processManager.saveDigitalTwin(processId, digitalTwin, dtRequestTime);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,19 @@ public Response getData(@Valid @RequestBody TokenRequest tokenRequestBody) {
}

// Check if the contract id is correct
History history = status.getHistory("contract-dataset");
if (!history.getId().equals(contractId)) {
response = httpUtil.getBadRequest("This contract id is incorrect!");
return httpUtil.buildResponse(response, httpResponse);
}

Map<String, Dataset> availableContracts = processManager.loadDatasets(processId);
String seedId = String.join("|",availableContracts.keySet()); // Generate Seed
// Check the validity of the token
String expectedToken = processManager.generateToken(process, contractId);
String expectedToken = processManager.generateToken(process, seedId);
String token = tokenRequestBody.getToken();
if (!expectedToken.equals(token)) {
response = httpUtil.getForbiddenResponse("The token is invalid!");
return httpUtil.buildResponse(response, httpResponse);
}
Dataset dataset = availableContracts.get(contractId);

if (status.historyExists("contract-decline")) {
response = httpUtil.getForbiddenResponse("The contract for this passport has been declined!");
if (dataset == null) {
response.message = "The Contract Selected was not found!";
return httpUtil.buildResponse(response, httpResponse);
}

Expand All @@ -187,7 +184,6 @@ public Response getData(@Valid @RequestBody TokenRequest tokenRequestBody) {
response = httpUtil.getNotFound("Failed to load passport!");
return httpUtil.buildResponse(response, httpResponse);
}
Dataset dataset = processManager.loadDataset(processId);
Map<String, Object> negotiation = processManager.loadNegotiation(processId);
Map<String, Object> transfer = processManager.loadTransfer(processId);
response = httpUtil.getResponse();
Expand Down
Loading
Loading