eclipse-tractusx / policy-hub

Policy Hub
Apache License 2.0
3 stars 8 forks source link

Policy Seeding Data Update 24.05. Scope #25

Closed jjeroch closed 2 weeks ago

jjeroch commented 5 months ago

Summary

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



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

{
  "constraint": {
    "leftOperand": "cx-policy:Membership",
    "operator": "eq",
    "rightOperand": "active"
  }
}

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

{
  "constraint": {
    "leftOperand": "cx-policy:Dismantler",
    "operator": "eq",
    "rightOperand": "active"
  }
}

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

{
  "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

{
  "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

{
  "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

TO BE REMOVED Policy Attribute(s)

following policies need to get removed

jjeroch commented 4 months ago

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

Phil91 commented 3 months ago

@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