Skip to content

Commit

Permalink
feat: add multitenancy dashboard (#144)
Browse files Browse the repository at this point in the history
* Add tenant management page

* Fix icons

* Fetch tenants on load

* Add login methods for tenants

* Add search input component

* Integrate search component

* Add tenants not found state

* Update changelog

* Add create new tenant flow

* Change TenantManagement component to use arrow function

* Handle other errors when creating tenant

* Handle tenant row click

* Add get tenant info API

* Fetch tenant details and handle loading and error states

* Add tenant detail header

* Add core config section

* Add initial core config section

* Add toggle component

* Finish core config UI

* Wrap up the core config section

* Add first and secondary factors section UI

* Integrate adding core config

* Handle property delete

* Handle saving config properties

* Fetch core config from the API

* Integrate MFA

* Integrate see users button

* Make details page responsive

* Add warning about MFA recipe

* Handle delete tenant

* Add third party section

* Add third party provider listing section

* 'Add third-party provider configuration UI

* Add client configuration collapsible section

* Improve toggle focus visuals

* Update third party UI to work with custom fields

* Handle crud operations for built in providers

* Use core APIs for core config list

* Build custom provider UI

* Fix types

* Refactor field inputs

* Integrate custom providers section

* Add prefix to third party field

* Add additional scopes to the client config

* Handle merging providers based on different providers in core and static

* Handle no login methods state

* Show relevant errors when no login methods added

* Add dialog to prompt adding providers when none added yet.

* Add SAML provider configuration handling

* Refactor tenant API routes for core config list eg/ fetching URL change needed. Fix missing data fetch when listing tenants.

* Remove the method to read initialized recipe from window

* Show relevant errors directly from core when creating tenant

* Use tenant id from path

* Add different error states for login methods

* Move search state up the tree

* Update tenant detail and login methods API and fix type errors

* Integrate core config section

* WIP: Third party provider integration

* Merge provider forms

* Finish third party integration

* Update third party API

* Move providers list to dialog

* API updates

* Fixes for provider form

* Ask for tenantId when deleting tenant

* Add edit plugin property modal

* Use name instead of id for third party providers section

* Remove mocks for third party APIs

* Move require email outside userInfoMap

* Login methods section add API call to individual toggle

* Update example and copy for core config

* Update core config API

* Fix styling issues and removed unused components

* Revert server file

* Revert error on success in login methods

* fix: test cases for tenant management dashboard

* Update core config UI

* Fix responsiveness

* Use svg for all third party provider icons

* Review updates

* New UI for third party id suffix

* Login methods review updates and minor CSS fixes

* fix: core config

* fix: as per updated apis

* fix: multiline input for apple private key

* fix: services cleanup

* fix: create tenant

* fix: create tenant

* fix: error messages

* fix: pr comments

* fix: third party id prefix

* fix: pr comments

* fix: pr comments

* fix: error message

* 💇‍♂️ Remove body scroll from dialog, by default

* 💇‍♀️ Remove overflow from dashboard layout

* 🛠 Close modal when overlay is clicked, by default

* 💇‍♀️ Fix layout style

* 💇‍♀️ Fix tenant page responsiveness

* 💇‍♀️ Fix third-party login responsiveness

* 📝 Update changelog

* fix: remove msg

* fix: minor fixes

* fix: version update

* fix: provider form

* fix: name dropdown for boxy saml

* fix: remove openid

* fix: apple

* fix: name compulsory for custom provider

* fix: mfa override error

* fix: Convert 'select" element to 'input' element (#148)

* fix overflowing text

* Use convert select element to an input-dropdown

* Use 100% width for dropdown options

* revert changelog changes

* fix: type

* fix: scope normalisation

* fix: minor

---------

Co-authored-by: Sattvik Chakravarthy <[email protected]>
Co-authored-by: Favour Ohans <[email protected]>
Co-authored-by: Sattvik Chakravarthy <[email protected]>
  • Loading branch information
4 people authored Jul 15, 2024
1 parent 5f6c604 commit 7a9ba91
Show file tree
Hide file tree
Showing 137 changed files with 8,152 additions and 205 deletions.
61 changes: 61 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,73 @@
- [ ] Test user-defined custom email and phoneNumber validators to ensure they are working properly.
- [ ] Test AccountLinking by creating an `emailpassword` and `passwordless` user with the same email and make sure that the accounts are linked.
- [ ] User details

- [ ] Can edit email of non third party login method if there is only 1 login method for the user
- [ ] Can edit email of non third party login method if there are >= 2 login methods for the user
- [ ] Deleting a non primary login method for a user only deletes that login method, and not the whole user
- [ ] Deleting a primary login method for a user deletes only that primary login method and not the user
- [ ] Deleting a user deletes all the login methods for that user as well

- [ ] Tenant Management
- [ ] Tenant Listing page
- [ ] There should be only one tenant by default (public) and the login methods should be same as what is initialised in the SDK
- [ ] Initialise only thirdparty and emailpassword recipe and check if only emailpassword and thirdparty is shown for the public tenant
- [ ] Initialise passwordless with different contact methods and flow type and ensure the factor toggles are reflected as per what is initialised
- [ ] Create a new tenant
- [ ] Should display an error message if multitenancy license is not added to the core
- [ ] Should be able to create tenant once the multitenancy license is added to the core
- [ ] Should not be able to create tenants with some stop words like `recipe`, `config`, `hello`, `appid-t1`
- [ ] Should not be able to create tenants with special characters in the name
- [ ] When creating a tenant with capital letters, it should automatically convert to lowercase once the tenant is created
- [ ] For newly created tenant, no recipes should be enabled by default
- [ ] Creating more than 10 tenants should show pagination
- [ ] Creating existing tenant id should show an error
- [ ] Tenant search and pagination
- [ ] Should be able to search for tenants
- [ ] Tenant search should be case insensitive
- [ ] Tenant search should match if the sub-string is in the middle of the tenant name
- [ ] When tenant search matches with more than 10 tenants, pagination should still be active
- [ ] When there is a search term, click on a tenant and then come back to the tenant listing page. The search term should remain.
- [ ] Tenant details
- [ ] The whole tenant row must be clickable and on click should take to tenant details page
- [ ] Create some users for the tenant and ensure user count matches
- [ ] See users button must take you to users listing page with the tenant selected on a new window
- [ ] Should see a warning when no login methods are enabled
- [ ] Enabled login methods
- [ ] Should be able to toggle only login methods based on the initialised recipes
- [ ] if only thirdparty and emailpassword recipe is initialised, should not be able to turn on any of the passwordless login methods (otp-phone, otp-email, etc)
- [ ] if passwordless is initialised with contact method email only, should not be able to turn on otp-phone, link-phone
- [ ] should be able to turn off all login methods
- [ ] Secondary login methods
- [ ] With mfa not initialised, should not be able to turn on any secondary login methods
- [ ] Should be able to toggle only login methods based on initialised recipes
- [ ] If passwordless is not initialised, should not be able to turn on otp-phone
- [ ] If totp is not initialised, should not be able to turn on totp
- [ ] If passwordless is initialised with contact method email only, should not be able to turn on otp-phone
- [ ] Once all the recipes are initialised, should be able to turn on/off all the secondary login methods
- [ ] Social/Enterprise logins
- [ ] This section should not be visible if thirdparty login method is turned off
- [ ] This section should be visible if thirdparty login method is turned on
- [ ] With static provider list
- [ ] The static provider list should show up by default for all the tenants
- [ ] Should be able to delete third party providers from static list
- [ ] When deleting the last one, thirdparty should get disabled
- [ ] When there are no providers for a tenant, when turning on thirdparty login method, a popup to add a third party provider should be shown
- [ ] For creating Enterprise providers, there should be an additional step where the user has to provide directoryId or okta domain, etc. When a valid value is entered, the OIDC endpoint and other endpoints should be populated automatically.
- [ ] If directoryId or okta domain is invalid, appropriate error message should be shown
- [ ] In the thirdparty form, all the fields should be editable and persist correctly. Change every field, save and then go into edit mode again and check if the change has been persisted correctly.
- [ ] Should be able to add all built-in providers. When adding provider, check relavant fields are already populated, like OIDC endpoint, authorization endpoint, token endpoint, etc.
- [ ] Clients list
- [ ] Should be able to add / remove clients in any order
- [ ] Client Type should be required whenever there are more than 1 clients
- [ ] Minimum one client should be required
- [ ] Should not be able to save when required fields are not filled
- [ ] Fake email generation
- [ ] Should ask for fake email generation when `Sometimes` option is selected for `How often does the provider return email?`
- [ ] Should not ask for fake email generation when `Always` option is selected for `How often does the provider return email?`
- [ ] Should not ask for fake email generation when `Never` option is selected for `How often does the provider return email?`
- [ ] Select never option and save the provider. Come back into edit mode of this, we should see that the option is `Sometimes` and the fake email generation is set to true

## Documentation changes

(If relevant, please create a PR in our [docs repo](https://github.com/supertokens/docs), or create a checklist here highlighting the necessary changes)
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.12.0]

- Adds Multitenancy support to the dashboard

## [0.11.2] - 2024-05-23

- Fixes link to swaggerhub for create new user popup
Expand Down
15 changes: 15 additions & 0 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"static/js/787.bundle.js": "/static/js/787.bundle.js",
"static/media/auth-background.png": "/static/media/auth-background.png",
"static/media/auth-background-portrait.png": "/static/media/auth-background-portrait.png",
"static/media/provider-bitbucket.png": "/static/media/provider-bitbucket.png",
"static/media/favicon.ico": "/static/media/favicon.ico",
"static/media/ST_icon_light_theme.svg": "/static/media/ST_icon_light_theme.svg",
"static/media/ST_full_logo_dark_theme.svg": "/static/media/ST_full_logo_dark_theme.svg",
Expand All @@ -13,18 +14,29 @@
"static/media/ST_full_logo_light_theme.svg": "/static/media/ST_full_logo_light_theme.svg",
"static/media/ST_icon_dark_theme.svg": "/static/media/ST_icon_dark_theme.svg",
"static/media/auth-method.svg": "/static/media/auth-method.svg",
"static/media/provider-okta.svg": "/static/media/provider-okta.svg",
"static/media/no-tenants.svg": "/static/media/no-tenants.svg",
"static/media/logo.svg": "/static/media/logo.svg",
"static/media/plus-square.svg": "/static/media/plus-square.svg",
"static/media/roles-and-permissions.svg": "/static/media/roles-and-permissions.svg",
"static/media/no-results.svg": "/static/media/no-results.svg",
"static/media/question-mark.svg": "/static/media/question-mark.svg",
"static/media/help-circle.svg": "/static/media/help-circle.svg",
"static/media/info-icon.svg": "/static/media/info-icon.svg",
"static/media/email.svg": "/static/media/email.svg",
"static/media/user-managment.svg": "/static/media/user-managment.svg",
"static/media/lock.svg": "/static/media/lock.svg",
"static/media/checkmark-green.svg": "/static/media/checkmark-green.svg",
"static/media/plus.svg": "/static/media/plus.svg",
"static/media/green-check.svg": "/static/media/green-check.svg",
"static/media/tenant-management.svg": "/static/media/tenant-management.svg",
"static/media/close-inactive.svg": "/static/media/close-inactive.svg",
"static/media/close-active.svg": "/static/media/close-active.svg",
"static/media/clear.svg": "/static/media/clear.svg",
"static/media/provider-apple.svg": "/static/media/provider-apple.svg",
"static/media/provider-discord.svg": "/static/media/provider-discord.svg",
"static/media/edit-unfilled.svg": "/static/media/edit-unfilled.svg",
"static/media/provider-linkedin.svg": "/static/media/provider-linkedin.svg",
"static/media/search.png": "/static/media/search.png",
"static/media/phone-no.svg": "/static/media/phone-no.svg",
"static/media/provider-google.svg": "/static/media/provider-google.svg",
Expand All @@ -38,6 +50,7 @@
"static/media/edit-login-method.png": "/static/media/edit-login-method.png",
"static/media/mail.svg": "/static/media/mail.svg",
"static/media/lock-opened.svg": "/static/media/lock-opened.svg",
"static/media/provider-twitter.svg": "/static/media/provider-twitter.svg",
"static/media/eye.svg": "/static/media/eye.svg",
"static/media/envelope-green.svg": "/static/media/envelope-green.svg",
"static/media/delete.svg": "/static/media/delete.svg",
Expand All @@ -51,6 +64,7 @@
"static/media/copy.svg": "/static/media/copy.svg",
"static/media/delete-login-method.png": "/static/media/delete-login-method.png",
"static/media/close-icon.svg": "/static/media/close-icon.svg",
"static/media/provider-gitlab.svg": "/static/media/provider-gitlab.svg",
"static/media/edit.svg": "/static/media/edit.svg",
"static/media/right_arrow_icon.svg": "/static/media/right_arrow_icon.svg",
"static/media/trash.svg": "/static/media/trash.svg",
Expand All @@ -65,6 +79,7 @@
"static/media/arrow-down.svg": "/static/media/arrow-down.svg",
"static/media/hamburger-menu.svg": "/static/media/hamburger-menu.svg",
"static/media/provider-facebook.svg": "/static/media/provider-facebook.svg",
"static/media/provider-active-directory.svg": "/static/media/provider-active-directory.svg",
"static/media/Union-yellow.png": "/static/media/Union-yellow.png",
"static/media/Union.png": "/static/media/Union.png",
"static/media/checkmark-yellow.svg": "/static/media/checkmark-yellow.svg",
Expand Down
4 changes: 2 additions & 2 deletions build/static/css/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/css/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/bundle.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions build/static/media/close-active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions build/static/media/close-inactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build/static/media/edit-unfilled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions build/static/media/help-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build/static/media/info-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7a9ba91

Please sign in to comment.