diff --git a/CHANGELOG.md b/CHANGELOG.md index e98541b..3a690b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,23 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [7.1.1] - 2024-06-29 + +- Fixes issue where `is_third_party_providers_null` is added to the `tenant_configs` table. + +### Migration + +```sql +ALTER TABLE tenant_configs DROP COLUMN is_third_party_providers_null; +``` + ## [7.1.0] - 2024-05-24 +- Compatible with plugin interface version 6.2 - Adds implementation for a new method `getConfigFieldsInfo` to fetch the plugin config fields. -- Adds `null` state for `firstFactors` and `providers` by adding `is_first_factors_null` - and `is_third_party_providers_null` fields in `tenant_configs` table +- Adds `DashboardInfo` annotations to the config properties in `PostgreSQLConfig` +- Adds `null` state for `firstFactors` by adding `is_first_factors_null` field in `tenant_configs` table. The value of + this column is only applicable when there are no entries in the `tenant_first_factors` table for the tenant. ### Migration diff --git a/build.gradle b/build.gradle index 3776b0c..af9bc2f 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java-library' } -version = "7.1.0" +version = "7.1.1" repositories { mavenCentral() diff --git a/src/main/java/io/supertokens/storage/mysql/queries/MultitenancyQueries.java b/src/main/java/io/supertokens/storage/mysql/queries/MultitenancyQueries.java index 72a8179..25d8c86 100644 --- a/src/main/java/io/supertokens/storage/mysql/queries/MultitenancyQueries.java +++ b/src/main/java/io/supertokens/storage/mysql/queries/MultitenancyQueries.java @@ -56,7 +56,6 @@ static String getQueryToCreateTenantConfigsTable(Start start) { + "passwordless_enabled BOOLEAN," + "third_party_enabled BOOLEAN," + "is_first_factors_null BOOLEAN," - + "is_third_party_providers_null BOOLEAN," + "PRIMARY KEY (connection_uri_domain, app_id, tenant_id)" + ");"; // @formatter:on diff --git a/src/main/java/io/supertokens/storage/mysql/queries/multitenancy/TenantConfigSQLHelper.java b/src/main/java/io/supertokens/storage/mysql/queries/multitenancy/TenantConfigSQLHelper.java index 3188598..4e91033 100644 --- a/src/main/java/io/supertokens/storage/mysql/queries/multitenancy/TenantConfigSQLHelper.java +++ b/src/main/java/io/supertokens/storage/mysql/queries/multitenancy/TenantConfigSQLHelper.java @@ -56,14 +56,13 @@ public static TenantConfigRowMapper getInstance(ThirdPartyConfig.Provider[] prov public TenantConfig map(ResultSet result) throws StorageQueryException { try { boolean isFirstFactorsNull = result.getBoolean("is_first_factors_null"); - boolean isThirdPartyProvidersNull = result.getBoolean("is_third_party_providers_null"); return new TenantConfig( new TenantIdentifier(result.getString("connection_uri_domain"), result.getString("app_id"), result.getString("tenant_id")), new EmailPasswordConfig(result.getBoolean("email_password_enabled")), new ThirdPartyConfig(result.getBoolean( "third_party_enabled"), - providers.length == 0 && isThirdPartyProvidersNull ? null : providers), + providers), new PasswordlessConfig(result.getBoolean("passwordless_enabled")), firstFactors.length == 0 && isFirstFactorsNull ? null : firstFactors, requiredSecondaryFactors.length == 0 ? null : requiredSecondaryFactors, @@ -82,7 +81,7 @@ public static TenantConfig[] selectAll(Start start, throws SQLException, StorageQueryException { String QUERY = "SELECT connection_uri_domain, app_id, tenant_id, core_config," + " email_password_enabled, passwordless_enabled, third_party_enabled," - + " is_first_factors_null, is_third_party_providers_null FROM " + + " is_first_factors_null FROM " + getConfig(start).getTenantConfigsTable() + ";"; TenantConfig[] tenantConfigs = execute(start, QUERY, pst -> { @@ -121,8 +120,8 @@ public static void create(Start start, Connection sqlCon, TenantConfig tenantCon String QUERY = "INSERT INTO " + getConfig(start).getTenantConfigsTable() + "(connection_uri_domain, app_id, tenant_id, core_config," + " email_password_enabled, passwordless_enabled, third_party_enabled," - + " is_first_factors_null, is_third_party_providers_null)" - + " VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)"; + + " is_first_factors_null)" + + " VALUES(?, ?, ?, ?, ?, ?, ?, ?)"; try { update(sqlCon, QUERY, pst -> { @@ -134,7 +133,6 @@ public static void create(Start start, Connection sqlCon, TenantConfig tenantCon pst.setBoolean(6, tenantConfig.passwordlessConfig.enabled); pst.setBoolean(7, tenantConfig.thirdPartyConfig.enabled); pst.setBoolean(8, tenantConfig.firstFactors == null); - pst.setBoolean(9, tenantConfig.thirdPartyConfig.providers == null); }); } catch (StorageQueryException e) { throw new StorageTransactionLogicException(e);