Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
42a4db7
LG-9066 Remove the FSM SSN step (#7901)
jmhooper Mar 3, 2023
aa5d45b
CL-8938 - fix idv_document_upload_submitted event (#7918)
n1zyy Mar 3, 2023
c9cd8f3
LG-8580 Remove unsupported inherited proofing code (#7919)
jmhooper Mar 3, 2023
35fb1a0
Remove unused `#alive?` method from the idv session (#7923)
jmhooper Mar 3, 2023
7e9b78d
Remove leftover OTP delivery redirect (#7921)
jmhooper Mar 3, 2023
6183c2e
Friday test hacking/fix file handles error (#7887)
jmax-gsa Mar 3, 2023
6fe00cb
LG-8749: IDV TMX Fraud check event tracking (#7924)
olatifflexion Mar 6, 2023
f1869b4
Added doc on how to fix OpenSSL error in tests (#7925)
jmax-gsa Mar 6, 2023
5acf2ee
Move the method for allowing net connect on start to an around action…
jmhooper Mar 6, 2023
93fab15
Add `#confirm_address_step_complete` to the Idv Step Concern (#7931)
jmhooper Mar 6, 2023
fc5e96b
LG-9134 Don't require users to make a selection from the device profi…
jmhooper Mar 6, 2023
bcf2110
LG-8969: Update error content for po search (#7928)
gina-yamada Mar 7, 2023
092df24
Hash shared secret before checking validity of IRS Attempts API token…
Mar 7, 2023
c9b0952
LG-8527: Limit NewRelic browser instrumentation to supported browsers…
aduth Mar 7, 2023
692a432
Jmax/lg 8889 best effort parsing of aamva exceptions (#7879)
jmax-gsa Mar 7, 2023
5b6d7a8
LG-9097 document capture show outside FSM (#7926)
soniaconnolly Mar 7, 2023
513d0ae
LG-8930 VerifyInfo, show DOB with full month name (#7930)
soniaconnolly Mar 7, 2023
b0d263d
LG-9085 Add address_line2_present to verify proofing results analytic…
soniaconnolly Mar 7, 2023
3a3b3a9
LG-8896: Fix heading order for personal key reactivation (#7942)
aduth Mar 7, 2023
5806f00
Update rack to 2.2.6.3 (#7945)
jmhooper Mar 7, 2023
c4500c4
LG-7832: Transliterate name, address, and city for USPS API (w/ FF) (…
NavaTim Mar 7, 2023
f0f383a
Log LexisNexis errors even on successful transactions (#7943)
jmhooper Mar 7, 2023
683ab69
LG-7832: Preserve State ID and Address form data on invalid submissio…
NavaTim Mar 7, 2023
89290d6
LG-9033: Authentication, Simplify SMS phone setup page (#7920)
mdiarra3 Mar 8, 2023
8ef4a80
Use POST route consistently for phone creation (#7944)
aduth Mar 8, 2023
2469f2a
Add `#confirm_verify_info_step_complete` to the IdV step concern (#7941)
jmhooper Mar 8, 2023
ea90d2c
LG-9091: update consent screen for reverified accounts (#7946)
mdiarra3 Mar 8, 2023
2dfeba1
GetUspsProofingResultsJob refactor (#7937)
Mar 8, 2023
bd5d12b
LG-9002: Add in_person_capture_secondary_id_enabled feature flag (#7949)
eileen-nava Mar 8, 2023
9f2fef4
Do not return HTTP 500 when cross-site request forgery token is inval…
Mar 9, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Vagrantfile
/doc/

package-lock.json
browsers.json

saml_*.txt
saml_*.shr
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ GEM
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.6.2)
rack (2.2.6.2)
rack (2.2.6.3)
rack-attack (6.5.0)
rack (>= 1.0, < 3)
rack-cors (1.1.1)
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ brakeman: ## Runs brakeman
public/packs/manifest.json: yarn.lock $(shell find app/javascript -type f) ## Builds JavaScript assets
yarn build

browsers.json: yarn.lock .browserslistrc ## Generates browsers.json browser support file
yarn generate-browsers-json

test: export RAILS_ENV := test
test: $(CONFIG) ## Runs RSpec and yarn tests in parallel
bundle exec rake parallel:spec && yarn test
Expand All @@ -153,7 +156,7 @@ tmp/$(HOST)-$(PORT).key tmp/$(HOST)-$(PORT).crt: ## Self-signed cert for local H
-keyout tmp/$(HOST)-$(PORT).key \
-out tmp/$(HOST)-$(PORT).crt

run: ## Runs the development server
run: browsers.json ## Runs the development server
foreman start -p $(PORT)

urn:
Expand All @@ -165,8 +168,10 @@ run-https: tmp/$(HOST)-$(PORT).key tmp/$(HOST)-$(PORT).crt ## Runs the developme

normalize_yaml: ## Normalizes YAML files (alphabetizes keys, fixes line length, smart quotes)
yarn normalize-yaml .rubocop.yml --disable-sort-keys --disable-smart-punctuation
find ./config/locales/transliterate -type f -name '*.yml' -exec yarn normalize-yaml --disable-sort-keys --disable-smart-punctuation {} \;
find ./config/locales/telephony -type f -name '*.yml' | xargs yarn normalize-yaml --disable-smart-punctuation
find ./config/locales -not -path "./config/locales/telephony*" -type f -name '*.yml' | xargs yarn normalize-yaml \
find ./config/locales -not \( -path "./config/locales/telephony*" -o -path "./config/locales/transliterate/*" \) -type f -name '*.yml' | \
xargs yarn normalize-yaml \
config/pinpoint_supported_countries.yml \
config/pinpoint_overrides.yml \
config/country_dialing_codes.yml
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,14 @@ If you are getting the error:
LoadError: cannot load such file -- sassc
```
Try `make run` for a short time, then use Ctrl+C to kill it

##### Errors relating to OpenSSL versions

If you get this error during test runs:
```
Failure/Error: JWT::JWK.import(certs_response[:keys].first).public_key
OpenSSL::PKey::PKeyError:
rsa#set_key= is incompatible with OpenSSL 3.0
```
See [this document](docs/FixingOpenSSLVersionProblem.md) for how to fix it.

1 change: 0 additions & 1 deletion app/assets/images/2FA-voice.svg

This file was deleted.

Binary file removed app/assets/images/inherited_proofing/switch.png
Binary file not shown.
Binary file removed app/assets/images/shield-spinner.gif
Binary file not shown.
19 changes: 0 additions & 19 deletions app/assets/stylesheets/components/_alert-icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@
height: 88px;
}

// For displaying icons as "badges"
// at the top of modals
.iconic-modal-badge {
position: relative;
&::before {
background-repeat: no-repeat;
background-size: contain;
content: '';
position: absolute;
left: 50%;
top: 0px;
transform: translateX(-50%) translateY(-50%);
height: 88px;
width: 88px;
}
&.personal-key-badge::before {
background-image: url('status/personal-key.svg');
}
}
.alert-icon--centered-top {
position: absolute;
left: 50%;
Expand Down
42 changes: 39 additions & 3 deletions app/controllers/api/irs_attempts_api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def serve_s3_response(log_file_record:)

def authenticate_client
bearer, csp_id, token = request.authorization&.split(' ', 3)
if bearer != 'Bearer' || !valid_auth_tokens.include?(token) ||
if bearer != 'Bearer' || !valid_auth_token?(token) ||
csp_id != IdentityConfig.store.irs_attempt_api_csp_id
analytics.irs_attempts_api_events(
**analytics_properties(
Expand All @@ -118,6 +118,26 @@ def authenticate_client
end
end

def valid_auth_token?(token)
valid_auth_data = hashed_valid_auth_data
cost = valid_auth_data[:cost]
salt = valid_auth_data[:salt]
hashed_token = scrypt_digest(token: token, salt: salt, cost: cost)

valid_auth_data[:digested_tokens].any? do |valid_hashed_token|
ActiveSupport::SecurityUtils.secure_compare(
valid_hashed_token,
hashed_token,
)
end
end

def scrypt_digest(token:, salt:, cost:)
scrypt_salt = cost + OpenSSL::Digest::SHA256.hexdigest(salt)
scrypted = SCrypt::Engine.hash_secret token, scrypt_salt, 32
SCrypt::Password.new(scrypted).digest
end

# @return [Array<String>] JWE strings
def security_event_tokens
return [] unless timestamp
Expand Down Expand Up @@ -146,8 +166,24 @@ def s3_helper
@s3_helper ||= JobHelpers::S3Helper.new
end

def valid_auth_tokens
IdentityConfig.store.irs_attempt_api_auth_tokens
def hashed_valid_auth_data
key = IdentityConfig.store.irs_attempt_api_auth_tokens.map do |token|
OpenSSL::Digest::SHA256.hexdigest(token)
end.join(',')

Rails.cache.fetch("irs_hashed_tokens:#{key}", expires_in: 48.hours) do
salt = SecureRandom.hex(32)
cost = IdentityConfig.store.scrypt_cost
digested_tokens = IdentityConfig.store.irs_attempt_api_auth_tokens.map do |token|
scrypt_digest(token: token, salt: salt, cost: cost)
end

{
salt: salt,
cost: cost,
digested_tokens: digested_tokens,
}
end
end

def analytics_properties(authenticated:, elapsed_time:)
Expand Down
37 changes: 0 additions & 37 deletions app/controllers/concerns/allowlisted_flow_step_concern.rb

This file was deleted.

6 changes: 6 additions & 0 deletions app/controllers/concerns/idv/step_utilities_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ def flow_path
def confirm_pii_from_doc
@pii = flow_session&.[]('pii_from_doc') # hash with indifferent access
return if @pii.present?

flow_session&.delete('Idv::Steps::DocumentCaptureStep')
redirect_to idv_doc_auth_url
end

def confirm_profile_not_already_confirmed
return unless idv_session.profile_confirmation == true
redirect_to idv_review_url
end

# Copied from capture_doc_flow.rb
# and from doc_auth_flow.rb
def acuant_sdk_ab_test_analytics_args
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def async_state_done(current_async_state)
# todo: add other edited fields?
extra: {
address_edited: !!flow_session['address_edited'],
address_line2_present: !pii[:address2].blank?,
pii_like_keypaths: [[:errors, :ssn], [:response_body, :first_name]],
},
)
Expand Down Expand Up @@ -230,6 +231,7 @@ def add_proofing_costs(results)
elsif stage == :threatmetrix
# transaction_id comes from request_id
tmx_id = hash[:transaction_id]
log_irs_tmx_fraud_check_event(hash) if tmx_id
add_cost(:threatmetrix, transaction_id: tmx_id) if tmx_id
end
end
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/concerns/idv_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ module IdvSession
before_action :redirect_if_sp_context_needed
end

def confirm_idv_applicant_created
redirect_to idv_verify_info_url if idv_session.applicant.blank?
end

def confirm_idv_needed
return if effective_user.active_profile.blank? ||
decorated_session.requested_more_recent_verification? ||
Expand Down
16 changes: 16 additions & 0 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,20 @@ module IdvStepConcern
before_action :confirm_two_factor_authenticated
before_action :confirm_idv_needed
end

def confirm_verify_info_step_complete
return if idv_session.verify_info_step_complete?

if idv_session.in_person_enrollment?
redirect_to idv_in_person_verify_info_url
else
redirect_to idv_verify_info_url
end
end

def confirm_address_step_complete
return if idv_session.address_step_complete?

redirect_to idv_otp_verification_url
end
end
13 changes: 0 additions & 13 deletions app/controllers/concerns/inherited_proofing_404_concern.rb

This file was deleted.

47 changes: 0 additions & 47 deletions app/controllers/concerns/inherited_proofing_concern.rb

This file was deleted.

15 changes: 0 additions & 15 deletions app/controllers/concerns/inherited_proofing_presenter_concern.rb

This file was deleted.

19 changes: 16 additions & 3 deletions app/controllers/concerns/verify_sp_attributes_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def needs_completion_screen_reason
:new_sp
elsif !requested_attributes_verified?(sp_session_identity)
:new_attributes
elsif reverified_after_consent?(sp_session_identity)
:reverified_after_consent
elsif consent_has_expired?(sp_session_identity)
:consent_expired
elsif consent_was_revoked?(sp_session_identity)
Expand All @@ -30,19 +32,30 @@ def update_verified_attributes
def consent_has_expired?(sp_session_identity)
return false unless sp_session_identity
return false if sp_session_identity.deleted_at.present?
last_estimated_consent = sp_session_identity.last_consented_at || sp_session_identity.created_at
last_estimated_consent = last_estimated_consent_for(sp_session_identity)
!last_estimated_consent ||
last_estimated_consent < ServiceProviderIdentity::CONSENT_EXPIRATION.ago ||
verified_after_consent?(last_estimated_consent)
last_estimated_consent < ServiceProviderIdentity::CONSENT_EXPIRATION.ago
end

def consent_was_revoked?(sp_session_identity)
return false unless sp_session_identity
sp_session_identity.deleted_at.present?
end

def reverified_after_consent?(sp_session_identity)
return false unless sp_session_identity
return false if sp_session_identity.deleted_at.present?
last_estimated_consent = last_estimated_consent_for(sp_session_identity)
return false if last_estimated_consent.nil?
verified_after_consent?(last_estimated_consent)
end

private

def last_estimated_consent_for(sp_session_identity)
sp_session_identity.last_consented_at || sp_session_identity.created_at
end

def verified_after_consent?(last_estimated_consent)
verification_timestamp = current_user.active_profile&.verified_at

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/doc_auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DocAuthController < ApplicationController

FLOW_STATE_MACHINE_SETTINGS = {
step_url: :idv_doc_auth_step_url,
final_url: :idv_review_url,
final_url: :idv_ssn_url,
flow: Idv::Flows::DocAuthFlow,
analytics_id: 'Doc Auth',
}.freeze
Expand Down
Loading