Support for setting TenantInfo without using a store
Hi, I have a use-case where I have different use-cases for injecting tenant information as follows:
- For one strategy I need to access the remote store to get tenant information and this works fine
- For other strategy's I want to resolve tenant information locally (by setting the tenantInfo object based on identifier received), Ideally I don't even need a store for it and would like to just set the identifier information as received in the the tenantInfo object, because I just need to pass it on and not validate it for my use-case. I would like to avoid calling any remote stores or keeping a local info object as it will create an overhead of syncing, or doing extra calls which are not needed.
Is there a way to solve the second issue? I am pretty new to using finbuckle so I might be missing something here. Thanks Priyanka
You can write your own middleware and call TrySetTenantInfo() function attachted to HttpConntext to manually set TenantInfo or you could manually attach TenantInfo to your DbContext if you have reference to TenantInfo in your DbContext.
Hi turkysha,
I am using below modules in FinBuckle
- Strategy - Delegate Strategy - To get tenant identifier from the request URL
- Store - Http Remote Store - To get tenant details via API of an another service
While implementation I have noticed that for every incoming requests API call was initiated to get tenant details. But I am expecting as, once tenant details was retrieved it needs to be reused for upcoming requests, instead of initiating another API call for getting same tenant details.
Can you confirm,
- do I need to implement custom logic to attain this provision or
- whether this scenario can be achieved using FinBuckle?
Please share your suggestion on this requirement. Thanks in advance.
@kesavan-m-19 and @priyankasyal
Check out PR #805 if contains an echo store which is kind of a dummy store that returns a tenant info with the identifier set and no db or api calls.