LG-13216: AAMVA issue date + expiration validation (log only)#10653
LG-13216: AAMVA issue date + expiration validation (log only)#10653
Conversation
Make a general-purpose method I can use for other elements.
I'm going to do something similar for requested attributes and want code to reuse
A requested attribute is one where there is a definitive "yes" or "no" in the response.
I don't think we have a good enough picture of what the :enabled setting should do (do we require issue + expiry? in all cases?)
Will leave feature flag development for after the test.
The order of verfied_attributes has changed
797b058 to
48c50af
Compare
| attributes.add :address if address_verified?(results) | ||
| def requested_attributes(verification_response) | ||
| attributes = verification_response. | ||
| verification_results.filter { |_, verified| !verified.nil? }. |
There was a problem hiding this comment.
Is this intended to reflect the requested attributes based on what we see from the response object? The response object iterates over all possible attributes so it will include attributes even if we did not request them:
There was a problem hiding this comment.
Yes, that's what the filter is about -- verification_results will have all attributes present, but any missing attributes will have nil values
There was a problem hiding this comment.
That should work for this issue. 2 things to keep in mind:
- When AAMVA fails to match a DLN it returns a false match indicator for DLN and no match indicator for other attributes. In that case it will appear that we only requested DLN even when we sent a request for all of the PII including issue and expiration date
- Cloudwatch has a tough time handling array parameters and parsing them into something useful. If we could find a way to return keys/values here that may be easier to query when we are trying to visualize this. The
verified_attributesvalue is an array so we can use it in get-to-yes IIRC
There was a problem hiding this comment.
Ooh, I did not know that about DLN. It would be a little more work to look at the request itself (currently the proofer just does client.send_verification_request, and doesn't actually get a copy of the request data).
I can change requested_attributes to a hash no prob, I might poke around and see if it is worth doing verified_attributes as well
|
For the Test Plan, why would the attributes be missing the second time through? |
Doh, good catch, I removed the feature flag this would've been testing |
solipet
left a comment
There was a problem hiding this comment.
One nit, one curiosity, but LGTM.
| state_id_type: 'drivers_license', | ||
| state_id_issued: '2023-04-05', | ||
| state_id_expiration: '2030-01-02', | ||
|
|
| add_street_address_line_2_to_rexml_document(document) if applicant.address2.present? | ||
|
|
||
| add_optional_element( | ||
| 'ns2:AddressDeliveryPointText', |
There was a problem hiding this comment.
Out of curiosity, is ns2 for optional attributes, while ns1 is for required? or...?
There was a problem hiding this comment.
The AAMVA SOAP request template we use includes 4 namespaces:
| Abbrev | URL |
|---|---|
xmlns:soap |
http://www.w3.org/2003/05/soap-envelope |
xmlns:ns |
http://aamva.org/dldv/wsdl/2.1 |
xmlns:ns1 |
http://aamva.org/niem/extensions/1.0 |
xmlns:ns2 |
http://niem.gov/niem/niem-core/2.0 |
we could probably clean up those ns* abbreviations to be more like what they are.
Co-authored-by: Doug Price <douglas.price@gsa.gov>
🎫 Ticket
Link to the relevant ticket:
LG-13216
🛠 Summary of changes
This PR updates the AAMVA proofer to send issue date + expiration date (if available). These new attributes are not currently required to validate to pass.
It also adds a new key to AAMVA proofer results,
requested_attributesthat lists the attributes that were originally sent to AAMVA for verification. It's the same format asverified_attributes(an array). The intention is that this will make it possible to do analytics on requests with issue + expiration date.📜 Testing Plan
Provide a checklist of steps to confirm the changes.
requested_attributesincludesstate_id_expirationandstate_id_issued(and hopefully theverified_attributestoo!)This will likely require testing on staging before being promoted to production.