Skip to content

Feat/policy import extension - #19

Open
gostev-p wants to merge 39 commits into
developfrom
feat/policy-import-extension
Open

gostev-p wants to merge 39 commits into
developfrom
feat/policy-import-extension

Conversation

@gostev-p

@gostev-p gostev-p commented Nov 9, 2026

Copy link
Copy Markdown

WHAT

Neue Integration des Construct-X Policy Hubs als Quelle für ODRL-Policies auf der Provider-Controlplane:

  • Neues Modul policy-hub-client:

    • POST /v1alpha/policyhub/policies/{hubPolicyId}/import importiert eine Policy vom Hub und speichert sie unter der Hub-UUID (idempotent)
    • Ein Sync-Mechanismus hält importierte Policies aktuell — läuft automatisch periodisch (Standard: stündlich) und kann jederzeit zusätzlich manuell und synchron über POST /v1alpha/policyhub/policies/sync ausgelöst werden (z. B. für Tests/Ops, ohne auf das nächste Intervall zu warten); beide Wege nutzen dieselbe Sync-Logik (Change-Detection per Hash, Backoff/Outage-Handling bei Nichterreichbarkeit bzw. abgelehnten Credentials, nichts wird gelöscht)
    • Konfigurierbar über constructx.policyhub.*, Credentials aus dem Vault
  • Neues Modul con-x-policy, ersetzt CxPolicyExtension:

    • Validiert und wertet die vom Policy Hub tatsächlich ausgelieferten ODRL-Policies korrekt aus (Datumsconstraints mit bare ISO dates, versionslose FrameworkAgreement, constraint-freie Contract-Policies, UsagePurpose im Katalog-Scope)
    • Neue Constraint-Funktionen ConnectorConstraintFunction (Participant Selection) und DataSubset
    • Unterstützung für basic-abac-Credential-Attribute und verschachtelte and/or-Constraints

WHY

Policies können weiterhin manuell auf dem Connector angelegt werden; zusätzlich gibt es jetzt die Möglichkeit, Policies direkt aus dem Policy Hub zu importieren. Die bestehende Catena-X-Policy-Validierung (CxPolicyExtension) lehnt die vom Hub tatsächlich erzeugten Policies (constraint-freie Policies, versionslose FrameworkAgreement,
Participant-Selection-Constraint, DataSubset, bare-date-Formate) ab bzw. wertet sie nicht aus — ohne diese Erweiterungen wären importierte Hub-Policies auf dem Connector weder erstellbar noch korrekt wirksam.

FURTHER NOTES

  • CxPolicyExtension wird in den Construct-X-Controlplane-Distributionen per ExcludingServiceFileTransformer aus dem Service-Loader-File entfernt, damit ConxPolicyExtension nicht zusätzlich, sondern anstelle davon läuft
  • Neue Bruno-Collection con-x-policy-hub-import, getrennt von con-x-local-test, um Merge-Konflikte mit parallelen Änderungen an der bestehenden Testbed-Collection zu vermeiden
  • Bekanntes Upstream-Problem dokumentiert (nicht durch diese PR verursacht): Multi-Value-Right-Operands (isAnyOf) werden als kaputter Java-toString()-Dump statt JSON-Array zurückgegeben (tractusx-edc#3043)

Closes #

gostev-p and others added 30 commits August 28, 2026 12:59
…constraint) and fix NullPointerException in CatalogPolicyContext
…t semantics and allow constraint-free CONTRACT policies
…id in responses and improve private property handling
…E in catalog generation, and relax constraint checks for CONTRACT policies
Conflict resolution:
- con-x controlplane distributions: take develop's dependency set
  (retirement-evaluation-bootstrapping, dynamic-issuers, basic-abac,
  Jackson hotfixes; control-plane-migration/tx-dcp dropped as in develop)
  plus con-x-policy, bpn-validation, bdrs-client and the
  ExcludingServiceFileTransformer.
- libs.versions.toml: keep develop's catalog plus edc-spi-validator; drop the
  duplicate edc-controlplane-transform alias in favour of the existing
  edc-transform-controlplane (policy-hub-client updated accordingly).
