Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3bafda6
LG-259 Password reset tokens should not leak to third party resources…
stevegsa Jun 3, 2018
0b5405d
LG-320 Account History should log when their personal key is changed
stevegsa Jun 4, 2018
50c7945
Fix check for hub installation in release script (#2218)
jmhooper Jun 4, 2018
1f886f3
Write to encrypted personal key digest (#2220)
jmhooper Jun 4, 2018
de7bcdd
LG-351 Rate limiting does not work as expected in all cases of an ema…
stevegsa Jun 6, 2018
181688f
Merge pull request #2222 from 18F/stevegsa-fix-bypassing-rate-limit-o…
stevegsa Jun 6, 2018
2fbfbf0
Merge pull request #2217 from 18F/stevegsa-account-history-should-log…
stevegsa Jun 6, 2018
948bd29
LG-311 Prevent bypassing account lockout when sending the SMS verific…
stevegsa Jun 4, 2018
d1e7809
LG-315 Can't submit personal key after typo
stevegsa Jun 3, 2018
f8e02f4
Merge pull request #2216 from 18F/stevegsa-bypass-account-lockout-sen…
stevegsa Jun 6, 2018
288c56a
Merge pull request #2215 from 18F/stevegsa-fix-personal-key-submit-af…
stevegsa Jun 6, 2018
0d75e16
Upgrade sinatra (#2224)
jmhooper Jun 7, 2018
a4e0072
Read Pii encryption salt/cost from ciphertext (#2223)
jmhooper Jun 7, 2018
14af7bc
LG-162: Multiple 2FA options during registration
Apr 12, 2018
a2b7716
Merge pull request #2214 from 18F/stevegsa-fix-password-reset-token-l…
stevegsa Jun 7, 2018
075f2d9
LG-283 Fix password reset links sent to unconfirmed email address
mryenq May 18, 2018
501b145
LG-283 Fix password reset links sent to unconfirmed email address
mryenq Jun 8, 2018
68813cd
Merge pull request #2099 from 18F/sw-2fa-options
monfresh Jun 8, 2018
a547cb9
Merge pull request #2182 from 18F/use-existing-email-for-password-and…
mryenq Jun 8, 2018
ff8e47a
Update secure_headers from 3.7.3 to 6.0.0
monfresh May 17, 2018
51ee56b
LG-309 Allow dynamic service provider updates in production
stevegsa Jun 10, 2018
3ecdd90
Merge pull request #2175 from 18F/mb-update-secure-headers
monfresh Jun 11, 2018
b9d791c
Update .rubocop.yml and fix offenses
monfresh Jun 11, 2018
99864f8
Merge pull request #2228 from 18F/mb-update-rubocop
monfresh Jun 12, 2018
2bba1df
LG-367 Update certificate for Secret Service PIX sp in production
stevegsa Jun 13, 2018
eb50464
LG-368 Account History should log when password changed from reset
stevegsa Jun 13, 2018
69a2687
Merge pull request #2233 from 18F/stevegsa-log-password-change-event-…
stevegsa Jun 13, 2018
c991396
Merge pull request #2232 from 18F/stevegsa-update-cert-for-secret-ser…
stevegsa Jun 13, 2018
b55f65f
[LG-358] Allow piv/cac as 2fa for account creation
jgsmith-usds Jun 13, 2018
6e130c0
Merge pull request #2234 from 18F/jgs/lg-358-allow-pivcac-as-2fa-duri…
jgsmith-usds Jun 13, 2018
f4adcf3
LG-288 Add password verifier (#2226)
jmhooper Jun 14, 2018
37af366
[LG-272] Support randomizable Piv/Cac service URLs
jgsmith-usds Jun 14, 2018
a17ef76
LG 360 LOA1 fail states (#2231)
davemcorwin Jun 14, 2018
5e13d4b
LG-355 Add USAID logo
stevegsa Jun 14, 2018
5b31832
Upgrade AAMVA to v3.0.1 (#2241)
jmhooper Jun 14, 2018
224809b
Merge pull request #2237 from 18F/jgs/lg-272-support-random-pivcac-se…
jgsmith-usds Jun 14, 2018
bc01086
Revert background to blue for car wide layout (#2243)
davemcorwin Jun 14, 2018
ff5efa4
Merge pull request #2239 from 18F/stevegsa-usaid-logo
stevegsa Jun 14, 2018
d99cad5
LG-356 Add help text to the account creation screen for SAM
stevegsa Jun 11, 2018
fb63670
Merge pull request #2230 from 18F/stevegsa-help-text-for-sam-account-…
stevegsa Jun 15, 2018
1de4023
LG-353 Add sufficient request tracing to be able to better diagnose t…
stevegsa Jun 14, 2018
6b63578
Merge pull request #2245 from 18F/stevegsa-enhanced-new-relic-tracing
stevegsa Jun 15, 2018
a88dbb9
Update Ruby from 2.3.5 to 2.5.0
monfresh Feb 2, 2018
f962ffe
Fix Rubocop offenses specific to Ruby 2.4+
monfresh Feb 17, 2018
34a938e
LG-322 PIV/CAC users must set up a phone number
monfresh Jun 12, 2018
86f69a1
Merge pull request #1997 from 18F/mb-update-ruby
monfresh Jun 15, 2018
5ccdfb6
Merge pull request #2244 from 18F/mb-piv-cac-require-backup-phone
monfresh Jun 15, 2018
08689c7
Don't check attempt count on success step (#2246)
jmhooper Jun 15, 2018
9e783d7
[LG-257] Use redirection to hide nonce from HTML
jgsmith-usds Jun 14, 2018
aed8e14
Merge pull request #2236 from 18F/jgs/lg-257-redirect-to-pivcac-rathe…
jgsmith-usds Jun 15, 2018
fcdd895
LG-372 Update SAM SP in production
stevegsa Jun 15, 2018
5d2d2a4
Merge pull request #2248 from 18F/stevegsa-update-sam-sp
stevegsa Jun 15, 2018
085e1ce
[LG-267] Auth requests to decode pivcac tokens (#2242)
jgsmith-usds Jun 15, 2018
a676258
Move Encryptor into the encryption namespace (#2249)
jmhooper Jun 15, 2018
d518db6
LG-376 Add DOE / Fossil Energy SP to production
stevegsa Jun 15, 2018
31f1394
LG 362 jurisdiction fail screens (#2247)
davemcorwin Jun 15, 2018
356c831
Merge pull request #2251 from 18F/stevegsa-add-fossil-energy-sp
stevegsa Jun 15, 2018
3142ae6
Remove warning constant initialized on MAX_BACKTRACE_FRAMES
stevegsa Jun 15, 2018
875c7f4
LG-373 Use correct 2FA options link for PIV/CAC
monfresh Jun 15, 2018
a2d9697
Merge pull request #2252 from 18F/update-new-relic-tracing
stevegsa Jun 15, 2018
15fa53d
Merge pull request #2253 from 18F/mb-backup-phone-options-link
monfresh Jun 15, 2018
9d7f5f3
Don't set up 2fa without authenticating first
jgsmith-usds Jun 15, 2018
9d574e8
Merge pull request #2250 from 18F/prevent-adding-phone-during-authent…
jgsmith-usds Jun 18, 2018
57b1441
Merge pull request #2227 from 18F/stevegsa-dynamic-service-provider-u…
stevegsa Jun 19, 2018
98bd394
Fix presenter in Users::PhonesController#update
monfresh Jun 19, 2018
916f275
Merge pull request #2255 from 18F/mb-fix-phones-controller
monfresh Jun 19, 2018
722ed90
Merge branch 'master' into stages/rc-2018-06-22
davemcorwin Jun 19, 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
parallelism: 4
docker:
# Specify the Ruby version you desire here
- image: circleci/ruby:2.3-node-browsers
- image: circleci/ruby:2.5.1-node-browsers
environment:
RAILS_ENV: test
CC_TEST_REPORTER_ID: faecd27e9aed532634b3f4d3e251542d7de9457cfca96a94208a63270ef9b42e
Expand Down
2 changes: 1 addition & 1 deletion .reek
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ LongParameterList:
- Idv::ProoferJob#perform
- Idv::VendorResult#initialize
- JWT
- Pii::Attributes#self.new_from_encrypted
RepeatedConditional:
exclude:
- Users::ResetPasswordsController
Expand Down Expand Up @@ -100,6 +99,7 @@ TooManyStatements:
- Idv::Agent#proof
- Idv::Proofer#configure_vendors
- Idv::VendorResult#initialize
- SamlIdpController#auth
- Upaya::QueueConfig#self.choose_queue_adapter
- Upaya::RandomTools#self.random_weighted_sample
- UserFlowFormatter#stop
Expand Down
20 changes: 11 additions & 9 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ AllCops:
- '**/Rakefile'
- '**/Capfile'
Exclude:
- 'bin/**/*'
- 'db/migrate/*'
- 'db/schema.rb'
- 'node_modules/**/*'
- 'lib/rspec/user_flow_formatter.rb'
- 'lib/tasks/create_test_accounts.rb'
- 'lib/user_flow_exporter.rb'
- 'scripts/load_testing/*'
- 'spec/**/*'
- 'node_modules/**/*'
- 'tmp/**/*'
- 'bin/**/*'
- 'db/migrate/*'
- 'lib/tasks/create_test_accounts.rb'
TargetRubyVersion: 2.3
TargetRubyVersion: 2.5
TargetRailsVersion: 5.1
UseCache: true

Expand Down Expand Up @@ -65,6 +63,7 @@ Metrics/ClassLength:
- app/controllers/users/confirmations_controller.rb
- app/controllers/users/sessions_controller.rb
- app/controllers/devise/two_factor_authentication_controller.rb
- app/decorators/service_provider_session_decorator.rb
- app/decorators/user_decorator.rb
- app/services/analytics.rb
- app/services/idv/session.rb
Expand Down Expand Up @@ -103,10 +102,13 @@ Metrics/ModuleLength:
Metrics/ParameterLists:
CountKeywordArgs: false

# This is a Rails 5 feature, so it should be disabled until we upgrade
Naming/VariableName:
Exclude:
- 'spec/services/pii/nist_encryption_spec.rb'

Rails/HttpPositionalArguments:
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
Enabled: false
Enabled: true
Include:
- 'spec/**/*'
- 'test/**/*'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3
2.5
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the official Ruby image because the Rails images have been deprecated
FROM ruby:2.3
FROM ruby:2.5

# Install packages of https
RUN apt-get update && apt-get install apt-transport-https
Expand All @@ -15,13 +15,16 @@ RUN apt-get update \

RUN ln -s ../node/bin/node /usr/local/bin/
RUN ln -s ../node/bin/npm /usr/local/bin/
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get install yarn

ADD https://dl.yarnpkg.com/debian/pubkey.gpg /tmp/yarn-pubkey.gpg
RUN apt-key add /tmp/yarn-pubkey.gpg && rm /tmp/yarn-pubkey.gpg
RUN echo 'deb http://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y --no-install-recommends yarn

WORKDIR /upaya

COPY package.json /upaya
COPY yarn.lock /upaya

COPY Gemfile /upaya
COPY Gemfile.lock /upaya
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }

ruby '~> 2.3.7'
ruby '~> 2.5.1'

gem 'rails', '~> 5.1.3'

Expand Down Expand Up @@ -49,7 +49,7 @@ gem 'saml_idp', git: 'https://github.com/18F/saml_idp.git', tag: 'v0.7.0-18f'
gem 'sass-rails', '~> 5.0'
gem 'savon'
gem 'scrypt'
gem 'secure_headers', '~> 3.0'
gem 'secure_headers', '~> 6.0'
gem 'sidekiq'
gem 'simple_form'
gem 'sinatra', require: false
Expand Down Expand Up @@ -114,7 +114,7 @@ group :test do
end

group :production do
gem 'aamva', git: 'git@github.com:18F/identity-aamva-api-client-gem', tag: 'v3.0.0'
gem 'aamva', git: 'git@github.com:18F/identity-aamva-api-client-gem', tag: 'v3.0.1'
gem 'equifax', git: 'git@github.com:18F/identity-equifax-api-client-gem.git', tag: 'v1.1.0'
gem 'lexisnexis', git: 'git@github.com:18F/identity-lexisnexis-api-client-gem', tag: 'v1.0.0'
end
22 changes: 10 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: git@github.com:18F/identity-aamva-api-client-gem
revision: 41cf170a0161883f3a4a34f5a5edbb186a36bc06
tag: v3.0.0
revision: 015186dd86691294404229ee051cfcf9e87fb6c7
tag: v3.0.1
specs:
aamva (3.0.0)
aamva (3.0.1)
dotenv
hashie
httpi
Expand Down Expand Up @@ -272,7 +272,7 @@ GEM
fasterer (0.4.1)
colorize (~> 0.7)
ruby_parser (~> 3.11.0)
ffi (1.9.23)
ffi (1.9.25)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
Expand Down Expand Up @@ -415,7 +415,7 @@ GEM
rack-headers_filter (0.0.1)
rack-mini-profiler (1.0.0)
rack (>= 1.2.0)
rack-protection (2.0.1)
rack-protection (2.0.2)
rack
rack-proxy (0.6.4)
rack
Expand Down Expand Up @@ -543,8 +543,7 @@ GEM
wasabi (~> 3.4)
scrypt (3.0.5)
ffi-compiler (>= 1.0, < 2.0)
secure_headers (3.7.3)
useragent
secure_headers (6.0.0)
selenium-webdriver (3.11.0)
childprocess (~> 0.5)
rubyzip (~> 1.2)
Expand All @@ -565,10 +564,10 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (2.0.1)
sinatra (2.0.2)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.1)
rack-protection (= 2.0.2)
tilt (~> 2.0)
slim (3.0.9)
temple (>= 0.7.6, < 0.9)
Expand Down Expand Up @@ -626,7 +625,6 @@ GEM
unicode-display_width (1.3.0)
uniform_notifier (1.11.0)
user_agent_parser (2.4.1)
useragent (0.16.8)
uuid (2.3.9)
macaddr (~> 1.0)
valid_email (0.1.0)
Expand Down Expand Up @@ -754,7 +752,7 @@ DEPENDENCIES
sass-rails (~> 5.0)
savon
scrypt
secure_headers (~> 3.0)
secure_headers (~> 6.0)
shoulda-matchers (~> 3.0)
sidekiq
simple_form
Expand All @@ -779,7 +777,7 @@ DEPENDENCIES
zxcvbn-js

RUBY VERSION
ruby 2.3.7p456
ruby 2.5.1p57

BUNDLED WITH
1.16.1
1 change: 1 addition & 0 deletions app/assets/images/2FA-sms.svg
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/images/2FA-voice.svg
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/images/alert/fail-x.svg
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/images/alert/temp-lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/sp-logos/doe.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 added 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.
18 changes: 18 additions & 0 deletions app/controllers/account_recovery_setup_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class AccountRecoverySetupController < ApplicationController
include AccountRecoverable
include UserAuthenticator

before_action :confirm_two_factor_authenticated

def index
return redirect_to account_url unless piv_cac_enabled_but_not_phone_enabled?
@two_factor_options_form = TwoFactorOptionsForm.new(current_user)
@presenter = account_recovery_options_presenter
end

private

def account_recovery_options_presenter
AccountRecoveryOptionsPresenter.new
end
end
11 changes: 8 additions & 3 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def confirm_two_factor_authenticated
end

def prompt_to_set_up_2fa
redirect_to phone_setup_url
redirect_to two_factor_options_url
end

def prompt_to_enter_otp
Expand All @@ -184,12 +184,17 @@ def sp_session
end

def render_not_found
render template: 'pages/page_not_found', layout: false, status: 404, formats: :html
render template: 'pages/page_not_found', layout: false, status: :not_found, formats: :html
end

def render_timeout(exception)
analytics.track_event(Analytics::RESPONSE_TIMED_OUT, analytics_exception_info(exception))
render template: 'pages/page_took_too_long', layout: false, status: 503, formats: :html
render template: 'pages/page_took_too_long',
layout: false, status: :service_unavailable, formats: :html
end

def render_full_width(template, **opts)
render template, **opts, layout: 'base'
end

def analytics_exception_info(exception)
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/concerns/account_recoverable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module AccountRecoverable
def piv_cac_enabled_but_not_phone_enabled?
current_user.piv_cac_enabled? && !current_user.phone_enabled?
end
end
11 changes: 11 additions & 0 deletions app/controllers/concerns/authorizable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Authorizable
def authorize_user
return unless current_user.phone_enabled?

if user_fully_authenticated?
redirect_to account_url
elsif current_user.two_factor_enabled?
redirect_to user_two_factor_authentication_url
end
end
end
22 changes: 11 additions & 11 deletions app/controllers/concerns/two_factor_authenticatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,21 @@ def authenticate_user

def handle_second_factor_locked_user(type)
analytics.track_event(Analytics::MULTI_FACTOR_AUTH_MAX_ATTEMPTS)
decorator = current_user.decorate
sign_out
render(
'two_factor_authentication/shared/max_login_attempts_reached',
locals: { type: type, decorator: decorator }
)
handle_max_attempts(type + '_login_attempts')
end

def handle_too_many_otp_sends
analytics.track_event(Analytics::MULTI_FACTOR_AUTH_MAX_SENDS)
decorator = current_user.decorate
sign_out
render(
'two_factor_authentication/shared/max_otp_requests_reached',
locals: { decorator: decorator }
handle_max_attempts('otp_requests')
end

def handle_max_attempts(type)
presenter = TwoFactorAuthCode::MaxAttemptsReachedPresenter.new(
type,
decorated_user
)
sign_out
render_full_width('shared/_failure', locals: { presenter: presenter })
end

def require_current_password
Expand Down Expand Up @@ -254,6 +253,7 @@ def authenticator_view_data
two_factor_authentication_method: two_factor_authentication_method,
user_email: current_user.email,
remember_device_available: false,
phone_enabled: current_user.phone_enabled?,
}.merge(generic_data)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/unconfirmed_user_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def after_confirmation_url_for(user)
elsif user.two_factor_enabled?
account_url
else
phone_setup_url
two_factor_options_url
end
end

Expand Down
8 changes: 6 additions & 2 deletions app/controllers/idv/jurisdiction_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ def create
end

def show
@state = user_session[:idv_jurisdiction]
@reason = params[:reason]
presenter = JurisdictionFailurePresenter.new(
reason: params[:reason],
jurisdiction: user_session[:idv_jurisdiction],
view_context: view_context
)
render_full_width('shared/_failure', locals: { presenter: presenter })
end

def jurisdiction_params
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class SessionsController < ApplicationController
include PersonalKeyConcern

before_action :confirm_two_factor_authenticated, except: [:destroy]
before_action :confirm_idv_attempts_allowed
before_action :confirm_idv_attempts_allowed, except: %i[destroy success]
before_action :confirm_idv_needed
before_action :confirm_step_needed, except: %i[destroy success]
before_action :initialize_idv_session, only: [:create]
Expand Down
Loading