Skip to content

Commit 4a3a63d

Browse files
sattvikcrishabhpoddaranku255
authored
merge latest (#947)
* fix: adds test for user pagination from old version (#893) * adding dev-v7.0.15 tag to this commit to ensure building * fix: core config validation (#894) * fix: core config validation * fix: core config validation * fix: PR comments * fix: PR comments * fix: test * fix: startup test * fix: using ConfigMapper * fix: test * fix: config mapper * fix: core config * adding dev-v7.0.16 tag to this commit to ensure building * fix: null handling in config mapper (#897) * fix: core config validation * fix: core config validation * fix: PR comments * fix: PR comments * fix: test * fix: startup test * fix: using ConfigMapper * fix: test * fix: config mapper * fix: core config * fix: null handling * fix: test defaults * adding dev-v7.0.16 tag to this commit to ensure building * Add t4-app in release checklist (#899) * Update README.md * Add Dockerfile for ubuntu 22.04 (#904) * fix: error logs should be printed to StdErr (#918) * fix: Load only cud (#917) * fix: update config and validateAndNormalize * fix: impl * fix: PR comments * fix: cleanup * fix: cleanup * fix: pr comments * fix: pr comments * fix: tests * fix: changelog * fix: 400 error * fix: cuds from db * fix: connection pool issue (#919) * adding dev-v7.0.17 tag to this commit to ensure building * fix: Test fix (#921) * fix: test * fix: tests * adding dev-v7.0.17 tag to this commit to ensure building * fix: CICD tests (#925) * fix: tests * fix: adding retry * fix: kill * fix: typo * fix: cicd * fix: cicd * adding dev-v7.0.17 tag to this commit to ensure building * fix: Vulnerability fix (#928) * fix: updated dependencies * fix: updated dependencies * chore: version and changelog * fix: update impl deps * fix: telemetry data * fix: changelog * fix: cleanup * fix: active user storage * fix: active users storage test * fix: changelog * fix: versions * adding dev-v7.0.18 tag to this commit to ensure building * fix: Cicd tests fix (#932) * fix: CICD fix * fix: test fix * fix: test for mongo * adding dev-v7.0.18 tag to this commit to ensure building * fix: dependencies (#933) * fix: dependency fix * fix: dep fix * adding dev-v7.0.18 tag to this commit to ensure building * fix: dependencies (#934) * adding dev-v7.0.18 tag to this commit to ensure building * fix: 31 days of mau (#936) * fix: MAU computation (#937) * fix: mau * fix: typo * adding dev-v7.0.18 tag to this commit to ensure building * fix: mau related tests (#938) * adding dev-v7.0.18 tag to this commit to ensure building * fix: Tests (#939) * fix: mau related tests * fix: test * adding dev-v7.0.18 tag to this commit to ensure building * fix: fixes storage handling for non-auth recipes (#942) * fix: non auth recipe stuff * fix: user roles * fix: half done * fix: thirdparty changes * fix: passwordless changes * fix: active users * fix: session changes * fix: user metadata * fix: user roles * fix: totp * fix: email verification * fix: multitenancy and other minor fixes * fix: compile errors * fix: bugs and tests * fix: bugs and tests * fix: func rename * fix: PR comments * fix: pr comments * fix: pr comments * fix: pr comments * fix: user role multitenant tests * fix: email verification tests * fix: user role deletion * fix: user roles * fix: user roles * fix: get tenant identifier refactor * fix: pr comments * fix: query * fix: tests version and changelog * Update CHANGELOG.md Co-authored-by: Rishabh Poddar <[email protected]> * fix: pr comments --------- Co-authored-by: Rishabh Poddar <[email protected]> * adding dev-v8.0.0 tag to this commit to ensure building * fix: plugin interface version (#945) * adding dev-v8.0.0 tag to this commit to ensure building * fix: cicd tests (#946) * fix: cicd tests * fix: cicd tests * fix: cicd tests * fix: cicd tests * fix: cicd tests * adding dev-v8.0.0 tag to this commit to ensure building --------- Co-authored-by: rishabhpoddar <[email protected]> Co-authored-by: Ankit Tiwari <[email protected]>
1 parent e1fcd0c commit 4a3a63d

File tree

157 files changed

+3674
-2472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+3674
-2472
lines changed

CHANGELOG.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [8.0.0] - 2023-11-29
8+
## [9.0.0] - 2024-03-04
99

1010
### Added
1111

@@ -35,6 +35,32 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3535

3636
- TODO - copy once postgres / mysql changelog is done
3737

38+
## [8.0.0] - 2024-03-04
39+
40+
### Breaking changes
41+
42+
- The following app specific APIs return a 403 when they are called with a tenant ID other than the `public` one. For example, if the path is `/users/count/active`, and you call it with `/tenant1/users/count/active`, it will return a 403. But if you call it with `/public/users/count/active`, or just `/users/count/active`, it will work.
43+
- GET `/recipe/accountlinking/user/primary/check`
44+
- GET `/recipe/accountlinking/user/link/check`
45+
- POST `/recipe/accountlinking/user/primary`
46+
- POST `/recipe/accountlinking/user/link`
47+
- POST `/recipe/accountlinking/user/unlink`
48+
- GET `/users/count/active`
49+
- POST `/user/remove`
50+
- GET `/ee/featureflag`
51+
- GET `/user/id`
52+
- PUT `/ee/license`
53+
- DELETE `/ee/license`
54+
- GET `/ee/license`
55+
- GET `/requests/stats`
56+
- GET `/recipe/user` when querying by `userId`
57+
- GET `/recipe/jwt/jwks`
58+
- POST `/recipe/jwt`
59+
60+
### Fixes
61+
62+
- Fixes issue with non-auth recipe related storage handling
63+
3864
## [7.0.18] - 2024-02-19
3965

4066
- Fixes vulnerabilities in dependencies

cli/jar/cli.jar

0 Bytes
Binary file not shown.

downloader/jar/downloader.jar

0 Bytes
Binary file not shown.

ee/jar/ee.jar

-6 Bytes
Binary file not shown.

ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ private JsonObject getMultiTenancyStats()
267267
return stats;
268268
}
269269

270-
private JsonObject getAccountLinkingStats() throws StorageQueryException {
271-
// TODO: Active users are present only on public tenant and MFA users may be present on different storages
270+
private JsonObject getAccountLinkingStats() throws StorageQueryException, TenantOrAppNotFoundException {
272271
JsonObject result = new JsonObject();
273272
Storage[] storages = StorageLayer.getStoragesForApp(main, this.appIdentifier);
274273
boolean usesAccountLinking = false;

jar/core-7.0.18.jar

-724 KB
Binary file not shown.

jar/core-8.0.0.jar

730 KB
Binary file not shown.
+12-23
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,45 @@
11
package io.supertokens;
22

3+
import io.supertokens.pluginInterface.Storage;
4+
import io.supertokens.pluginInterface.StorageUtils;
35
import io.supertokens.pluginInterface.authRecipe.sqlStorage.AuthRecipeSQLStorage;
46
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
57
import io.supertokens.pluginInterface.exceptions.StorageTransactionLogicException;
6-
import io.supertokens.pluginInterface.multitenancy.AppIdentifierWithStorage;
8+
import io.supertokens.pluginInterface.multitenancy.AppIdentifier;
79
import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
810
import io.supertokens.storageLayer.StorageLayer;
911
import org.jetbrains.annotations.TestOnly;
1012

1113
public class ActiveUsers {
1214

13-
public static void updateLastActive(AppIdentifierWithStorage appIdentifierWithStorage, Main main, String userId)
15+
public static void updateLastActive(AppIdentifier appIdentifier, Main main, String userId)
1416
throws TenantOrAppNotFoundException {
17+
Storage storage = StorageLayer.getStorage(appIdentifier.getAsPublicTenantIdentifier(), main);
1518
try {
16-
appIdentifierWithStorage.getActiveUsersStorage().updateLastActive(appIdentifierWithStorage, userId);
19+
StorageUtils.getActiveUsersStorage(storage).updateLastActive(appIdentifier, userId);
1720
} catch (StorageQueryException ignored) {
1821
}
1922
}
2023

2124
@TestOnly
2225
public static void updateLastActive(Main main, String userId) {
2326
try {
24-
ActiveUsers.updateLastActive(new AppIdentifierWithStorage(null, null, StorageLayer.getStorage(main)), main,
25-
userId);
27+
ActiveUsers.updateLastActive(new AppIdentifier(null, null),
28+
main, userId);
2629
} catch (TenantOrAppNotFoundException e) {
2730
throw new IllegalStateException(e);
2831
}
2932
}
3033

31-
public static int countUsersActiveSince(AppIdentifierWithStorage appIdentifierWithStorage, Main main, long time)
34+
public static int countUsersActiveSince(Main main, AppIdentifier appIdentifier, long time)
3235
throws StorageQueryException, TenantOrAppNotFoundException {
33-
return appIdentifierWithStorage.getActiveUsersStorage().countUsersActiveSince(appIdentifierWithStorage, time);
36+
Storage storage = StorageLayer.getStorage(appIdentifier.getAsPublicTenantIdentifier(), main);
37+
return StorageUtils.getActiveUsersStorage(storage).countUsersActiveSince(appIdentifier, time);
3438
}
3539

3640
@TestOnly
3741
public static int countUsersActiveSince(Main main, long time)
3842
throws StorageQueryException, TenantOrAppNotFoundException {
39-
return countUsersActiveSince(new AppIdentifierWithStorage(null, null, StorageLayer.getStorage(main)), main,
40-
time);
41-
}
42-
43-
public static void removeActiveUser(AppIdentifierWithStorage appIdentifierWithStorage, String userId)
44-
throws StorageQueryException {
45-
try {
46-
((AuthRecipeSQLStorage) appIdentifierWithStorage.getActiveUsersStorage()).startTransaction(con -> {
47-
appIdentifierWithStorage.getActiveUsersStorage().deleteUserActive_Transaction(con, appIdentifierWithStorage, userId);
48-
((AuthRecipeSQLStorage) appIdentifierWithStorage.getActiveUsersStorage()).commitTransaction(con);
49-
return null;
50-
});
51-
52-
} catch (StorageTransactionLogicException e) {
53-
throw new StorageQueryException(e.actualException);
54-
}
43+
return countUsersActiveSince(main, new AppIdentifier(null, null), time);
5544
}
5645
}

src/main/java/io/supertokens/AppIdentifierWithStorageAndUserIdMapping.java renamed to src/main/java/io/supertokens/StorageAndUserIdMapping.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@
1616

1717
package io.supertokens;
1818

19-
import io.supertokens.pluginInterface.multitenancy.AppIdentifierWithStorage;
19+
import io.supertokens.pluginInterface.Storage;
2020
import io.supertokens.pluginInterface.useridmapping.UserIdMapping;
2121

2222
import javax.annotation.Nonnull;
2323
import javax.annotation.Nullable;
2424

25-
public class AppIdentifierWithStorageAndUserIdMapping {
25+
public class StorageAndUserIdMapping {
2626
@Nullable
2727
public final io.supertokens.pluginInterface.useridmapping.UserIdMapping userIdMapping;
2828

2929
@Nonnull
30-
public final AppIdentifierWithStorage appIdentifierWithStorage;
30+
public final Storage storage;
3131

32-
public AppIdentifierWithStorageAndUserIdMapping(AppIdentifierWithStorage appIdentifierWithStorage, UserIdMapping userIdMapping) {
33-
this.appIdentifierWithStorage = appIdentifierWithStorage;
32+
public StorageAndUserIdMapping(Storage storage, UserIdMapping userIdMapping) {
33+
this.storage = storage;
3434
this.userIdMapping = userIdMapping;
35-
36-
assert(this.appIdentifierWithStorage != null);
3735
}
3836
}

src/main/java/io/supertokens/TenantIdentifierWithStorageAndUserIdMapping.java

-41
This file was deleted.

0 commit comments

Comments
 (0)