Skip to content

Enhance policy imports in a way to customise the "subjects" of imported policy entries #2221

@thjaeckle

Description

@thjaeckle

Right now, Policy imports work in a way, that Policy entries from an imported policy are effectively "copied".
There is no possibility to customise an imported policy entry, concretising the "subjects" for which the entry shall be applied.

There are however use cases where this would be very useful, e.g. in order to import the resources part of a policy entry but define the subjects to be applied to this entry in the importing policy.

Example:

{
  "policyId": "org.eclipse.ditto:root-policy",
  "entries": {
    "operator": {
      "subjects": {
      },
      "resources": {
        "thing:/": {
          "grant": ["READ","WRITE"],
          "revoke": []
        }
      },
      "importable": "explicit-additional-subjects" // we could also do "implicit-additional-subjects"
    }
  }
}

The importing policy could then import the explicit policy entry as:

{
  "policyId": "org.eclipse.ditto:operator-policy",
  "imports": {
    "org.eclipse.ditto:root-policy" : {
      "entries": [ "operator" ],
      "subjects": {
        "idp:some-group": {
          "type": "Some group as defined in an IdP"
        }
      }
    }
  }
}

Or the implicit policy entry as:

{
  "policyId": "org.eclipse.ditto:operator-policy",
  "imports": {
    "org.eclipse.ditto:root-policy" : {
      "subjects": {
        "idp:some-group": {
          "type": "Some group as defined in an IdP"
        }
      }
    }
  }
}

The idea would be that this "merges" the subjects from the imported policy (if there are any) with the ones from the importing policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions