-
Notifications
You must be signed in to change notification settings - Fork 166
LG-14525: threatmetrix api account creation #11340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
0672b43
Threat metrix initial page
mdiarra3 ca28316
Merge remote-tracking branch 'origin/main' into LG-14396-threat-metri…
mdiarra3 4567c2a
threat metrix helper
mdiarra3 515d5e2
changelog: Upcoming Features, Account creation, Threat metrix addiition
mdiarra3 f14704d
Merge remote-tracking branch 'origin/main' into LG-14396-threat-metri…
mdiarra3 74ad2e0
fix up threatmetrix naming
mdiarra3 fa122ec
fix true
mdiarra3 3fd3fcc
fix up rubocop
mdiarra3 5c3e765
add override for csp for threat metrix
mdiarra3 4298a2d
fix linting
mdiarra3 56fcfe4
update to move threatmetrix to idv
mdiarra3 faa2df7
add new line
mdiarra3 9ba837d
fix indentationg
mdiarra3 c9ba668
make threat metrix profiling into a separate partial
mdiarra3 8eb441f
fix styling indentation
mdiarra3 1a96823
Threat metrix helper adjustment
mdiarra3 6792efe
add regtistrations threat metrix spec
mdiarra3 1a79185
fix ssn controller and spec
mdiarra3 eab8541
Merge remote-tracking branch 'origin/main' into LG-14525-threatmetrix…
mdiarra3 ef1fab8
threatmetrix api
mdiarra3 ee351e8
update to use locals
mdiarra3 e7fd870
return empty hash
mdiarra3 e009030
Merge remote-tracking branch 'origin/LG-14396-threat-metrix-create-ac…
mdiarra3 7171cc0
update proofer
mdiarra3 8694d68
add device profiling work
mdiarra3 0ddeaf1
Move device profiling over
mdiarra3 5f27b67
changelog: Upcoming Features, Authentication Threat Metrix, API creation
mdiarra3 a259be7
add spec for threat_metrix helper
mdiarra3 68bd93d
Merge remote-tracking branch 'origin/main' into LG-14525-threatmetrix…
mdiarra3 eca8a7e
refactor to just parametize proofer
mdiarra3 580ad9e
fix rubocop issues
mdiarra3 759b82c
fix initial rspec
mdiarra3 47c2f72
Merge remote-tracking branch 'origin/main' into LG-14525-threatmetrix…
mdiarra3 8bb0689
add spec for verification request for authentication
mdiarra3 3548aab
Merge remote-tracking branch 'origin/main' into LG-14525-threatmetrix…
mdiarra3 1950862
remove threat metrix call in completions controller
mdiarra3 d76d8a7
remove registration emails ref to tmx in completions page
mdiarra3 3e9da1e
fix threatmetrix step helper spec
mdiarra3 edaa3fe
update analytics event
mdiarra3 535783a
change to proofing applicant
mdiarra3 9f66152
fix analytics event lint
mdiarra3 070ab76
update application yml file
mdiarra3 2c679e1
remove current sp
mdiarra3 9661889
use job to query threatmetrix
mdiarra3 fc1853a
update add mfa
mdiarra3 c1a98f3
add mfa spec to make sure job is properly called
mdiarra3 e804b81
fix tests around addmfa call
mdiarra3 20e1048
put back error response
mdiarra3 e81dee6
Merge remote-tracking branch 'origin/main' into LG-14525-threatmetrix…
mdiarra3 6fad48f
remove unneded comments
mdiarra3 a1fa9a8
update completions with empty space
mdiarra3 a284d11
remove device profiling result
mdiarra3 0c7fb63
leverage same verification request
mdiarra3 d9a9cf1
take into account gsub
mdiarra3 efb17ed
update verificationr spec
mdiarra3 28f1cd4
fix rspe
mdiarra3 c3a8e27
address comment, feature flag toggle, and application.yml
mdiarra3 0a1fa28
update identity config
mdiarra3 22ee347
make sure spec is when enabled
mdiarra3 92fc50f
rubocop
mdiarra3 4b090f0
move yml comment, fix spacing and clean up specs
mdiarra3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,24 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| class AccountCreationThreatMetrixJob < ApplicationJob | ||
| def perform( | ||
| user_id: nil, | ||
| threatmetrix_session_id: nil, | ||
| request_ip: nil, | ||
| email: nil | ||
| ) | ||
|
|
||
| device_profiling_result = AccountCreation::DeviceProfiling.new.proof( | ||
| request_ip: request_ip, | ||
| threatmetrix_session_id: threatmetrix_session_id, | ||
| user_email: email, | ||
| ) | ||
| ensure | ||
| user = User.find_by(id: user_id) | ||
| analytics(user).account_creation_tmx_result(**device_profiling_result.to_h) | ||
| end | ||
|
|
||
| def analytics(user) | ||
| Analytics.new(user: user, request: nil, session: {}, sp: nil) | ||
| end | ||
| end |
This file contains hidden or 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,63 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module AccountCreation | ||
| class DeviceProfiling | ||
| attr_reader :request_ip, | ||
| :threatmetrix_session_id, | ||
| :user_email, | ||
| :device_profile_result | ||
| def proof( | ||
| request_ip:, | ||
| threatmetrix_session_id:, | ||
| user_email: | ||
| ) | ||
| @request_ip = request_ip | ||
| @threatmetrix_session_id = threatmetrix_session_id | ||
| @user_email = user_email | ||
|
|
||
| @device_profile_result = device_profile | ||
| end | ||
|
|
||
| def device_profile | ||
| return threatmetrix_disabled_result unless | ||
| FeatureManagement.account_creation_device_profiling_collecting_enabled? | ||
| return threatmetrix_id_missing_result if threatmetrix_session_id.blank? | ||
|
|
||
| proofer.proof( | ||
| threatmetrix_session_id: threatmetrix_session_id, | ||
| email: user_email, | ||
| request_ip: request_ip, | ||
| ) | ||
| end | ||
|
|
||
| def threatmetrix_disabled_result | ||
| Proofing::DdpResult.new( | ||
| success: true, | ||
| client: 'tmx_disabled', | ||
| review_status: 'pass', | ||
| ) | ||
| end | ||
|
|
||
| def threatmetrix_id_missing_result | ||
| Proofing::DdpResult.new( | ||
| success: false, | ||
| client: 'tmx_session_id_missing', | ||
| review_status: 'reject', | ||
| ) | ||
| end | ||
|
|
||
| def proofer | ||
| @proofer ||= | ||
| if IdentityConfig.store.lexisnexis_threatmetrix_mock_enabled | ||
| Proofing::Mock::DdpMockClient.new | ||
| else | ||
| Proofing::LexisNexis::Ddp::Proofer.new( | ||
| api_key: IdentityConfig.store.lexisnexis_threatmetrix_api_key, | ||
| org_id: IdentityConfig.store.lexisnexis_threatmetrix_org_id, | ||
| base_url: IdentityConfig.store.lexisnexis_threatmetrix_base_url, | ||
| ddp_policy: IdentityConfig.store.lexisnexis_threatmetrix_authentication_policy, | ||
| ) | ||
| end | ||
| end | ||
| end | ||
| end | ||
This file contains hidden or 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 hidden or 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 hidden or 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
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this revised direction a lot better 👍 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.