- local docker-compose: drop default-scopes.test settings as in develop, keep
  BDRS dummy URL and Policy Hub settings.
- bruno: keep develop's con-x-local-test layout and the policy-hub-import copy.
- ConxPolicyExtension: BusinessPartnerNumberConstraintFunction no longer takes
  a BdrsClient (upstream eclipse-tractusx#2740).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSD7wNNm9Axf1uQHyxRq45
@gostev-p gostev-p self-assigned this Nov 9, 2026
@gostev-p gostev-p added the feature A new feature request label Nov 9, 2026

@eschrewe eschrewe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hallo,
siehe den Kommentar unten.

implementation(project(":edc-extensions:basic-abac"))


// Catena-X ODRL policy functions plus the Construct-X additions (DataUsageStartDate, relaxed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hallo,
wir hatten beim construct-x connector von Anfang an die bewusste Entscheidung getroffen, dass wir keine Abhängigkeiten auf die BDRS Sachen von tractus-x (bzw. catena-x) haben werden.

Das hatte ich auch in der Teams-Besprechung vom 14. Oktober mit dir und Mario nochmal deutlich betont. Deshalb muss ich leider schon an dieser Stelle die Review abbrechen, bis das geändert ist.

Falls es in Zukunft einen Bedarf dafür geben sollte, solche Dinge wie FrameworkAgreement und dergleichen aus dem catena-x Datenraum hier bei construct-x nachzubilden (was nach meiner Kenntnis bisher von niemandem so beschlossen wurde) lässt sich das nach meiner Einschätzung ziemlich gut über die basic-abac extension lösen.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danke für den Hinweis, das hatte ich übersehen.
Ist umgesetzt:

  • Keine BDRS/BPN-Abhängigkeiten mehr: bdrs-client und bpn-validation sind aus con-x-policy und beiden Distributionen entfernt. Die SPI-Module, die das unveränderte cx-policy mitbringt, sind per exclude aus dem Runtime-Classpath genommen. Das Jar enthält keine BDRS/BPN-Klassen mehr.
  • BusinessPartnerGroup/BusinessPartnerNumber werden nicht registriert und vom Validator abgelehnt, connector arbeitet nur noch mit DIDs.
  • Deinen Vorschlag mit basic-abac habe ich für Membership übernommen: Es wird jetzt über ConstructXMembershipCredential.credentialSubject.isMember ausgewertet statt über das Catena-X-Credential.

Offene Frage: Der Policy Hub gibt weiterhin Catena-X-Operanden aus (FrameworkAgreement, UsagePurpose …). Damit dessen Policies importierbar bleiben, akzeptiert con-x-policy sie noch. Für FrameworkAgreement gibt es kein Construct-X-Credential, auf das man über basic-abac abbilden könnte. Wie wollen wir damit umgehen?

@gostev-p gostev-p removed the feature A new feature request label Nov 12, 2026
Construct-X deliberately does not depend on the Catena-X BDRS/BPN
infrastructure. con-x-policy and both con-x control plane distributions
no longer pull in bpn-validation and bdrs-client:

- ConxPolicyExtension no longer injects BdrsClient/BusinessPartnerStore
  and does not register BusinessPartnerGroup/BusinessPartnerNumber
- the validator rejects both BPN left operands
- ConnectorConstraintFunction only accepts DID identities, no BPN-to-DID
  resolution via BDRS
- drop the dummy tx.edc.iam.dcp.bdrs.server.url from the testbed
Upstream's Membership constraint requires a Catena-X MembershipCredential,
which Construct-X participants do not hold, so it could never pass.
ConxMembershipConstraintFunction (subclass of the unmodified upstream
function) keeps the left/right operand handling, so Policy Hub policies with
a MEMBERSHIP constraint stay importable unchanged, but evaluates
ConstructXMembershipCredential.credentialSubject.isMember eq true through the
basic-abac extension. As the basic-abac default credential it is presented in
every request, including the catalog.

FrameworkAgreement and Dismantler keep the upstream evaluation: there is no
Construct-X credential that basic-abac could check instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants