eclipse-tractusx / traceability-foss

https://eclipse-tractusx.github.io/traceability-foss/docs/
Apache License 2.0
10 stars 20 forks source link

[POLICY] Enable Policy Hub API for Policy Validation #880

Open jzbmw opened 2 months ago

jzbmw commented 2 months ago

As Trace-X User , I want technical support in creating an asset , so that only correct data assets are being generated .

Hints / Details

Acceptance Criteria

{{baseUrl}}/api/policy-hub/policy-types
{{baseUrl}}/api/policy-hub/policy-types?type=Access :: filter for constraints valid for access policy 
{{baseUrl}}/api/policy-hub/policy-types?useCase=Traceability Get PolicyTypes With UseCase Filter
Key Attribute in Policy View Description
technicalKey LeftOperand Technical key represents LeftOperand of policy iin ordl format
type Access or Usage policy Type of the policy
description description Description used as tooltip
useCase useCase useCase in which operands are valid
attribute RightOperand Validation pattern or value range to be used

E.g. BPN

{
        "technicalKey": "BusinessPartnerNumber",
        "type": [
            "Access",
            "Usage"
        ],
        "description": "...",
        "useCase": [
            "Traceability",
            "Quality",
            "PCF",
            "Behavioraltwin",
            "Sustainability"
        ],
        "attribute": [
            {
                "key": "Regex",
                "value": "^BPNL[\\w|\\d]{12}$"
            }
        ],
        "technicalEnforced": true
    },

E.g. Membership

 {
        "technicalKey": "Membership",
        "type": [
            "Access",
            "Usage"
        ],
        "description": "The membership credential can get used to ensure that only CX members are allowed to view or negotiate the respective data offer.",
        "useCase": [
            "Traceability",
            "Quality",
            "PCF",
            "Behavioraltwin",
            "Sustainability"
        ],
        "attribute": [
            {
                "key": "Static",
                "value": "active"
            }
        ],
        "technicalEnforced": true
    },

FrameworkAgreement.traceability

 {
        "technicalKey": "FrameworkAgreement.traceability",
        "type": [
            "Usage"
        ],
        "description": "With the Framework Credential, only those participants which have signed the respective framework agreement (general or via a specific version) are allowed to view or negotiate the respective data offer. Generic: \"rightOperand\": \"active\"; specific \"rightOperand\": \"active:{version}\"",
        "useCase": [
            "Traceability"
        ],
        "attribute": [
            {
                "key": "Version",
                "value": "1.0"
            },
            {
                "key": "Version",
                "value": "1.1"
            },
            {
                "key": "Version",
                "value": "1.2"
            }
        ],
        "technicalEnforced": true
    },

Out of Scope

ds-mwesener commented 1 week ago

Hi @mkanal here we need a seperate frontend story.