-
Notifications
You must be signed in to change notification settings - Fork 166
LG-6527 pre logic announcement for kantara req #6531
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
mdiarra3
merged 25 commits into
main
from
LG-6527-pre-logic-announcement-for-kantara-req
Jul 6, 2022
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
19d4cfd
update
mdiarra3 5fc2504
add addiitonal required controller
mdiarra3 07a2f2e
required
mdiarra3 4ef3a9d
LG-6527: prelogic kantara
mdiarra3 6ac88d2
Merge remote-tracking branch 'origin/main' into LG-6527-pre-logic-ann…
mdiarra3 223e57a
LG-6527: updated prelogic for kantara req
mdiarra3 38b60ea
Merge remote-tracking branch 'origin/main' into LG-6527-pre-logic-ann…
mdiarra3 27603e3
prelogic fix
mdiarra3 547421a
LG-6527: allow users to skip with a migration
mdiarra3 a3617aa
presenter test and updated language
mdiarra3 2f99d7a
changelog: Upcoming Features, Authentication, add more forgiving meth…
mdiarra3 4d60e1b
LG-6527: update timestamp, add feature tests
mdiarra3 3b0015a
Merge remote-tracking branch 'origin/main' into LG-6527-pre-logic-ann…
mdiarra3 162a30c
LG-6527: update specs
mdiarra3 3d40d1a
LG-6527: update spec
mdiarra3 614416c
Lg-6527: update config to move to applciation controller
mdiarra3 f9993f0
update and fix tests
mdiarra3 a325174
remove dupe method
mdiarra3 ba61bd1
remove whitespace
mdiarra3 7344a29
capitalize the A
mdiarra3 2c0b084
update event comment
mdiarra3 5c3e299
Merge remote-tracking branch 'origin/main' into LG-6527-pre-logic-ann…
mdiarra3 06fb964
LG-6527: default set to true
mdiarra3 cfae06f
update tests
mdiarra3 9ea111d
update schema
mdiarra3 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
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
28 changes: 28 additions & 0 deletions
28
app/controllers/users/additional_mfa_required_controller.rb
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,28 @@ | ||
| module Users | ||
| class AdditionalMfaRequiredController < ApplicationController | ||
| extend ActiveSupport::Concern | ||
|
|
||
| def show | ||
| @content = AdditionalMfaRequiredPresenter.new(current_user: current_user) | ||
| analytics.non_restricted_mfa_required_prompt_visited | ||
| end | ||
|
|
||
| def skip | ||
| user_session[:skip_kantara_req] = true | ||
| if Time.zone.today > enforcement_date | ||
| UpdateUser.new( | ||
| user: current_user, | ||
| attributes: { non_restricted_mfa_required_prompt_skip_date: Time.zone.today }, | ||
| ).call | ||
| end | ||
| analytics.non_restricted_mfa_required_prompt_skipped | ||
| redirect_to after_sign_in_path_for(current_user) | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def enforcement_date | ||
| @enforcement_date ||= IdentityConfig.store.kantara_restriction_enforcement_date | ||
| end | ||
| end | ||
| end |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| class AdditionalMfaRequiredPresenter | ||
| attr_reader :current_user | ||
| def initialize(current_user:) | ||
| @current_user = current_user | ||
| end | ||
|
|
||
| def title | ||
| if current_date > enforcement_date | ||
| I18n.t('mfa.additional_mfa_required.heading') | ||
| else | ||
| I18n.t( | ||
| 'mfa.additional_mfa_required.title', | ||
| date: I18n.l(enforcement_date, format: :event_date), | ||
| ) | ||
| end | ||
| end | ||
|
|
||
| def button | ||
| I18n.t('mfa.additional_mfa_required.button') | ||
| end | ||
|
|
||
| def info | ||
| if current_date > enforcement_date | ||
| I18n.t('mfa.additional_mfa_required.non_restricted_required_info') | ||
| else | ||
| I18n.t( | ||
| 'mfa.additional_mfa_required.info', | ||
| date: I18n.l(enforcement_date, format: :event_date), | ||
| ) | ||
| end | ||
| end | ||
|
|
||
| def skip | ||
| if current_date > enforcement_date | ||
| I18n.t('mfa.skip_once') | ||
| else | ||
| I18n.t('mfa.skip') | ||
| end | ||
| end | ||
|
|
||
| def learn_more_text | ||
| I18n.t('mfa.additional_mfa_required.learn_more') | ||
| end | ||
|
|
||
| def cant_skip_anymore? | ||
| return false if current_date < enforcement_date | ||
| return false unless current_user.non_restricted_mfa_required_prompt_skip_date | ||
| current_user.non_restricted_mfa_required_prompt_skip_date > | ||
| enforcement_date | ||
| end | ||
|
|
||
| def learn_more_link | ||
| MarketingSite.help_center_article_url( | ||
| category: 'get-started', | ||
| article: 'authentication-options', | ||
| ) | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def current_date | ||
| @current_date ||= Time.zone.today | ||
| end | ||
|
|
||
| def enforcement_date | ||
| @enforcement_date ||= IdentityConfig.store.kantara_restriction_enforcement_date | ||
| end | ||
| end |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <% title @content.title %> | ||
|
|
||
| <%= image_tag asset_url('user-signup-ial1.svg'), width: 107, height: 119, alt: '', class: 'margin-bottom-4' %> | ||
|
|
||
| <%= render PageHeadingComponent.new.with_content(@content.title) %> | ||
|
|
||
| <p class='margin-top-1 margin-bottom-4'> | ||
| <%= @content.info %> | ||
| <%= link_to(@content.learn_more_text, @content.learn_more_link) %> | ||
| </p> | ||
|
|
||
| <div class="col-12"> | ||
| <%= link_to( | ||
| second_mfa_setup_path, | ||
| class: 'usa-button usa-button--wide usa-button--big margin-bottom-3', | ||
| ) { @content.button } %> | ||
| </div> | ||
|
|
||
| <% unless @content.cant_skip_anymore? %> | ||
| <%= button_to( | ||
| login_additional_mfa_required_skip_path, | ||
| method: :post, | ||
| class: 'usa-button usa-button--unstyled', | ||
| ) do %> | ||
| <%= @content.skip %> | ||
| <% end %> | ||
| <% end %> |
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.