Skip to content

Commit

Permalink
Merge branch 'feat/mfa' into mfa-multitenancy
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Oct 17, 2023
2 parents 2ebe359 + 971e21d commit 58a678b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 51 deletions.
8 changes: 1 addition & 7 deletions src/main/java/io/supertokens/inmemorydb/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
import io.supertokens.pluginInterface.jwt.JWTSigningKeyInfo;
import io.supertokens.pluginInterface.jwt.exceptions.DuplicateKeyIdException;
import io.supertokens.pluginInterface.jwt.sqlstorage.JWTRecipeSQLStorage;
import io.supertokens.pluginInterface.mfa.MfaStorage;
import io.supertokens.pluginInterface.mfa.sqlStorage.MfaSQLStorage;
import io.supertokens.pluginInterface.multitenancy.*;
import io.supertokens.pluginInterface.multitenancy.exceptions.DuplicateClientTypeException;
import io.supertokens.pluginInterface.multitenancy.exceptions.DuplicateTenantException;
Expand Down Expand Up @@ -104,7 +102,7 @@ public class Start
implements SessionSQLStorage, EmailPasswordSQLStorage, EmailVerificationSQLStorage, ThirdPartySQLStorage,
JWTRecipeSQLStorage, PasswordlessSQLStorage, UserMetadataSQLStorage, UserRolesSQLStorage, UserIdMappingStorage,
UserIdMappingSQLStorage, MultitenancyStorage, MultitenancySQLStorage, TOTPSQLStorage, ActiveUsersStorage,
ActiveUsersSQLStorage, DashboardSQLStorage, AuthRecipeSQLStorage, MfaStorage, MfaSQLStorage {
ActiveUsersSQLStorage, DashboardSQLStorage, AuthRecipeSQLStorage {

private static final Object appenderLock = new Object();
private static final String APP_ID_KEY_NAME = "app_id";
Expand Down Expand Up @@ -618,8 +616,6 @@ public boolean isUserIdBeingUsedInNonAuthRecipe(AppIdentifier appIdentifier, Str
}
} else if (className.equals(JWTRecipeStorage.class.getName())) {
return false;
} else if (className.equals(MfaStorage.class.getName())) {
return false; /* nothing here */
} else {
throw new IllegalStateException("ClassName: " + className + " is not part of NonAuthRecipeStorage");
}
Expand Down Expand Up @@ -718,8 +714,6 @@ public void addInfoToNonAuthRecipesBasedOnUserId(TenantIdentifier tenantIdentifi
} catch (SQLException e) {
throw new StorageQueryException(e);
}
} else if (className.equals(MfaStorage.class.getName())) {
/* nothing here */
} else {
throw new IllegalStateException("ClassName: " + className + " is not part of NonAuthRecipeStorage");
}
Expand Down
34 changes: 0 additions & 34 deletions src/main/java/io/supertokens/inmemorydb/queries/MfaQueries.java

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/java/io/supertokens/useridmapping/UserIdMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
import io.supertokens.pluginInterface.exceptions.StorageTransactionLogicException;
import io.supertokens.pluginInterface.jwt.JWTRecipeStorage;
import io.supertokens.pluginInterface.mfa.MfaStorage;
import io.supertokens.pluginInterface.multitenancy.AppIdentifierWithStorage;
import io.supertokens.pluginInterface.multitenancy.TenantIdentifierWithStorage;
import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
Expand Down Expand Up @@ -343,14 +342,6 @@ public static void assertThatUserIdIsNotBeingUsedInNonAuthRecipes(
new WebserverAPI.BadRequestException("UserId is already in use in EmailVerification recipe"));
}
}
{
if (storage.isUserIdBeingUsedInNonAuthRecipe(appIdentifierWithStorage,
MfaStorage.class.getName(),
userId)) {
throw new ServletException(
new WebserverAPI.BadRequestException("UserId is already in use in MFA recipe"));
}
}
{
if (storage.isUserIdBeingUsedInNonAuthRecipe(appIdentifierWithStorage,
JWTRecipeStorage.class.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ public void testUserDisassociationForNotAuthRecipes() throws Exception {
if (name.equals(UserMetadataStorage.class.getName())
|| name.equals(JWTRecipeStorage.class.getName())
|| name.equals(ActiveUsersStorage.class.getName())
|| name.equals(MfaStorage.class.getName())
) {
// user metadata is app specific and does not have any tenant specific data
// JWT storage does not have any user specific data
Expand Down

0 comments on commit 58a678b

Please sign in to comment.