-
Notifications
You must be signed in to change notification settings - Fork 121
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 #2643 from 18F/stages/rc-2018-11-08
Deploy RC 70 to int
- Loading branch information
Showing
151 changed files
with
2,254 additions
and
410 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,41 @@ | ||
class AnalyticsController < ApplicationController | ||
skip_before_action :verify_authenticity_token | ||
before_action :confirm_two_factor_authenticated | ||
|
||
def create | ||
unless analytics_saved? | ||
session[:platform_authenticator] = true | ||
analytics.track_event(Analytics::PLATFORM_AUTHENTICATOR, results.to_h) | ||
results.each do |event, result| | ||
next if result.nil? | ||
|
||
analytics.track_event(event, result.to_h) | ||
end | ||
head :ok | ||
end | ||
|
||
private | ||
|
||
def results | ||
FormResponse.new(success: true, errors: {}, | ||
extra: { platform_authenticator: params[:available] }) | ||
{ | ||
Analytics::FRONTEND_BROWSER_CAPABILITIES => platform_authenticator_result, | ||
} | ||
end | ||
|
||
def platform_authenticator_result | ||
return unless current_user | ||
return if platform_authenticator_results_saved? || !platform_authenticator_params_valid? | ||
|
||
session[:platform_authenticator_analytics_saved] = true | ||
platform_authenticator_available = params[:available] || | ||
params.dig(:platform_authenticator, :available) | ||
extra = { platform_authenticator: (platform_authenticator_available == 'true') } | ||
FormResponse.new(success: true, errors: {}, extra: extra) | ||
end | ||
|
||
def platform_authenticator_params_valid? | ||
result = params[:available] || params.dig(:platform_authenticator, :available) | ||
%w[true false].include?(result) | ||
end | ||
|
||
def analytics_saved? | ||
session[:platform_authenticator] | ||
def platform_authenticator_results_saved? | ||
session[:platform_authenticator_analytics_saved] == true || | ||
session[:platform_authenticator] == true | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module AccountRecoverable | ||
# :reek:FeatureEnvy | ||
def piv_cac_enabled_but_not_phone_enabled? | ||
def piv_cac_enabled_but_not_multiple_mfa_enabled? | ||
# we need to change this so it's about having multiple mfa methods defined rather than | ||
# piv/cac + phone. Leaving as-is for now. | ||
TwoFactorAuthentication::PivCacPolicy.new(current_user).enabled? && | ||
!TwoFactorAuthentication::PhonePolicy.new(current_user).enabled? | ||
!MfaPolicy.new(current_user).multiple_factors_enabled? | ||
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
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
Oops, something went wrong.