odpi / egeria-connector-ibm-information-server

IBM Information Server connectors for Egeria: repository proxy connector for IGC, data engine proxy connector for DataStage.
https://odpi.github.io/egeria-connector-ibm-information-server
Apache License 2.0
27 stars 20 forks source link

repository-services getEntityDetail is ignoring MetadataCollectionId part of GUID #557

Closed bogdan-sava closed 3 years ago

bogdan-sava commented 3 years ago

The guid path parameter is formatted like: [ IGCType ]@[ MetadataCollectionId ]:[IGC-RID]

getEntityDetail is ignoring MetadataCollectionId.

If there are 2 or more IGC proxies in the cohort, having entities with the same RID each, the first one getting the request from enterprise, will respond with the entity, but different GUID than the one from request. This behaviour makes OMRS to provide a different entity than the one requested, and the entity from the second IGC proxy unreachable from enterprise layer.

I think connector should validate toe MetadataCollectionId part from the GUID.

lpalashevski commented 3 years ago

Good catch.

The connector should only respond with the instances that are known to the specific metadata collection it represents. It makes sense to check metadata collection id because it is part of the instance identity (guid), when this part of the id does not match then from egeria perspective it is different instance. In this case we should respond with 'EntityNotKnownException' allowing federation/enterprise layer to find the matching instance comming from the correct metadata collection origin.

This also makes sense from purely REST API perspective and it should apply for all get instance by guid methods, based on the usage in the code I see the follwing:

cmgrote commented 3 years ago

Yikes, can't believe we haven't spotted this earlier! I'll have a deeper look -- should hopefully be pretty simple & straightforward to fix.