-
Notifications
You must be signed in to change notification settings - Fork 6
2411: add resend login confirmation token functionality #622
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d170d76
feat: add resend login confirmation token functionality
PossessedC0bra f47be89
chore: refactor resend token button
PossessedC0bra 05afdbe
feat: load resend timeout from database
PossessedC0bra b31e96e
chore: format message_template.ml
PossessedC0bra 0a8a048
chore: cascade 2fa token deletions to email job history
PossessedC0bra 125ecc8
fix: do not update pool_authentication primary key on duplicate key
PossessedC0bra 021f1c9
feat: rework 2FA process
PossessedC0bra 7d7ae1d
fix: redirect to verify 2fa page dropping query params
PossessedC0bra 3ecf755
fix: resend 2fa token not reading auth_id from session
PossessedC0bra dc56d7d
chore: improve pool_authentication token validity migration
PossessedC0bra f91bef1
chore: look in both pool_queue and pool_queue_jobs_history tables for…
PossessedC0bra 768434f
fix: login not possible after auth session expiration
PossessedC0bra 5194a52
feat: introduce new 2FA flow on root tenant
PossessedC0bra c7edc56
chore: cleanup db migrations
PossessedC0bra 8a1c638
fix: explicitly specify resend 2fa code button type
PossessedC0bra 8e2ee15
chore: clear auth_id from session if it has expired
PossessedC0bra c0a48c2
chore: add index on authentication_uuid column
PossessedC0bra 4da3e06
chore: define authentication timeout in central space
PossessedC0bra 601903b
fix: rotation of authentication id when there already is an active au…
PossessedC0bra ce99b7a
chore: reformat authentication.mli
PossessedC0bra d53e218
chore: use better aliases in last login token email query
PossessedC0bra 31f97d3
chore: improve remaining 2fa token uses calculation
PossessedC0bra 3185e3a
chore: add types to unused arguments
PossessedC0bra e1ef731
chore: rename usage_count to failed_attempts in pool authentication
PossessedC0bra 6eb7f01
Merge branch 'main' into feature/ykl/2411-mfa-token-resend
mabiede File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
45 changes: 45 additions & 0 deletions
45
pool/app/pool_database/migrations/migration_202607141227.ml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| open Database | ||
|
|
||
| let create_pool_queue_job_authentication_table = | ||
| Migration.Step.create | ||
| ~label:"create pool_queue_job_authentication table" | ||
| {sql| | ||
| CREATE TABLE IF NOT EXISTS pool_queue_job_authentication ( | ||
| queue_uuid binary(16) NOT NULL, | ||
| authentication_uuid binary(16) NOT NULL, | ||
| created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
| UNIQUE KEY `unique_queue_uuid` (`queue_uuid`), | ||
| UNIQUE KEY `unique_queue_entity_combination` (queue_uuid, authentication_uuid), | ||
| KEY `idx_authentication_uuid` (`authentication_uuid`), | ||
| CONSTRAINT fk_pool_queue_job_authentication FOREIGN KEY (authentication_uuid) REFERENCES pool_authentication(uuid) ON DELETE CASCADE | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; | ||
|
PossessedC0bra marked this conversation as resolved.
|
||
| |sql} | ||
| ;; | ||
|
|
||
| let remove_automagic_timestamp_on_update_trigger = | ||
| Migration.Step.create | ||
| ~label: | ||
| "remove mariadbs automagic timestamp on update trigger for token valid_until column" | ||
| {sql| | ||
| ALTER TABLE pool_authentication | ||
| MODIFY COLUMN valid_until TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() | ||
| |sql} | ||
| ;; | ||
|
|
||
| let add_failed_attempts_to_authentication = | ||
| Migration.Step.create | ||
| ~label:"add failed_attempts column to pool_authentication" | ||
| {sql| | ||
| ALTER TABLE pool_authentication | ||
| ADD COLUMN failed_attempts TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER token | ||
| |sql} | ||
| ;; | ||
|
|
||
| let migration () = | ||
| Migration.( | ||
| empty "202607141227" | ||
| |> add_step create_pool_queue_job_authentication_table | ||
| |> add_step remove_automagic_timestamp_on_update_trigger | ||
| |> add_step add_failed_attempts_to_authentication) | ||
| ;; | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.