Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

feat: support multi-tenancy #70

Merged
merged 2 commits into from
Jun 14, 2021
Merged

feat: support multi-tenancy #70

merged 2 commits into from
Jun 14, 2021

Conversation

carvantes
Copy link
Contributor

Adding tenantId as a parameter across all operations and an object in FhirConfig to configure multi-tenancy

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

src/bulkDataAccess.ts Show resolved Hide resolved
src/fhirConfig.ts Show resolved Hide resolved
*/
enableMultiTenancy: true;
/**
* When enabled, the tenantId is included on the server url to make it unique for each tenant. i.e. `<baseUrl>/tenant/<tenantId>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Url length a concern? could turn "tenant" to "t"

Copy link
Contributor Author

@carvantes carvantes Jun 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that tenant/<tenantId> is more self-explanatory. Also, that's the URL pattern suggested by MEDHOST.
Shortening to t is not very impactful on the overall URL length

tenantId is restricted to max 64 chars (router enforces that). The baseUrl is an APIGW url (~60 chars).

The above numbers are small when compared to any applicable url limits.

https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html

Length, in characters, of the URL for an edge-optimized API = 8192

https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here at Black Pear we've already implemented multi-tenancy for FWoA (using a wrapper around the components). We don't use an explicit path in the url to suggest tenancy so our urls appear as:
<baseUrl>/FOO/Patient/123 (for FOO tenant).
and for the single tenant case we standardise on a tenant of fhir so the above example would be:
<baseUrl>/fhir/Patient/123
This is similar to the HAPI FHIR approach https://hapifhir.io/hapi-fhir/docs/server_plain/multitenancy.html

@carvantes carvantes requested a review from rsmayda June 8, 2021 00:48
@carvantes carvantes merged commit 416a4fa into feat-multitenancy Jun 14, 2021
@carvantes carvantes deleted the dev-tenantId branch June 14, 2021 15:37
carvantes added a commit that referenced this pull request Aug 12, 2021
* feat: support multi-tenancy (#70)
* feat: add tenantId to bundle requests (#71)
* feat: add fhirServiceBaseUrl to auth requests (#72)
* feat!: add parameters for group export (#73)

Co-authored-by: Yanyu Zheng <yz2690@columbia.edu>

BREAKING CHANGE: add required parameter allowedResourceTypes for group export
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants