Skip to content

Commit

Permalink
merge latest (#947)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Mar 7, 2024
1 parent e1fcd0c commit 4a3a63d
Show file tree
Hide file tree
Showing 157 changed files with 3,674 additions and 2,472 deletions.
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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).

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

### Added

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

- TODO - copy once postgres / mysql changelog is done

## [8.0.0] - 2024-03-04

### Breaking changes

- 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.
- GET `/recipe/accountlinking/user/primary/check`
- GET `/recipe/accountlinking/user/link/check`
- POST `/recipe/accountlinking/user/primary`
- POST `/recipe/accountlinking/user/link`
- POST `/recipe/accountlinking/user/unlink`
- GET `/users/count/active`
- POST `/user/remove`
- GET `/ee/featureflag`
- GET `/user/id`
- PUT `/ee/license`
- DELETE `/ee/license`
- GET `/ee/license`
- GET `/requests/stats`
- GET `/recipe/user` when querying by `userId`
- GET `/recipe/jwt/jwks`
- POST `/recipe/jwt`

### Fixes

- Fixes issue with non-auth recipe related storage handling

## [7.0.18] - 2024-02-19

- Fixes vulnerabilities in dependencies
Expand Down
Binary file modified cli/jar/cli.jar
Binary file not shown.
Binary file modified downloader/jar/downloader.jar
Binary file not shown.
Binary file modified ee/jar/ee.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ private JsonObject getMultiTenancyStats()
return stats;
}

private JsonObject getAccountLinkingStats() throws StorageQueryException {
// TODO: Active users are present only on public tenant and MFA users may be present on different storages
private JsonObject getAccountLinkingStats() throws StorageQueryException, TenantOrAppNotFoundException {
JsonObject result = new JsonObject();
Storage[] storages = StorageLayer.getStoragesForApp(main, this.appIdentifier);
boolean usesAccountLinking = false;
Expand Down
Binary file removed jar/core-7.0.18.jar
Binary file not shown.
Binary file added jar/core-8.0.0.jar
Binary file not shown.
35 changes: 12 additions & 23 deletions src/main/java/io/supertokens/ActiveUsers.java
Original file line number Diff line number Diff line change
@@ -1,56 +1,45 @@
package io.supertokens;

import io.supertokens.pluginInterface.Storage;
import io.supertokens.pluginInterface.StorageUtils;
import io.supertokens.pluginInterface.authRecipe.sqlStorage.AuthRecipeSQLStorage;
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
import io.supertokens.pluginInterface.exceptions.StorageTransactionLogicException;
import io.supertokens.pluginInterface.multitenancy.AppIdentifierWithStorage;
import io.supertokens.pluginInterface.multitenancy.AppIdentifier;
import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
import io.supertokens.storageLayer.StorageLayer;
import org.jetbrains.annotations.TestOnly;

public class ActiveUsers {

public static void updateLastActive(AppIdentifierWithStorage appIdentifierWithStorage, Main main, String userId)
public static void updateLastActive(AppIdentifier appIdentifier, Main main, String userId)
throws TenantOrAppNotFoundException {
Storage storage = StorageLayer.getStorage(appIdentifier.getAsPublicTenantIdentifier(), main);
try {
appIdentifierWithStorage.getActiveUsersStorage().updateLastActive(appIdentifierWithStorage, userId);
StorageUtils.getActiveUsersStorage(storage).updateLastActive(appIdentifier, userId);
} catch (StorageQueryException ignored) {
}
}

@TestOnly
public static void updateLastActive(Main main, String userId) {
try {
ActiveUsers.updateLastActive(new AppIdentifierWithStorage(null, null, StorageLayer.getStorage(main)), main,
userId);
ActiveUsers.updateLastActive(new AppIdentifier(null, null),
main, userId);
} catch (TenantOrAppNotFoundException e) {
throw new IllegalStateException(e);
}
}

public static int countUsersActiveSince(AppIdentifierWithStorage appIdentifierWithStorage, Main main, long time)
public static int countUsersActiveSince(Main main, AppIdentifier appIdentifier, long time)
throws StorageQueryException, TenantOrAppNotFoundException {
return appIdentifierWithStorage.getActiveUsersStorage().countUsersActiveSince(appIdentifierWithStorage, time);
Storage storage = StorageLayer.getStorage(appIdentifier.getAsPublicTenantIdentifier(), main);
return StorageUtils.getActiveUsersStorage(storage).countUsersActiveSince(appIdentifier, time);
}

@TestOnly
public static int countUsersActiveSince(Main main, long time)
throws StorageQueryException, TenantOrAppNotFoundException {
return countUsersActiveSince(new AppIdentifierWithStorage(null, null, StorageLayer.getStorage(main)), main,
time);
}

public static void removeActiveUser(AppIdentifierWithStorage appIdentifierWithStorage, String userId)
throws StorageQueryException {
try {
((AuthRecipeSQLStorage) appIdentifierWithStorage.getActiveUsersStorage()).startTransaction(con -> {
appIdentifierWithStorage.getActiveUsersStorage().deleteUserActive_Transaction(con, appIdentifierWithStorage, userId);
((AuthRecipeSQLStorage) appIdentifierWithStorage.getActiveUsersStorage()).commitTransaction(con);
return null;
});

} catch (StorageTransactionLogicException e) {
throw new StorageQueryException(e.actualException);
}
return countUsersActiveSince(main, new AppIdentifier(null, null), time);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,21 @@

package io.supertokens;

import io.supertokens.pluginInterface.multitenancy.AppIdentifierWithStorage;
import io.supertokens.pluginInterface.Storage;
import io.supertokens.pluginInterface.useridmapping.UserIdMapping;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class AppIdentifierWithStorageAndUserIdMapping {
public class StorageAndUserIdMapping {
@Nullable
public final io.supertokens.pluginInterface.useridmapping.UserIdMapping userIdMapping;

@Nonnull
public final AppIdentifierWithStorage appIdentifierWithStorage;
public final Storage storage;

public AppIdentifierWithStorageAndUserIdMapping(AppIdentifierWithStorage appIdentifierWithStorage, UserIdMapping userIdMapping) {
this.appIdentifierWithStorage = appIdentifierWithStorage;
public StorageAndUserIdMapping(Storage storage, UserIdMapping userIdMapping) {
this.storage = storage;
this.userIdMapping = userIdMapping;

assert(this.appIdentifierWithStorage != null);
}
}

This file was deleted.

Loading

0 comments on commit 4a3a63d

Please sign in to comment.