Skip to content
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

feat: multitenancy dashboard #1004

Merged
merged 29 commits into from
Jul 9, 2024
Merged

feat: multitenancy dashboard #1004

merged 29 commits into from
Jul 9, 2024

Conversation

sattvikc
Copy link
Collaborator

@sattvikc sattvikc commented Jul 1, 2024

Summary of change

(A few sentences about this PR)

Related issues

  • Link to issue1 here
  • Link to issue1 here

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your
changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here
highlighting the necessary changes)

Checklist for important updates

  • Changelog has been updated
    • If there are any db schema changes, mention those changes clearly
  • coreDriverInterfaceSupported.json file has been updated (if needed)
  • pluginInterfaceSupported.json file has been updated (if needed)
  • Changes to the version if needed
    • In build.gradle
  • If added a new paid feature, edit the getPaidFeatureStats function in FeatureFlag.java file
  • Had installed and ran the pre-commit hook
  • If there are new dependencies that have been added in build.gradle, please make sure to add them
    in implementationDependencies.json.
  • Update function getValidFields in io/supertokens/config/CoreConfig.java if new aliases were added for any core config (similar to the access_token_signing_key_update_interval config alias).
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the
      latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.
  • If added a foreign key constraint on app_id_to_user_id table, make sure to delete from this table when deleting the user as well if deleteUserIdMappingToo is false.

Remaining TODOs for this PR

  • Item1
  • Item2

@sattvikc sattvikc self-assigned this Jul 1, 2024
return;
if (apiKey == null) {
// API Key may also be passed via authoriation header
final String AUTH_HEADER = "Authorization";
Copy link
Contributor

Choose a reason for hiding this comment

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

change CDI spec to have authorization bearer instead of api-key

@@ -97,9 +97,12 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I
try {
TenantIdentifier tenantIdentifier = getTenantIdentifier(req);
Storage storage = getTenantStorage(req);

io.supertokens.webserver.api.emailpassword.Utils.checkIfEmailPasswordIsEnabledForTenant(main, tenantIdentifier, getVersionFromRequest(req));
Copy link
Contributor

Choose a reason for hiding this comment

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

rename check.. to assert...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

try {
Multitenancy.saveWebsiteAndAPIDomainForApp(storage, appIdentifier, websiteDomain, apiDomain);
} catch (Exception e) {
// ignore errors
Copy link
Contributor

Choose a reason for hiding this comment

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

some logging

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1 @@
{"tenantId":"t1","cv":"v2","uv":"v2","cbody":{"firstFactors":["emailpassword","custom"],"requiredSecondaryFactors":["emailpassword","custom"]},"ubody":{"firstFactors":["emailpassword","custom"],"requiredSecondaryFactors":["emailpassword","custom"]},"tenantState":{"tenantId":"t1","emailPasswordEnabled":true,"passwordlessEnabled":true,"thirdPartyEnabled":true,"firstFactors":["emailpassword","custom"],"requiredSecondaryFactors":["emailpassword","custom"]},"g4":{"emailPasswordEnabled":true,"thirdPartyEnabled":false,"passwordlessEnabled":false},"g5":{"emailPasswordEnabled":true,"thirdPartyEnabled":true,"passwordlessEnabled":true,"firstFactors":["emailpassword","custom"],"requiredSecondaryFactors":["emailpassword","custom"]},"gv2":{"firstFactors":["emailpassword","custom"],"requiredSecondaryFactors":["emailpassword","custom"]},"invalidConfig":false}
Copy link
Contributor

Choose a reason for hiding this comment

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

add readme to this folder explaining what this is and add the script to generate this as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@sattvikc sattvikc changed the base branch from 9.1 to 9.0 July 9, 2024 07:05
@sattvikc sattvikc changed the base branch from 9.0 to 9.1 July 9, 2024 07:28
@sattvikc sattvikc merged commit d7789ca into 9.1 Jul 9, 2024
2 of 3 checks passed
@sattvikc sattvikc deleted the feat/mt-dashboard branch July 9, 2024 10:19
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.

3 participants