Skip to content

Commit

Permalink
feat: Changes for multitenancy dashboard (#963)
Browse files Browse the repository at this point in the history
* feat: Add an API to fetch the list of core config properties (#922)

* Add an API to fetch the coreConfig properties

* Update changelog

* Include plugin configs as well

* Remove core_config_result from the final output

* Hide protected config

* Fix formatting changes

* Add tests to ensure that the properties are same in the config and core config file

* Match descriptions from devConfig.yaml as well

* Refactor CoreConfig to return ConfigFieldInfo objects

* Refactor enum property validation

* Refactor move storage fields to API

* Refactor getConfigFieldsInfo method and update CoreConfigListAPI

* Add test to check protected properties are not present when saas secret is set

* Add comments wherever necessary

* fix: core config list

* fix: serialize nulls

* fix: is nullable

* fix: plugin configs

* fix: add new booleans for core config

* fix: cleanup

* fix: list apis

* fix: refactor config description

* fix: refactor cud tests

* fix: refactor tests

* fix: tests

* fix: type fix

* fix: flag setting for thirdparty providers

* fix: pr comments

* fix: pr comments

* fix: pr comments

* fix: pr comments

* fix: revert

* fix: tenant tests

* fix: app tests

* fix: cud tests

* fix: other tests

* fix: version and changelog

* fix: inmemory

* fix: skip deprecated

* fix: dashboard updates

* fix: minor fixes

* fix: tests

* fix: refactor

* fix: refactor

* fix: changelog

* fix: refactor

---------

Co-authored-by: Sattvik Chakravarthy <[email protected]>
Co-authored-by: Sattvik Chakravarthy <[email protected]>
  • Loading branch information
3 people authored May 24, 2024
1 parent e0a8b37 commit 563a90a
Show file tree
Hide file tree
Showing 60 changed files with 6,961 additions and 693 deletions.
36 changes: 31 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## [9.1.0] - 2024-05-24

- Adds new core API for fetching all the core properties for a tenant
- GET `/appid-<appid>/<tenantid>/recipe/dashboard/tenant/core-config`
- Deprecated the following APIs
- PUT `/recipe/multitenancy/connectionuridomain`
- GET `/recipe/multitenancy/connectionuridomain/list`
- PUT `/recipe/multitenancy/app`
- GET `/recipe/multitenancy/app/list`
- PUT `/appid-<appid>/recipe/multitenancy/tenant`
- GET `/appid-<appid>/<tenantid>/recipe/multitenancy/tenant`
- GET `/appid-<appid>/<tenantid>/recipe/multitenancy/tenant/list`
- Adds the following APIs to replace the deprecated APIs
- PUT `/recipe/multitenancy/connectionuridomain/v2`
- GET `/recipe/multitenancy/connectionuridomain/list/v2`
- PUT `/recipe/multitenancy/app/v2`
- GET `/recipe/multitenancy/app/list/v2`
- PUT `/appid-<appid>/recipe/multitenancy/tenant/v2`
- GET `/appid-<appid>/<tenantid>/recipe/multitenancy/tenant/v2`
- GET `/appid-<appid>/<tenantid>/recipe/multitenancy/tenant/list/v2`
- Backward compatible recipe enabled boolean computations based on - https://github.com/supertokens/supertokens-core/issues/979#issuecomment-2099971371

## [9.0.2] - 2024-04-17

- Fixes issue with core startup when creation of CUD/app/tenant has partial failure
Expand Down Expand Up @@ -1403,6 +1427,7 @@ This script updates the `phone_number` column in the `passwordless_users`, `pass
```sql
-- helper stored procedures
DELIMITER //
CREATE PROCEDURE st_drop_all_fkeys()
BEGIN
Expand Down Expand Up @@ -1459,7 +1484,7 @@ This script updates the `phone_number` column in the `passwordless_users`, `pass
END LOOP;
CLOSE dropCur;
END
END //
--
Expand Down Expand Up @@ -1518,7 +1543,7 @@ This script updates the `phone_number` column in the `passwordless_users`, `pass
END LOOP;
CLOSE dropCur;
END
END //
--
Expand Down Expand Up @@ -1577,7 +1602,7 @@ This script updates the `phone_number` column in the `passwordless_users`, `pass
END LOOP;
CLOSE dropCur;
END
END //
--
Expand Down Expand Up @@ -1636,7 +1661,7 @@ This script updates the `phone_number` column in the `passwordless_users`, `pass
END LOOP;
CLOSE dropCur;
END
END //
--
Expand Down Expand Up @@ -1668,8 +1693,9 @@ This script updates the `phone_number` column in the `passwordless_users`, `pass
execute add_column_sql;
SELECT 'Column Successfully Created!' INTO p_status_message;
END IF;
END
END //
DELIMITER ;
-- Drop constraints and indexes
CALL st_drop_all_fkeys();
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ compileTestJava { options.encoding = "UTF-8" }
// }
//}

version = "9.0.2"
version = "9.1.0"


repositories {
Expand Down
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ core_config_version: 0
# password_reset_token_lifetime:


# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: 86400000 (1 day)) long value. Time in milliseconds for how long an
# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: 86400000 (1 day)) long value. Time in milliseconds for how long an
# email verification token / link is valid for.
# email_verification_token_lifetime:

Expand Down Expand Up @@ -139,7 +139,7 @@ core_config_version: 0

# (OPTIONAL | Default: null). This is used when deploying the core in SuperTokens SaaS infrastructure. If set, limits
# what database information is shown to / modifiable by the dev when they query the core to get the information about
# their tenants. It only exposes that information when this key is used instead of the regular api_keys config.
# their tenants. It only exposes that information when this key is used instead of the regular api_keys config.
# supertokens_saas_secret:

# (DIFFERENT_ACROSS_APPS | OPTIONAL | Default: null). This is used when the core needs to assume a specific CDI version
Expand Down
3 changes: 2 additions & 1 deletion coreDriverInterfaceSupported.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"2.21",
"3.0",
"4.0",
"5.0"
"5.0",
"5.1"
]
}
4 changes: 2 additions & 2 deletions devConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ core_config_version: 0
# password_reset_token_lifetime:


# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: 86400000 (1 day)) long value. Time in milliseconds for how long an
# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: 86400000 (1 day)) long value. Time in milliseconds for how long an
# email verification token / link is valid for.
# email_verification_token_lifetime:

Expand Down Expand Up @@ -140,7 +140,7 @@ disable_telemetry: true

# (OPTIONAL | Default: null). This is used when deploying the core in SuperTokens SaaS infrastructure. If set, limits
# what database information is shown to / modifiable by the dev when they query the core to get the information about
# their tenants. It only exposes that information when this key is used instead of the regular api_keys config.
# their tenants. It only exposes that information when this key is used instead of the regular api_keys config.
# supertokens_saas_secret:

# (DIFFERENT_ACROSS_APPS | OPTIONAL | Default: null). This is used when the core needs to assume a specific CDI version
Expand Down
11 changes: 7 additions & 4 deletions ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,15 @@ private JsonObject getMultiTenancyStats()
}
{
boolean hasEnterpriseLogin = false;
for (ThirdPartyConfig.Provider provider : tenantConfig.thirdPartyConfig.providers) {
if (isEnterpriseThirdPartyId(provider.thirdPartyId)) {
hasEnterpriseLogin = true;
break;
if (tenantConfig.thirdPartyConfig.providers != null) {
for (ThirdPartyConfig.Provider provider : tenantConfig.thirdPartyConfig.providers) {
if (isEnterpriseThirdPartyId(provider.thirdPartyId)) {
hasEnterpriseLogin = true;
break;
}
}
}

tenantStat.addProperty("hasEnterpriseLogin", hasEnterpriseLogin);
}

Expand Down
2 changes: 1 addition & 1 deletion pluginInterfaceSupported.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"_comment": "contains a list of plugin interfaces branch names that this core supports",
"versions": [
"6.1"
"6.2"
]
}
Loading

0 comments on commit 563a90a

Please sign in to comment.