question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: for controllers/services that don't need tenant. How to bypass the tenant validation

See original GitHub issue

For some controllers, (e.g. /v1/tenants/create) we don’t have the tenant id yet, because in this case, for example, they are actually creating a new tenant.

We were trying not to set the X-TENANT-ID as null or something just for the sake of it. Is there a way to for certain controllers to bypass the validator? We studied rolling out our own validation, but if/before we do that, I thought it would be better to ask. 😃

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
samuelparescommented, Aug 3, 2022

Perhaps in this case, the module associated with your route /v1/tenants/create should not import TenancyModule or any other module that imports it. Then you can just create a new mongoose connection, do stuffs you need and close it, or even use the default MongooseModule to connect to a predefined database and inject models in your services. I speak from experience, since I’m doing the same thing you are trying to. With this PR, what would happen with a skipped route that has some service that injects a model using InjectTenancyModel?

1reaction
AdamJessopcommented, Jun 24, 2022

That PR above will get the ball rolling I guess.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get TenantInfo in OnConfiguring method of ... - GitHub
I am using separate databases for each tenant and I am following the docs here. I can't make it work to have TenantInfo...
Read more >
Azure Active Directory Pass-through Authentication: Quickstart
This article describes how to get started with Azure Active Directory (Azure AD) Pass-through Authentication.
Read more >
5 Problems With Tenant Screening Services - RentPrep
There are hundreds of tenant screening services to choose from and it can be overwhelming. In this post we will break down the...
Read more >
Overriding Service DTOs : Remove properties #944
Tenants.Default)] public class TenantAppService : SaasHostAppServiceBase, ... Tricky part is I don't want to extend DTO, I want to remove properties
Read more >
Anonymous Aware Middleware with Endpoint Routing and ...
If we don't have enough path parts (at least 2) after removing the we return ... The first of these is expected to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found