-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global caches in ProfileSupport should be tenant-specific #2802
Milestone
Comments
lmsurpre
added a commit
that referenced
this issue
Sep 27, 2021
I followed the pattern from CodeSystemSupport. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre
added a commit
that referenced
this issue
Sep 28, 2021
This test does the following: 1. create an extension definition (StructureDefinition) and a CodeSystem in the default tenant 2. invokes code that loads these conformance resources into the internal caches 3. confirms that an alternate tenant (tenant1) cannot hit those cached values Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre
added a commit
that referenced
this issue
Sep 28, 2021
This test does the following: 1. create an extension definition (StructureDefinition) and a CodeSystem in the default tenant 2. invokes code that loads these conformance resources into the internal caches 3. confirms that an alternate tenant (tenant1) cannot hit those cached values Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre
added a commit
that referenced
this issue
Sep 28, 2021
This test does the following: 1. create an extension definition (StructureDefinition) and a CodeSystem in the default tenant 2. invokes code that loads these conformance resources into the internal caches 3. confirms that an alternate tenant (tenant1) cannot hit those cached values Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre
added a commit
that referenced
this issue
Sep 28, 2021
* issue #2802 - use CacheManager for tenant-specific caches I followed the pattern from CodeSystemSupport. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * issue #2802 - add TenantIsolationTest to verify the fix This test does the following: 1. create an extension definition (StructureDefinition) and a CodeSystem in the default tenant 2. invokes code that loads these conformance resources into the internal caches 3. confirms that an alternate tenant (tenant1) cannot hit those cached values Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Moved ProfileBuilder and ExtensionBuilder to src/test I also moved the `context` field out of the ProfileBuilder constructor and into its own setter on ExtensionBuilder because this field is only applicable to extension definitions. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * Beefed up TenantIsolationTest per PR feedback I confirmed that this flavor fails before the changes to ProfileSupport and succeeds afterwards. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
QA: Passed I ran with two different datastores (Postgres and Db2). One for default and one for tenant1. Negative tests showed the only way to screw this up is to misconfigure the data store so they share the tenants share the same exact schema. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Global caches in ProfileSupport are not currently tenant-specific which means that tenant-specific profiles acquired through the ServerRegistryResourceProvider may be visible globally. Instead, these caches should be tenant-specific.
Environment
Which version of IBM FHIR Server?
To Reproduce
Steps to reproduce the behavior:
Note that the extension is validated with the constraints from tenant A even though tenant B may have a different version of the extension definition.
Expected behavior
Users on tenant B should not have visibility into any conformance resources posted to tenant A.
Additional context
Very similar to #2256.
I hope there's not more of these hiding, but we should consider advising users to avoid multiTenant deployments with serverRegistryResourceProvider enabled (unless they control who is allowed to create conformance resources).
The text was updated successfully, but these errors were encountered: