-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11453 from 18F/stages/rc-2024-11-05
Deploy RC 428 to Production
- Loading branch information
Showing
124 changed files
with
4,183 additions
and
1,448 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
39 changes: 39 additions & 0 deletions
39
app/controllers/concerns/recommend_webauthn_platform_concern.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
module RecommendWebauthnPlatformConcern | ||
def recommend_webauthn_platform_for_sms_user?(bucket) | ||
# Only consider for A/B test if: | ||
# 1. Option would be offered for setup | ||
# 2. User is viewing content in English | ||
# 3. Other recommendations have not already been offered (e.g. PIV/CAC for federal emails) | ||
# 4. User selected to setup phone or authenticated with phone | ||
# 5. User has not already set up a platform authenticator | ||
return false if !device_supports_platform_authenticator_setup? | ||
return false if I18n.locale != :en | ||
return false if current_user.webauthn_platform_recommended_dismissed_at? | ||
return false if !user_set_up_or_authenticated_with_phone? | ||
return false if current_user.webauthn_configurations.platform_authenticators.present? | ||
ab_test_bucket(:RECOMMEND_WEBAUTHN_PLATFORM_FOR_SMS_USER) == bucket | ||
end | ||
|
||
private | ||
|
||
def device_supports_platform_authenticator_setup? | ||
user_session[:platform_authenticator_available] == true | ||
end | ||
|
||
def in_account_creation_flow? | ||
user_session[:in_account_creation_flow] == true | ||
end | ||
|
||
def user_set_up_or_authenticated_with_phone? | ||
if in_account_creation_flow? | ||
current_user.phone_configurations.any? do |phone_configuration| | ||
phone_configuration.mfa_enabled? && phone_configuration.delivery_preference == 'sms' | ||
end | ||
else | ||
auth_methods_session.auth_events.pluck(:auth_method). | ||
include?(TwoFactorAuthenticatable::AuthMethod::SMS) | ||
end | ||
end | ||
end |
49 changes: 49 additions & 0 deletions
49
app/controllers/idv/account_verified_cta_visited_controller.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# frozen_string_literal: true | ||
|
||
module Idv | ||
class AccountVerifiedCtaVisitedController < ApplicationController | ||
before_action :disable_caching | ||
before_action :confirm_redirect_requestable | ||
|
||
def show | ||
redirect_to(redirect_url, allow_other_host: true) | ||
analytics.idv_account_verified_cta_visited(campaign_id:, issuer:) | ||
end | ||
|
||
private | ||
|
||
def confirm_redirect_requestable | ||
return if redirect_url.present? | ||
|
||
render_bad_request | ||
end | ||
|
||
def redirect_url | ||
if issuer.blank? | ||
root_url | ||
else | ||
sp_return_url_resolver&.return_to_sp_url | ||
end | ||
end | ||
|
||
def issuer | ||
valid_params[:issuer] | ||
end | ||
|
||
def campaign_id | ||
valid_params[:campaign_id] | ||
end | ||
|
||
def valid_params | ||
params.permit(:campaign_id, :issuer) | ||
end | ||
|
||
def service_provider | ||
ServiceProvider.find_by(issuer:) if issuer.present? | ||
end | ||
|
||
def sp_return_url_resolver | ||
SpReturnUrlResolver.new(service_provider:) if service_provider | ||
end | ||
end | ||
end |
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
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
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
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
Oops, something went wrong.