ProgressiveProofer refactor 1/N: ThreatMetrix#11420
Merged
Conversation
For now, just take the proof_with_threatmetrix_if_needed method + deps and move into a different file. [skip changelog]
matthinz
commented
Oct 29, 2024
| it 'returns a ResultAdjudicator' do | ||
| expect(proof).to be_an_instance_of(Proofing::Resolution::ResultAdjudicator) | ||
| expect(proof.same_address_as_id).to eq(nil) | ||
| context 'remote unsupervised proofing' do |
Contributor
Author
There was a problem hiding this comment.
This diff is a little messy, but my goal is to, at the end of this refactor, have two top level contexts here: remote unsupervised proofing and in-person proofing.
zachmargolis
approved these changes
Oct 29, 2024
app/services/proofing/resolution/plugins/threat_metrix_plugin.rb
Outdated
Show resolved
Hide resolved
spec/services/proofing/resolution/plugins/threatmetrix_plugin_spec.rb
Outdated
Show resolved
Hide resolved
spec/services/proofing/resolution/plugins/threatmetrix_plugin_spec.rb
Outdated
Show resolved
Hide resolved
mdiarra3
approved these changes
Oct 30, 2024
| if IdentityConfig.store.lexisnexis_threatmetrix_mock_enabled | ||
| Proofing::Mock::DdpMockClient.new | ||
| else | ||
| Proofing::LexisNexis::Ddp::Proofer.new( |
Contributor
There was a problem hiding this comment.
Just a heads up. Will be updating the config to add a "policy" attribute since we have decided for Authentication we will have a different policy. But otherwise. Taking a look this shouldn't affect our implementation much. may be a merge conflict depending on whats merged first.
jmhooper
approved these changes
Oct 30, 2024
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Allows much cleaner (1-line) checking of whether the plugin modifies cost counts
6 tasks
This was referenced Oct 30, 2024
n1zyy
approved these changes
Oct 31, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🛠 Summary of changes
Ahead of integrating a new vendor into the ProgressiveProofer, I'm going to do a series of PRs that extract code for individual vendors out into separate files/classes. I'm calling these "plugins" because I think that will ultimately describe the kind of architecture we're going for here, but for now these are basically just the old
proof_with_X_if_neededmethods extracted out into a new class with acallmethod.Right now, each plugin's
callmethod lays out exactly what its dependencies are. Each plugin also gets its own spec file, mainly focused on these primary scenarios:In some cases I am pulling spec code out of the existing ProgressiveProofer spec, and in some cases I am modifying it slightly to ensure it addresses the above scenarios.
This PR implements the first (and simplest) "plugin", which does the ThreatMetrix Session Query API call. There are not significant differences in implementation for the Remote and IPP flows here, and there's not really any "new" code being introduced--this is mostly moving existing code around.
See also
📜 Testing Plan
Provide a checklist of steps to confirm the changes.