Skip to content

Multi-tenancy example #144

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

Merged
merged 6 commits into from
Aug 5, 2024
Merged

Multi-tenancy example #144

merged 6 commits into from
Aug 5, 2024

Conversation

jonashendrickx
Copy link
Contributor

@jonashendrickx jonashendrickx commented Aug 1, 2024

This is a multi-tenancy example allowing you to use different API secrets or private API keys per subdomain.

It uses:

  • IHttpClientFactory
  • Builder design pattern to build the PasswordlessClient

For a domain passwordless.local, you would then have tenants:

  • gameofthrones.passwordless.local
  • thewalkingdead.passwordless.local

Where the tenants are:

  • gameofthrones
  • thewalkingdead

And then resolves the tenant from the incoming request using IHttpContextAccessor. And retrieves required private API key or API secret from appsettings.json accordingly.

@jonashendrickx jonashendrickx requested a review from a team as a code owner August 1, 2024 06:47
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.39%. Comparing base (075653a) to head (ccd9d8d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #144   +/-   ##
=======================================
  Coverage   61.39%   61.39%           
=======================================
  Files          43       43           
  Lines         658      658           
  Branches       56       56           
=======================================
  Hits          404      404           
  Misses        250      250           
  Partials        4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonashendrickx jonashendrickx merged commit 540def1 into main Aug 5, 2024
7 checks passed
@jonashendrickx jonashendrickx deleted the multi-tenancy-example branch August 5, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants