-
Notifications
You must be signed in to change notification settings - Fork 166
LG-13216: AAMVA issue date + expiration validation (log only) #10653
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
Changes from all commits
9ac921e
40765b5
f9753f0
786ef5f
704f202
aa9a074
3d20a5a
8793888
ee5fc00
1a8b19e
4969513
574b9fc
48c50af
35dd4f5
c08d8d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -62,34 +62,43 @@ def add_user_provided_data_to_body | |||||||||||
| user_provided_data_map.each do |xpath, data| | ||||||||||||
| REXML::XPath.first(document, xpath).add_text(data) | ||||||||||||
| end | ||||||||||||
| add_street_address_line_2_to_rexml_document(document) if applicant.address2.present? | ||||||||||||
|
|
||||||||||||
| add_optional_element( | ||||||||||||
| 'ns2:AddressDeliveryPointText', | ||||||||||||
|
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. Out of curiosity, is
Contributor
Author
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. The AAMVA SOAP request template we use includes 4 namespaces:
we could probably clean up those |
||||||||||||
| value: applicant.address2, | ||||||||||||
| document:, | ||||||||||||
| after: '//ns1:Address/ns2:AddressDeliveryPointText', | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| add_optional_element( | ||||||||||||
| 'ns2:DriverLicenseIssueDate', | ||||||||||||
| value: applicant.state_id_data.state_id_issued, | ||||||||||||
| document:, | ||||||||||||
| inside: '//ns:verifyDriverLicenseDataRequest', | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| add_optional_element( | ||||||||||||
| 'ns2:DriverLicenseExpirationDate', | ||||||||||||
| value: applicant.state_id_data.state_id_expiration, | ||||||||||||
| document:, | ||||||||||||
| inside: '//ns:verifyDriverLicenseDataRequest', | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| @body = document.to_s | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| def add_street_address_line_2_to_rexml_document(document) | ||||||||||||
| old_address_node = document.delete_element('//ns1:Address') | ||||||||||||
| new_address_node = old_address_node.clone | ||||||||||||
| old_address_node.children.each do |child_node| | ||||||||||||
| next unless child_node.node_type == :element | ||||||||||||
| def add_optional_element(name, value:, document:, inside: nil, after: nil) | ||||||||||||
| return if value.blank? | ||||||||||||
|
|
||||||||||||
| new_element = child_node.clone | ||||||||||||
| new_element.add_text(child_node.text) | ||||||||||||
| new_address_node.add_element(new_element) | ||||||||||||
| el = REXML::Element.new(name) | ||||||||||||
| el.text = value | ||||||||||||
|
|
||||||||||||
| if child_node.name == 'AddressDeliveryPointText' | ||||||||||||
| new_address_node.add_element(address_line_2_element) | ||||||||||||
| end | ||||||||||||
| if inside | ||||||||||||
| REXML::XPath.first(document, inside).add_element(el) | ||||||||||||
| elsif after | ||||||||||||
| sibling = REXML::XPath.first(document, after) | ||||||||||||
| sibling.parent.insert_after(sibling, el) | ||||||||||||
| end | ||||||||||||
| REXML::XPath.first( | ||||||||||||
| document, | ||||||||||||
| '//ns:verifyDriverLicenseDataRequest', | ||||||||||||
| ).add_element(new_address_node) | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| def address_line_2_element | ||||||||||||
| element = REXML::Element.new('ns2:AddressDeliveryPointText') | ||||||||||||
| element.add_text(applicant.address2) | ||||||||||||
| element | ||||||||||||
| end | ||||||||||||
|
|
||||||||||||
| def build_request_body | ||||||||||||
|
|
||||||||||||
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.
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:
identity-idp/app/services/proofing/aamva/response/verification_response.rb
Lines 96 to 105 in 5cb708a
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.
Yes, that's what the
filteris about --verification_resultswill have all attributes present, but any missing attributes will havenilvaluesThere 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.
That should work for this issue. 2 things to keep in mind:
verified_attributesvalue is an array so we can use it in get-to-yes IIRCThere 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.
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_attributesto a hash no prob, I might poke around and see if it is worth doingverified_attributesas well