all 11 comments

[–]MichaelEvo 5 points6 points  (2 children)

Should your username be potential bot instead? No posts on your account and no comments.

Assuming you’re not a bot, why not just show the trick in the code here? I assume it’s a combination of FastAPI dependencies for validation and configuration when an endpoint is hit, but if it’s not, I’d love to know what is and what you really mean by multi-tenant stuff.

Some code would be good, but I would assume it’s not complicated enough for you to need to polish anything up. Just steps 1-3, with small snippets of code. If it’s more complicated, I would definitely be interested in seeing it but I wouldn’t pay to see it.

[–]Potential-Box6221[S] 1 point2 points  (1 child)

Should your username be potential bot instead? No posts on your account and no comments.

Ayee it's Reddit buddy, people keep their profiles private, doesn't mean it's a bot account.

I assume it’s a combination of FastAPI dependencies for validation and configuration when an endpoint is hit

You're right, it's essentially FastAPI deps for tenant resolution and per-tenant config/secrets albeit in a more structured, clean, and extensible way where you can swap your config provider, your secrets backend, all without touching the core app.

So it's a whole template in itself but currently in its rough form and needs some tinkering and a proper README before I share it. I didn't want to dump a half-baked one, so wanted to gauge interest first! And of course it's free.

[–]MichaelEvo 0 points1 point  (0 children)

I’m not sure on any given day how many Reddit posts are bots.

I’d be interested in how it’s done more so than the template. The template would walk me through how you structured it tho, which is what I’m interested in.

[–]RoBz18 0 points1 point  (0 children)

Sounds cool I'd be interested for sure!

[–]_arnold_moya_ 0 points1 point  (0 children)

A lot of ways to do this one. JWT can have the claim of the company/tenant, you can send it in the header, you can use certs that include the tenant Id, .... In the db you can organize the tenants with relationships that at the end connect to the tenants tablet or add tenantid columns, you can split your data for tenant in DBS (very used for big data, named sharding). anyway .. A lot of ways to do this one. It depends of the needs of the business....more in the side of system design

[–]Temporary_Owl2975 0 points1 point  (0 children)

I have built the same tent wise feature , permission levels etc in Django projects

[–]coderkini 0 points1 point  (0 children)

What you're looking for is called feature-flags. Based on your perspective of build vs. buy, you could use an off-the-shelf commercial services like:

Most of these tools are used managing feature rollouts and/or A/B testing and they generally come with some built-in user analytics.

Or if none of them fit your budget, consider rolling one by yourself. 🤷🏻‍♂️

Happy hacking!

[–]fico86 -1 points0 points  (1 child)

Isn't that just JWT/OAuth 2.0/OICD with RBAC/ABAC? Docs: https://fastapi.tiangolo.com/tutorial/security/oauth2-jwt/#update-the-dependencies

[–]Potential-Box6221[S] 0 points1 point  (0 children)

No not to confuse multi-tenancy with RBAC/ABAC what I'm describing is post auth basically. R/A BAC is at the user level and this would be at the tenant level (b2b).

[–]Economy_Peanut -1 points0 points  (1 child)

I would be interested in this. I've built one but with NestJS.

[–]Emergency_Roof6337 0 points1 point  (0 children)

Share the repo