ADR: Partion Service as a TenantInfo provider
- Under review
Currently, CSPs have their own implementation of retrieving the TenantInfo data:
- AWS. https://community.opengroup.org/osdu/platform/system/lib/cloud/aws/os-core-lib-aws/-/blob/master/src/main/java/org/opengroup/osdu/core/aws/multitenancy/TenantFactory.java
- Azure. https://community.opengroup.org/osdu/platform/system/lib/cloud/azure/os-core-lib-azure/-/blob/master/src/main/java/org/opengroup/osdu/azure/multitenancy/TenantFactoryImpl.java
- IBM. https://community.opengroup.org/osdu/platform/system/lib/cloud/ibm/os-core-lib-ibm/-/blob/master/src/main/java/org/opengroup/osdu/core/ibm/multitenancy/TenantFactory.java
All implementations follow a similar way to retrieve the TenantInfo from the Partition service (request partition service->map to TenantInfo class; calls to the Partition service are cached).
Implement a common approach to retrieve the TenantInfo data and use it across all services.
Unify an approach of retrieving TenantInfo and using it across all services:
- Implement a common tenant factory (ITenantFactory) on the core-lib level.
- Remove CSP-specific implementations of the TenantFactory.
- Some CSPs will require to restructure a code and implement missing interfaces (in fact, the code is already there):
- IBM should implement IServiceAccountJwtClient explicitly. There is already a similar method in the TenantFactory implementation.
Outcome of the Decision (added by @rostislav.dublin on May 24):
Each CSP injects the above single common implementation in its CSP library, removing its own implementation. Everyone moves at their own pace, no one rushes anyone. E.g. GCP uses AbstractFactoryBean as shown here.
This change unifies an approach of retrieving tenant information, which is used to separate tenants from each other (multitenancy). With the increased maintainability of the code, OSDU will have a unified basic data to implement multitenancy
Simplified CSP-specific code and code generalization (higher maintainability and reusability).