Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8d9c09a
Merge pull request #2257 from 18F/stages/rc-2018-06-22
davemcorwin Jun 19, 2018
ee3c73e
Re-add authenticable salt method (#2260)
jmhooper Jun 20, 2018
fa08c35
Merge pull request #2261 from 18F/stages/rc-2018-06-22
davemcorwin Jun 20, 2018
b419951
LG-319 Record password strength stats (#2265)
jmhooper Jun 22, 2018
5962901
LG-409 Fix 500 errors in production
stevegsa Jun 24, 2018
5b3245e
Merge pull request #2269 from 18F/stevegsa-fix-misc-500-errors
stevegsa Jun 25, 2018
3a6644e
LG-341 Replace phony_rails with phonelib
monfresh May 4, 2018
9a5db2c
Merge pull request #2256 from 18F/mb-lg-235-phone-validation
monfresh Jun 25, 2018
263df8d
Update USPS upload logic to use GPO instead of Equifax (#2267)
davemcorwin Jun 25, 2018
42dff13
Remove `whenever` gem, configuration, and secret requirement (#2268)
davemcorwin Jun 25, 2018
0896aa0
Add piv/cac subject to attributes for move.mil
jgsmith-usds Jun 20, 2018
f81b0f1
Update sprockets to 3.7.2 (#2270)
jmhooper Jun 26, 2018
11245e1
LG-379 Stop reading old password digest columns (#2271)
jmhooper Jun 26, 2018
c8aee5f
Merge pull request #2263 from 18F/add-x509-subject-to-move-dot-mil-sp
jgsmith-usds Jun 26, 2018
0813331
LG-402 Add endpoint and holiday service (#2272)
davemcorwin Jun 26, 2018
3365a6c
Read encrypted_recovery_code_digest column (#2229)
jmhooper Jun 27, 2018
d3f0d2c
Use Hash to map Twilio errors to user-facing text
monfresh Jun 27, 2018
6b3a197
Fix Rubocop offenses
monfresh Jun 28, 2018
a26b996
LG-419 Update USAID logo
stevegsa Jun 28, 2018
a756a2c
LG-382 Implement account reset via delayed delete
stevegsa Jun 27, 2018
c5152d2
Merge pull request #2275 from 18F/mb-twilio-errors
monfresh Jun 28, 2018
e474946
Merge pull request #2278 from 18F/stevegsa-update-usaid-logo
stevegsa Jun 28, 2018
5ce9da4
[LG-350] Update personal key instructions
jgsmith-usds Jun 22, 2018
290800f
Merge pull request #2266 from 18F/jgs/lg-350-update-personal-key-inst…
jgsmith-usds Jun 28, 2018
a829d82
Added red colors
stevegsa Jun 28, 2018
a385d96
One more color
stevegsa Jun 28, 2018
205cb98
Added test for not having second factor
stevegsa Jun 28, 2018
43353fc
Added api route for sending notifications
stevegsa Jun 28, 2018
bf6f055
Merge pull request #2277 from 18F/mb-fix-rubocop-offenses
monfresh Jun 28, 2018
58c744c
More coverage on phone_delivery_presenter
stevegsa Jun 28, 2018
01a5fd3
Replaced session with flash for email in view
stevegsa Jun 28, 2018
48379f7
Replaced session/email with flash
stevegsa Jun 28, 2018
5fac6b8
Lint
stevegsa Jun 28, 2018
fd52ffa
Got rid of wait period as a feature flag
stevegsa Jun 28, 2018
6dcf26e
More coverage on request_controller
stevegsa Jun 28, 2018
43a366e
Switched to generic X-API-AUTH-TOKEN
stevegsa Jun 28, 2018
49b08ad
Fixed account reset request and granted text
stevegsa Jun 28, 2018
a386ab5
Removed unused code
stevegsa Jun 28, 2018
7030121
Removed more unused links and fixed button class in css
stevegsa Jun 28, 2018
1da6c1c
Removed typo in translations
stevegsa Jun 28, 2018
387db77
Added coverage on request controller phone_setup_url
stevegsa Jun 28, 2018
62d91b4
More coverage
stevegsa Jun 28, 2018
9c23ccd
Verbiage change on account reset request
stevegsa Jun 28, 2018
f00af57
Updated spec with new verbiage
stevegsa Jun 29, 2018
c93c550
Merge pull request #2274 from 18F/stevegsa-account-reset-via-delayed-…
stevegsa Jun 29, 2018
7b36516
Prioritize piv/cac during signin if configured
jgsmith-usds Jun 28, 2018
dcb2839
Merge pull request #2279 from 18F/jgs/prioritize-piv-cac-at-signin
jgsmith-usds Jul 2, 2018
e1c7866
LG-340 Use Twilio Verify for international SMS
monfresh Jun 27, 2018
dc7dbd8
Merge pull request #2280 from 18F/mb-lg-340-twilio-verify
monfresh Jul 2, 2018
d497073
LG-290 Move attribute encryption away from KMS
stevegsa Jul 2, 2018
e1f08d8
Merge pull request #2203 from 18F/stevegsa-refactor-attribute-encryption
monfresh Jul 2, 2018
c5d4c86
LG-437 Create MyCBP service provider
stevegsa Jul 2, 2018
fdb098a
Merge pull request #2282 from 18F/stevesga-add-mycbp-sp
stevegsa Jul 2, 2018
b953d3e
Merge branch 'master' into stages/rc-2018-07-05
monfresh Jul 2, 2018
f55c022
Define locale argument for VoiceOtpSenderJob
monfresh Jul 3, 2018
e14a2c9
Revert VoiceOtpSenderJob#send_otp
monfresh Jul 3, 2018
6aec953
LG-438 Remove csrf protection on the account reset delayed notificati…
stevegsa Jul 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .reek
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ControlParameter:
- CustomDeviseFailureApp#i18n_message
- OpenidConnectRedirector#initialize
- NoRetryJobs#call
- PhoneFormatter#self.format
DuplicateMethodCall:
exclude:
- ApplicationController#disable_caching
Expand All @@ -13,7 +14,6 @@ DuplicateMethodCall:
- MfaConfirmationController#handle_invalid_password
- needs_to_confirm_email_change?
- WorkerHealthChecker#status
- FileEncryptor#encrypt
- UserFlowExporter#self.massage_assets
- BasicAuthUrl#build
- fallback_to_english
Expand Down Expand Up @@ -45,6 +45,7 @@ FeatureEnvy:
- Utf8Sanitizer#event_attributes
- Utf8Sanitizer#remote_ip
- Idv::Proofer#validate_vendors
- PersonalKeyGenerator#create_legacy_recovery_code
InstanceVariableAssumption:
exclude:
- User
Expand All @@ -57,13 +58,13 @@ ManualDispatch:
- CloudhsmKeyGenerator#initialize_settings
NestedIterators:
exclude:
- FileEncryptor#encrypt
- UserFlowExporter#self.massage_html
- TwilioService#sanitize_phone_number
- ServiceProviderSeeder#run
NilCheck:
enabled: false
LongParameterList:
max_params: 4
exclude:
- IdentityLinker#optional_attributes
- Idv::ProoferJob#perform
Expand Down Expand Up @@ -92,7 +93,6 @@ TooManyStatements:
- OpenidConnect::AuthorizationController#store_request
- SamlIdpAuthConcern#store_saml_request
- Users::PhoneConfirmationController
- FileEncryptor#encrypt
- UserFlowExporter#self.massage_assets
- UserFlowExporter#self.massage_html
- UserFlowExporter#self.run
Expand All @@ -115,6 +115,8 @@ TooManyMethods:
- Idv::SessionsController
- ServiceProviderSessionDecorator
- SessionDecorator
- HolidayService
- PhoneDeliveryPresenter
UncommunicativeMethodName:
exclude:
- PhoneConfirmationFlow
Expand All @@ -127,6 +129,10 @@ UncommunicativeModuleName:
- X509::Attribute
- X509::Attributes
- X509::SessionStore
UnusedParameters:
exclude:
- SmsOtpSenderJob#perform
- VoiceOtpSenderJob#perform
UnusedPrivateMethod:
exclude:
- ApplicationController
Expand Down
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Metrics/ClassLength:
- app/decorators/user_decorator.rb
- app/services/analytics.rb
- app/services/idv/session.rb
- app/presenters/two_factor_auth_code/phone_delivery_presenter.rb

Metrics/LineLength:
Description: Limit lines to 100 characters.
Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ gem 'net-sftp'
gem 'newrelic_rpm'
gem 'pg'
gem 'phonelib'
gem 'phony_rails'
gem 'pkcs11'
gem 'premailer-rails'
gem 'proofer', github: '18F/identity-proofer-gem', tag: 'v2.5.0'
Expand Down Expand Up @@ -62,7 +61,6 @@ gem 'typhoeus'
gem 'uglifier', '~> 3.2'
gem 'valid_email'
gem 'webpacker', '~> 3.4'
gem 'whenever', require: false
gem 'xml-simple'
gem 'xmlenc', '~> 0.6'
gem 'zxcvbn-js'
Expand Down
13 changes: 2 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ GEM
chromedriver-helper (1.2.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
chronic (0.10.2)
chunky_png (1.3.8)
codeclimate-engine-rb (0.4.1)
virtus (~> 1.0)
Expand Down Expand Up @@ -388,10 +387,6 @@ GEM
ast (~> 2.4.0)
pg (1.0.0)
phonelib (0.6.21)
phony (2.15.44)
phony_rails (0.14.6)
activesupport (>= 3.0)
phony (> 2.15)
pkcs11 (0.2.7)
powerpack (0.1.1)
premailer (1.11.1)
Expand Down Expand Up @@ -582,7 +577,7 @@ GEM
slim (~> 3.0)
sysexits (~> 1.1)
socksify (1.7.1)
sprockets (3.7.1)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
Expand Down Expand Up @@ -651,8 +646,6 @@ GEM
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
whenever (0.10.0)
chronic (>= 0.6.3)
xml-simple (1.1.5)
xmldsig (0.6.6)
nokogiri (>= 1.6.8, < 2.0.0)
Expand Down Expand Up @@ -723,7 +716,6 @@ DEPENDENCIES
overcommit
pg
phonelib
phony_rails
pkcs11
premailer-rails
proofer!
Expand Down Expand Up @@ -770,7 +762,6 @@ DEPENDENCIES
valid_email
webmock
webpacker (~> 3.4)
whenever
xml-simple
xmlenc (~> 0.6)
zonebie
Expand All @@ -780,4 +771,4 @@ RUBY VERSION
ruby 2.5.1p57

BUNDLED WITH
1.16.1
1.16.2
Binary file added app/assets/images/sp-logos/mycbp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/sp-logos/usaid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/stylesheets/components/_background.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.bg-gray-lighter { background-color: $gray-lighter; }
.bg-light-blue { background-color: $blue-light; }
.bg-lightest-blue { background-color: $blue-lightest; }
.bg-lightest-red { background-color: $red-lightest; }

@media #{$breakpoint-sm} {
.sm-bg-light-blue { background-color: $blue-light; }
Expand Down
22 changes: 22 additions & 0 deletions app/assets/stylesheets/email.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ h4 {

.button.large.expanded table a { padding: 20px 0; }

.button.expanded.large .btn-warn-bkg {
background-color: $white;
border: 0;

&:hover {
background-color: $white;
}
}

.btn-warn-bkg .btn-warn {
background-color: $red-lightest;
border: 2px solid $red;
border-radius: 8px;
color: $gray;
padding: 10px;
width: 50%;
}

.half {
width: 50%;
}

.footer {
background: $secondary-color;

Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/variables/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ $gray-light: #ddd !default;
$gray-lighter: #fafafa !default;
$black: #111 !default;
$pink: #eb4d67 !default;
$red: #f00 !default;
$red-lightest: #fff7f8 !default;
25 changes: 25 additions & 0 deletions app/controllers/account_reset/cancel_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module AccountReset
class CancelController < ApplicationController
def cancel
if AccountResetService.cancel_request(params[:token])
handle_success
else
handle_failure
end
redirect_to root_url
end

private

def handle_success
analytics.track_event(Analytics::ACCOUNT_RESET, event: :cancel, token_valid: true)
sign_out if current_user
flash[:success] = t('devise.two_factor_authentication.account_reset.successful_cancel')
end

def handle_failure
return if params[:token].blank?
analytics.track_event(Analytics::ACCOUNT_RESET, event: :cancel, token_valid: false)
end
end
end
12 changes: 12 additions & 0 deletions app/controllers/account_reset/confirm_delete_account_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module AccountReset
class ConfirmDeleteAccountController < ApplicationController
def show
email = flash[:email]
if email.blank?
redirect_to root_url
else
render :show, locals: { email: email }
end
end
end
end
12 changes: 12 additions & 0 deletions app/controllers/account_reset/confirm_request_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module AccountReset
class ConfirmRequestController < ApplicationController
def show
email = flash[:email]
if email.blank?
redirect_to root_url
else
render :show, locals: { email: email }
end
end
end
end
48 changes: 48 additions & 0 deletions app/controllers/account_reset/delete_account_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module AccountReset
class DeleteAccountController < ApplicationController
before_action :check_feature_enabled
before_action :prevent_parameter_leak, only: :show
before_action :check_granted_token

def show; end

def delete
analytics.track_event(Analytics::ACCOUNT_RESET, event: :delete, token_valid: true)
email = reset_session_and_set_email
UserMailer.account_reset_complete(email).deliver_later
redirect_to account_reset_confirm_delete_account_url
end

private

def check_feature_enabled
redirect_to root_url unless FeatureManagement.account_reset_enabled?
end

def reset_session_and_set_email
user = @account_reset_request.user
email = user.email
user.destroy!
sign_out
flash[:email] = email
end

def check_granted_token
@account_reset_request = AccountResetRequest.from_valid_granted_token(session[:granted_token])
return if @account_reset_request
analytics.track_event(Analytics::ACCOUNT_RESET, event: :delete, token_valid: false)
redirect_to root_url
end

def prevent_parameter_leak
token = params[:token]
return if token.blank?
if AccountResetRequest.find_by(granted_token: token)&.granted_token_valid?
session[:granted_token] = token
redirect_to url_for
else
redirect_to root_url
end
end
end
end
25 changes: 25 additions & 0 deletions app/controllers/account_reset/report_fraud_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module AccountReset
class ReportFraudController < ApplicationController
def update
if AccountResetService.report_fraud(params[:token])
handle_success
else
handle_failure
end
redirect_to root_url
end

private

def handle_success
analytics.track_event(Analytics::ACCOUNT_RESET, event: :fraud, token_valid: true)
sign_out if current_user
flash[:success] = t('devise.two_factor_authentication.account_reset.successful_cancel')
end

def handle_failure
return if params[:token].blank?
analytics.track_event(Analytics::ACCOUNT_RESET, event: :fraud, token_valid: false)
end
end
end
48 changes: 48 additions & 0 deletions app/controllers/account_reset/request_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module AccountReset
class RequestController < ApplicationController
include TwoFactorAuthenticatable

before_action :check_account_reset_enabled
before_action :confirm_two_factor_enabled

def show; end

def create
analytics.track_event(Analytics::ACCOUNT_RESET, event: :request)
create_request
send_notifications
reset_session_with_email
redirect_to account_reset_confirm_request_url
end

private

def check_account_reset_enabled
redirect_to root_url unless FeatureManagement.account_reset_enabled?
end

def reset_session_with_email
email = current_user.email
sign_out
flash[:email] = email
end

def send_notifications
SmsAccountResetNotifierJob.perform_now(
phone: current_user.phone,
cancel_token: current_user.account_reset_request.request_token
)
UserMailer.account_reset_request(current_user).deliver_later
end

def create_request
AccountResetService.new(current_user).create_request
end

def confirm_two_factor_enabled
return if current_user.two_factor_enabled?

redirect_to phone_setup_url
end
end
end
23 changes: 23 additions & 0 deletions app/controllers/account_reset/send_notifications_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module AccountReset
class SendNotificationsController < ApplicationController
skip_before_action :verify_authenticity_token
before_action :authorize

def update
count = AccountResetService.grant_tokens_and_send_notifications
analytics.track_event(Analytics::ACCOUNT_RESET, event: :notifications, count: count)
render plain: 'ok'
end

private

def authorize
return if auth_token == Figaro.env.account_reset_auth_token
head :unauthorized
end

def auth_token
request.headers['X-API-AUTH-TOKEN']
end
end
end
Loading