Skip to content

feat(EDR): adds EDR state machine for handling EDR renewal#620

Merged
wolf4ood merged 4 commits intoeclipse-tractusx:mainfrom
wolf4ood:feat/600_auto_renewal_edr
Jul 20, 2023
Merged

feat(EDR): adds EDR state machine for handling EDR renewal#620
wolf4ood merged 4 commits intoeclipse-tractusx:mainfrom
wolf4ood:feat/600_auto_renewal_edr

Conversation

@wolf4ood
Copy link
Copy Markdown
Contributor

@wolf4ood wolf4ood commented Jul 17, 2023

WHAT

Implements a state machine for EDR renewal. Once an EDR is first negotiated the state machine will boostrap the
cached entry with a Negotiated state.

The state machine is composed by the following states:

  • Negotiated the primordial state. The EDR has been negotiated with the provided and stored in the EDR store
  • Refreshing the EDR is about to expire and another transfer process has been started for negotiating another EDR token with the same parameters
  • Expired: Once a new EDR is negotiated the old one is marked as Expired waiting for deletion
  • Deleting: Once the the retention period is expired EDR are marked as deleting

The EDR cached entry gets deleted by picking from the state machine the one that are in Deleting state.

WHY

User experience. Once the first Negotiate EDR request has been fulfill the EDR extension will ensure to renew automatically the EDR token before it expires.

FURTHER NOTES

Also in this PR the E2E test based on PostgreSQL has been moved to testcontainers. When wi will upgrade to EDC > 0.1.3
we could also leverage to the refactored PostgresqlStoreSetupExtension that uses testcontainers as well for testing the EDR storage.

Also in this PR for supporting testcontainers I've created a TxPostgresqlLocalInstance copy of the upstream one. It's mark for removal once we upgrade to the next EDC version.

Closes #600

@wolf4ood wolf4ood force-pushed the feat/600_auto_renewal_edr branch 17 times, most recently from 2231e34 to c34ca18 Compare July 19, 2023 06:28
@wolf4ood wolf4ood marked this pull request as ready for review July 19, 2023 06:45
@wolf4ood wolf4ood force-pushed the feat/600_auto_renewal_edr branch 6 times, most recently from 9ea3e14 to 1c4b1d8 Compare July 19, 2023 16:02
@wolf4ood wolf4ood requested a review from ndr-brt July 19, 2023 17:34
@wolf4ood wolf4ood force-pushed the feat/600_auto_renewal_edr branch from 1c4b1d8 to ac35761 Compare July 19, 2023 20:49
@paullatzelsperger
Copy link
Copy Markdown
Contributor

deployment tests will work again after #633 is merged, and this PR is rebased onto main

@wolf4ood wolf4ood force-pushed the feat/600_auto_renewal_edr branch from ac35761 to 79a582c Compare July 20, 2023 13:13
@wolf4ood wolf4ood force-pushed the feat/600_auto_renewal_edr branch from 4a02b1e to 9da1d48 Compare July 20, 2023 13:34
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wolf4ood wolf4ood merged commit 313b90b into eclipse-tractusx:main Jul 20, 2023
@wolf4ood wolf4ood deleted the feat/600_auto_renewal_edr branch July 20, 2023 13:52
RoseMgbii-b pushed a commit to RoseMgbii-b/tractusx-edc that referenced this pull request Mar 5, 2026
…ractusx#620)

* feat(EDR): adds EDR state machine for handling EDR renewal

* add testcontainers pg for E2E tests

* fix after review

* fix depedencies file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

Auto renewal of EDR tokens

3 participants