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

Policy Seeding Data Update 24.05. Scope #25

Open
jjeroch opened this issue Feb 7, 2024 · 2 comments · Fixed by #88
Open

Policy Seeding Data Update 24.05. Scope #25

jjeroch opened this issue Feb 7, 2024 · 2 comments · Fixed by #88
Assignees

Comments

@jjeroch
Copy link
Contributor

jjeroch commented Feb 7, 2024

Summary

Update policy hub seeding data to the latest and greatest policy definition.
Following changes are needed

  • seeding data structure
  • new seeding data to be added
  • seeding data to be deleted
  • policy structure to be updated
  • seeding data mapping into the policy structure to be updated for framework agreement


Details

The policy namespaces (leftOperand and rightOperand values) got recently updated and need to get adjusted for the policy hub

Membership
this new structure has a direct impact on the following endpoints

  • GET /api/policy-hub/policy-content
  • POST /api/policy-hub/policy-content
{
  "constraint": {
    "leftOperand": "cx-policy:Membership",
    "operator": "eq",
    "rightOperand": "active"
  }
}

Dismantler
this new structure has a direct impact on the following endpoints

  • GET /api/policy-hub/policy-content
  • POST /api/policy-hub/policy-content
{
  "constraint": {
    "leftOperand": "cx-policy:Dismantler",
    "operator": "eq",
    "rightOperand": "active"
  }
}

Dismantler with Brand
this new structure has a direct impact on the following endpoints

  • GET /api/policy-hub/policy-content
  • POST /api/policy-hub/policy-content
{
  "constraint": {
    "leftOperand": "cx-policy:Dismantler.allowedBrands",
    "operator": "in",
    "rightOperand": [
      "Brand A",
      "Brand B"
    ]
  }
}

Framework Credential
this new structure has a direct impact on the following endpoints

  • GET /api/policy-hub/policy-content
  • POST /api/policy-hub/policy-content
{
  "constraint": {
    "leftOperand": "cx-policy:FrameworkAgreement",
    "operator": "eq",
    "rightOperand": "[subtype]:[version]"
  }
}

*note; the sub-type is the UseCase such as "traceability", "pcf", etc.


Purpose
this new structure has a direct impact on the following endpoints

  • GET /api/policy-hub/policy-content
  • POST /api/policy-hub/policy-content
{
  "constraint": {
    "leftOperand": "cx-policy:UsagePurpose",
    "operator": "eq",
    "rightOperand": "cx.core.[string]:[version]"
  }
}

Result of the policy with the specific data

Framework - example traceability

{
  "constraint": {
    "leftOperand": "cx-policy:FrameworkAgreement",
    "operator": "eq",
    "rightOperand": "traceability:1.0"
  }
}

NEW Policy Attribute(s)

for the frameworkAgreement we need to add the following sub-types

  • CircularEconomy
    => technicalKey: FrameworkAgreement
    => value: circulareconomy
    => version: 1.0

  • DemandCapacity
    => technicalKey: FrameworkAgreement
    => value: demandcapacity
    => version: 1.0

  • Puris => version "1.0"
    => technicalKey: FrameworkAgreement
    => value: puris
    => version: 1.0

  • BusinessPartner => version "1.0"
    => technicalKey: FrameworkAgreement
    => value: businesspartner
    => version: 1.0

TO BE REMOVED Policy Attribute(s)

following policies need to get removed

  • Framework resilience
  • Framework sustainability
@jjeroch jjeroch added enhancement New feature or request and removed enhancement New feature or request labels Feb 7, 2024
@jjeroch jjeroch assigned AnuragNagpure and unassigned Phil91 Mar 12, 2024
@jjeroch
Copy link
Contributor Author

jjeroch commented Mar 14, 2024

@AnuragNagpure note that I enhanced the new attribute value details ++ the info that the seeding data will also need to get updated.

@Phil91
Copy link
Member

Phil91 commented Apr 17, 2024

@AnuragNagpure

remove FrameworkAgreement... from Policies
Add one FrameworkAgreement policy

assign all useCases to the framework policy
add for all previous existing frameworks an attribute with the value after FrameworkAgreement. and add the version
example: FrameworkAgreement.behavioraltwin = behavioraltwin:1.0

for traceability there need to be the versions 1.0, 1.1 & 1.2 that means 3 entries in the attribute table
create a new table policy_attribute_assigned_use_cases with a link from policy_attribute to use_case (relation between the tables is many to many)
to create the table a new migration is needed. please add seeding for this new table

/cc @jjeroch

@ntruchsess ntruchsess linked a pull request Apr 23, 2024 that will close this issue
7 tasks
Phil91 added a commit to catenax-ng/tx-policy-hub that referenced this issue Apr 25, 2024
Phil91 added a commit to catenax-ng/tx-policy-hub that referenced this issue Apr 25, 2024
Phil91 added a commit to catenax-ng/tx-policy-hub that referenced this issue Apr 26, 2024
Phil91 added a commit that referenced this issue Apr 26, 2024
Refs: #25
Reviewed-by: Phil Schneider <info@philschneider.de>
Co-authored-by: Phil Schneider <info@philschneider.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: IN REVIEW
Development

Successfully merging a pull request may close this issue.

3 participants