Add support for Self Descriptions having type `Resource` from Trust Framework
Hey,
According to the Gaia-X Architecture Document and Trust Framework the three Gaia-X superclasses are Participant
, ServiceOffering
, and Resource
. Furthermore a Resource
can be part of a the ServiceOffering
but can also exist independently of it.
In the current implementation of the FC the class Resource
is not supported.
Since there is already a demand from the projects to model their data assets to be offered as a Resource
, I provided an implementation that allows to add Self Descriptions with @type Resource
or derived subclases of it.
I have tried to implement the extension with as few adjustments as possible, but also tried to optimize the code where possible since it was pretty hard to follow what's going on in the relevant code areas. After I've already spent a few hours on the code, I've in general the feeling, that a refactoring would make sense with respect to best-practices from Java development and Clean Code.
Summary of my changes:
- Add enum that describes the three allowed base types for VC types according to Gaia-X Trust Framework which provides type safety
- Extend the code that extracts the base class from the Claims provided in a Verifiable Credential to support the new base class
Resource
- Make code for verification of Verifiable Credentials more readable (using enum describing types, method naming, variable naming ...)
I marked this MR as a draft, since a few things were not clear to me when I was looking into the code:
- Is it really necessary to provide a way to configure the namespaces for the Gaia-X superclasses? I'd have assumed that they are kind of fixed. If so, I would recommend to just read them from the enum
TrustFrameworkBaseClass
I've introduced. - The types
Participant
andServiceOffering
are defined as coming from the Gaia-X Core Ontology by default in the application properties file (e.g. https://w3id.org/gaia-x/core#Participant). The tests use a different Ontology (e.g. http://w3id.org/gaia-x/participant#Participant) which makes it necessary to be able to configure the namespaces for the superclasses at the moment. But does this really make a sense or are the tests old relicts and the namespaces should actually be adjusted in the example Self Descriptions used for the tests?
Please let me know your thoughts on this.
Signed-off-by: Andreas Pätzold (msg DAVID GmbH) andreas.paetzold89@gmail.com