-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement TOTP inmemory classes #564
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rishabhpoddar
requested changes
Feb 11, 2023
rishabhpoddar
requested changes
Feb 13, 2023
rishabhpoddar
requested changes
Feb 17, 2023
rishabhpoddar
requested changes
Feb 18, 2023
src/main/java/io/supertokens/inmemorydb/queries/TOTPQueries.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/inmemorydb/queries/TOTPQueries.java
Outdated
Show resolved
Hide resolved
…rder of init params in TOTPDevice
KShivendu
force-pushed
the
feat/totp-inmemory
branch
from
February 21, 2023 07:45
7e9db87
to
957e016
Compare
rishabhpoddar
requested changes
Feb 21, 2023
src/main/java/io/supertokens/inmemorydb/queries/TOTPQueries.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/inmemorydb/queries/TOTPQueries.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/inmemorydb/queries/TOTPQueries.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/cronjobs/deleteExpiredTotpTokens/DeleteExpiredTotpTokens.java
Show resolved
Hide resolved
src/main/java/io/supertokens/cronjobs/deleteExpiredTotpTokens/DeleteExpiredTotpTokens.java
Show resolved
Hide resolved
- Add created_time_ms - Run cron to delete expired used tokens - Add feature to delete all TOTP data on user deletion - Simulate foreign key constraint in totp_used_codes for inmemorydb - Refactor and clean TOTP.java code - Use java-totp to generate secret key and verify code - Add and update tests
KShivendu
commented
Feb 22, 2023
- Add config for totp_rate_limit_window_size - Improve function names and return types - Use `is_valid` for totp_used_code - Expose function to generate TOTP code for tests to use
Every used code is only linked to the user now. No concept of code to device linking. So removed device_name.
rishabhpoddar
requested changes
Feb 23, 2023
src/main/java/io/supertokens/inmemorydb/queries/TOTPQueries.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/inmemorydb/queries/TOTPQueries.java
Outdated
Show resolved
Hide resolved
rishabhpoddar
requested changes
Feb 23, 2023
- Improve rate limiting and device removal logic - Add config for TOTP rate limting - Properly use transactions - Add/update tests
- Use device period in totp generation and validation - Add tests to cover most edge cases of Totp.java - Fix overriding of totp_rate_limit_cooldown_sec - Add tests for TOTP cron - Add comments for edge cases and readability - Introduce totp_invalid_code_expiry_sec config
- Query all codes instead of only expired ones - Remove redundant deleteAllDataForUser from TOTPQueries - Move TOTP code generation to tests - Add logging to DeleteExpriedTotoTokens cron
6 tasks
rishabhpoddar
requested changes
Mar 16, 2023
src/main/java/io/supertokens/webserver/api/totp/VerifyTotpAPI.java
Outdated
Show resolved
Hide resolved
rishabhpoddar
requested changes
Mar 19, 2023
rishabhpoddar
approved these changes
Mar 20, 2023
This was referenced Mar 21, 2023
* feat: Add support for active users stats * feat: Monitor active users for all auth recipes and session recipe
KShivendu
force-pushed
the
feat/totp-inmemory
branch
from
March 21, 2023 12:08
b5647a5
to
4e13470
Compare
) * test: Add tests for active users update across different API calls * fix: Suppress usermapping exceptions for active users monitoring (#587)
9 tasks
* feat: Make TOTP a paid feature and report stats * test: Add test for TOTP usage stats * refactor: MAU should be sent irrespective of TOTP * refactor: Use internal supertokens user id in TOTP APIs (#591) * refactor: Use internal supertokens user id in TOTP APIs * test: Add test for user id mapping in TOTP APIs
rishabhpoddar
requested changes
Mar 23, 2023
9 tasks
* feat: Check TOTP feature flag in TOTP recipe functions * feat: Test feature flag error is handled by APIs
rishabhpoddar
requested changes
Mar 24, 2023
9 tasks
rishabhpoddar
requested changes
Mar 27, 2023
src/main/java/io/supertokens/webserver/api/session/RefreshSessionAPI.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/webserver/api/session/SessionAPI.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/webserver/api/session/SessionRemoveAPI.java
Outdated
Show resolved
Hide resolved
* test: Fix failing tests * fixes tests --------- Co-authored-by: rishabhpoddar <rishabh.poddar@gmail.com>
rishabhpoddar
requested changes
Mar 27, 2023
* feat: Add new API and tests for counting active users * chores: Update CHANGELOG to mention new active user count API * test: Add bad input tests for active users count API * chores: Update the http method for active user count API in CHANGELOG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of change
Implement TOTP inmemory classes
Related issues
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your
changes work. Bonus points for screenshots and videos!)
Documentation changes
(If relevant, please create a PR in our docs repo, or create a checklist here
highlighting the necessary changes)
Checklist for important updates
coreDriverInterfaceSupported.json
file has been updated (if needed)pluginInterfaceSupported.json
file has been updated (if needed)build.gradle
getPaidFeatureStats
function in FeatureFlag.java filebuild.gradle
, please make sure to add themin
implementationDependencies.json
.git tag
) in the formatvX.Y.Z
, and then find thelatest branch (
git branch --all
) whoseX.Y
is greater than the latest released tag.TODO