-
Notifications
You must be signed in to change notification settings - Fork 129
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
LG-15456: Source AAMVA requested attributes from request #11826
base: main
Are you sure you want to change the base?
Conversation
# - +1+ - value present | ||
# - +0+ - field is required, but value was blank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe :present
and :blank
or similar. Cloudwatch logs should include 1
or 0
, but for an internal API I think more descriptive values would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Matt's notes.
Overall this looks like a nice improvement. I'm holding off an an approval just since Matt has some suggestions, but otherwise I'm good with this.
@@ -10,27 +10,53 @@ | |||
module Proofing | |||
module Aamva | |||
module Request | |||
RequestAttribute = Data.define(:xpath, :required).freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach!
address1: applicant.address1, | ||
city: applicant.city, | ||
state: applicant.state, | ||
zipcode: applicant.zipcode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 Moving xpath selectors out makes this so much more pleasant. 😄
}, | ||
) | ||
end | ||
end | ||
|
||
context 'when issue / expiration present' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of ignorance on my part, why isn't this test needed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit of functionality is covered in the VerificationRequest spec and the individual attribute specs further up.
**Why** Requested attributes are for our internal analytics to ensure that the fields sent match any errors we get back. Prior to this change, the requested attributes were sourced from the response body, which meant that regardless of what attributes were requested, we would only know about the attributes that were "seen" and processed by DLDV. Without knowing which fields were actually requested, troubleshooting certain errors is challenging as there would be a mismatch between what was actually sent and how AAMVA processed the request. **How** * Added the logic for generating requested attributes to `Proofing::Aamva::Request::VerificationRequest` as part of creating the request body. * Instead of Set, we use a Hash. Attributes that have a value are coded as 1. Core attributes (e.g., birthdate), which are always requested, are coded as 0 when blank. * Added a constant for storing a map of attributes to XPaths to reduce duplication. * Updated the `Proofing::Aamva::Proofer` to build the request and "normalize" the requested attributes Hash per previous business logic. Future work should consider making a subclass that solely handles building the request body. changelog: Bug Fixes, Analytics, Log correct DLDV requested attributes
Co-authored-by: Zach Margolis <[email protected]> Co-authored-by: Matt Hinz <[email protected]>
8e2657c
to
0e95de3
Compare
Why
Requested attributes are for our internal analytics to ensure that the fields sent match any errors we get back. Prior to this change, the requested attributes were sourced from the response body, which meant that regardless of what attributes were requested, we would only know about the attributes that were "seen" and processed by DLDV.
Without knowing which fields were actually requested, troubleshooting certain errors is challenging as there would be a mismatch between what was actually sent and how AAMVA processed the request.
How
Proofing::Aamva::Request::VerificationRequest
as part of creating the request body.Proofing::Aamva::Proofer
to build the request and "normalize" the requested attributes Hash per previous business logic.Future work should consider making a subclass that solely handles building the request body.
changelog: Bug Fixes, Analytics, Log correct DLDV requested attributes
🎫 Ticket
Link to the relevant ticket:
LG-15456