-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Tech5 Integration - Enrollment updates #2701
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
df52ded
Add biometric templates to RegistrationResult
avazirna 35902ce
Add new registrationResponse that support biometrics template
avazirna e437a58
Add Gson dependency
avazirna 07aae64
Add Biometrics utility class
avazirna 770a917
Store templates in form
avazirna 8562c78
Add method to convert Base64 string to map
avazirna 752c3cb
Refactor
avazirna 4a79c49
Update biometric identifiers
avazirna 8072f09
Refactor
avazirna b01cf21
Add Tests around registration with templates
avazirna 7cbaa5d
Update documentation
avazirna c19496b
Refactor
avazirna 73d6a98
Remove unnecessary biometric identifiers
avazirna 9d5df75
Refactor
avazirna 9371986
Add callout response key to biometric identifiers
avazirna 1786eb2
Change conversions to work with individual templates instead of a map
avazirna 756586f
Add biometric templates to callout response individually
avazirna 2128bd8
Add method to retrieve value from form question
avazirna e81b21b
Update tests
avazirna 118435a
update documentation
avazirna 1d1d439
Remove BiometricUtils class
avazirna 7fcc0a3
Drop GSON library
avazirna 891b338
Resolve merge conflicts
avazirna 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 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 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
2 changes: 1 addition & 1 deletion
2
app/unit-tests/resources/commcare-apps/identity_callouts/media_suite.xml
This file contains 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<suite version="10" descriptor="Media Suite File"/> | ||
<suite version="24" descriptor="Media Suite File"/> |
147 changes: 90 additions & 57 deletions
147
app/unit-tests/resources/commcare-apps/identity_callouts/modules-0/forms-0.xml
This file contains 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 |
---|---|---|
@@ -1,58 +1,91 @@ | ||
<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:orx="http://openrosa.org/jr/xforms" xmlns="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:vellum="http://commcarehq.org/xforms/vellum"> | ||
<h:head> | ||
<h:title>Registration Form</h:title> | ||
<model> | ||
<instance> | ||
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms" xmlns="http://openrosa.org/formdesigner/39BBDBB3-7C04-472E-9D8F-DB640E63F466" uiVersion="1" version="15" name="Registration Form"> | ||
<question2/> | ||
<duplicate_guid/> | ||
<duplicate_score/> | ||
<duplicate_strength/> | ||
<identity_guid/> | ||
<verification/> | ||
<verify_guid/> | ||
<verify_score/> | ||
<verify_strength/> | ||
<case xmlns="http://commcarehq.org/case/transaction/v2" case_id="" date_modified="" user_id=""><create><case_name/><owner_id/><case_type>case</case_type></create></case><orx:meta xmlns:cc="http://commcarehq.org/xforms"><orx:deviceID/><orx:timeStart/><orx:timeEnd/><orx:username/><orx:userID/><orx:instanceID/><cc:appVersion/><orx:drift/></orx:meta></data> | ||
</instance><instance id="commcaresession" src="jr://instance/session"/> | ||
<bind nodeset="/data/question2" type="intent"/> | ||
<bind nodeset="/data/duplicate_guid"/> | ||
<bind nodeset="/data/duplicate_score"/> | ||
<bind nodeset="/data/duplicate_strength"/> | ||
<bind nodeset="/data/identity_guid"/> | ||
<bind nodeset="/data/verification" type="intent"/> | ||
<bind nodeset="/data/verify_guid"/> | ||
<bind nodeset="/data/verify_score"/> | ||
<bind nodeset="/data/verify_strength"/> | ||
<itext> | ||
<translation lang="en" default=""> | ||
<text id="question2-label"> | ||
<value>Registration</value> | ||
</text> | ||
<text id="verification-label"> | ||
<value>Verification</value> | ||
</text> | ||
</translation> | ||
</itext> | ||
<bind calculate="/data/meta/timeEnd" nodeset="/data/case/@date_modified" type="xsd:dateTime"/><bind calculate="/data/meta/userID" nodeset="/data/case/@user_id"/><setvalue event="xforms-ready" ref="/data/case/@case_id" value="instance('commcaresession')/session/data/case_id_new_case_0"/><bind calculate="/data/question2" nodeset="/data/case/create/case_name"/><bind calculate="/data/meta/userID" nodeset="/data/case/create/owner_id"/><setvalue event="xforms-ready" ref="/data/meta/deviceID" value="instance('commcaresession')/session/context/deviceid"/><setvalue event="xforms-ready" ref="/data/meta/timeStart" value="now()"/><bind nodeset="/data/meta/timeStart" type="xsd:dateTime"/><setvalue event="xforms-revalidate" ref="/data/meta/timeEnd" value="now()"/><bind nodeset="/data/meta/timeEnd" type="xsd:dateTime"/><setvalue event="xforms-ready" ref="/data/meta/username" value="instance('commcaresession')/session/context/username"/><setvalue event="xforms-ready" ref="/data/meta/userID" value="instance('commcaresession')/session/context/userid"/><setvalue event="xforms-ready" ref="/data/meta/instanceID" value="uuid()"/><setvalue event="xforms-ready" ref="/data/meta/appVersion" value="instance('commcaresession')/session/context/appversion"/><setvalue event="xforms-revalidate" ref="/data/meta/drift" value="if(count(instance('commcaresession')/session/context/drift) = 1, instance('commcaresession')/session/context/drift, '')"/></model> | ||
<odkx:intent xmlns:odkx="http://opendatakit.org/xforms" id="question2" class="org.commcare.identity.bioenroll"> | ||
<response key="guid" ref="/data/identity_guid"/> | ||
<response key="match_guid" ref="/data/duplicate_guid"/> | ||
<response key="match_confidence" ref="/data/duplicate_score"/> | ||
<response key="match_strength" ref="/data/duplicate_strength"/> | ||
</odkx:intent> | ||
<odkx:intent xmlns:odkx="http://opendatakit.org/xforms" id="verification" class="org.commcare.identity.bioverify"> | ||
<response key="match_guid" ref="/data/verify_guid"/> | ||
<response key="match_confidence" ref="/data/verify_score"/> | ||
<response key="match_strength" ref="/data/verify_strength"/> | ||
</odkx:intent> | ||
</h:head> | ||
<h:body> | ||
<input ref="/data/question2" appearance="intent:question2"> | ||
<label ref="jr:itext('question2-label')"/> | ||
</input> | ||
<input ref="/data/verification" appearance="intent:verification"> | ||
<label ref="jr:itext('verification-label')"/> | ||
</input> | ||
</h:body> | ||
</h:html> | ||
<h:head> | ||
<h:title>Registration Form</h:title> | ||
<model> | ||
<instance> | ||
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms" xmlns="http://openrosa.org/formdesigner/39BBDBB3-7C04-472E-9D8F-DB640E63F466" uiVersion="1" version="24" name="Registration Form"> | ||
<question2/> | ||
<duplicate_guid/> | ||
<duplicate_score/> | ||
<duplicate_strength/> | ||
<identity_guid/> | ||
<verification/> | ||
<verify_guid/> | ||
<verify_score/> | ||
<verify_strength/> | ||
<case xmlns="http://commcarehq.org/case/transaction/v2" case_id="" date_modified="" user_id=""> | ||
<create> | ||
<case_name/> | ||
<owner_id/> | ||
<case_type>case</case_type> | ||
</create> | ||
</case> | ||
<orx:meta xmlns:cc="http://commcarehq.org/xforms"> | ||
<orx:deviceID/> | ||
<orx:timeStart/> | ||
<orx:timeEnd/> | ||
<orx:username/> | ||
<orx:userID/> | ||
<orx:instanceID/> | ||
<cc:appVersion/> | ||
<orx:drift/> | ||
</orx:meta> | ||
</data> | ||
</instance> | ||
<instance id="commcaresession" src="jr://instance/session"/> | ||
<bind nodeset="/data/question2" type="intent" required="true()"/> | ||
<bind nodeset="/data/duplicate_guid"/> | ||
<bind nodeset="/data/duplicate_score"/> | ||
<bind nodeset="/data/duplicate_strength"/> | ||
<bind nodeset="/data/identity_guid"/> | ||
<bind nodeset="/data/verification" type="intent"/> | ||
<bind nodeset="/data/verify_guid"/> | ||
<bind nodeset="/data/verify_score"/> | ||
<bind nodeset="/data/verify_strength"/> | ||
<itext> | ||
<translation lang="en" default=""> | ||
<text id="question2-label"> | ||
<value>Register</value> | ||
</text> | ||
<text id="verification-label"> | ||
<value>Verification</value> | ||
</text> | ||
</translation> | ||
</itext> | ||
<bind nodeset="/data/case/@date_modified" type="xsd:dateTime" calculate="/data/meta/timeEnd"/> | ||
<bind nodeset="/data/case/@user_id" calculate="/data/meta/userID"/> | ||
<setvalue ref="/data/case/@case_id" value="instance('commcaresession')/session/data/case_id_new_case_0" event="xforms-ready"/> | ||
<bind nodeset="/data/case/create/case_name" calculate="/data/question2"/> | ||
<bind nodeset="/data/case/create/owner_id" calculate="/data/meta/userID"/> | ||
<setvalue ref="/data/meta/deviceID" value="instance('commcaresession')/session/context/deviceid" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/timeStart" value="now()" event="xforms-ready"/> | ||
<bind nodeset="/data/meta/timeStart" type="xsd:dateTime"/> | ||
<setvalue ref="/data/meta/timeEnd" value="now()" event="xforms-revalidate"/> | ||
<bind nodeset="/data/meta/timeEnd" type="xsd:dateTime"/> | ||
<setvalue ref="/data/meta/username" value="instance('commcaresession')/session/context/username" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/userID" value="instance('commcaresession')/session/context/userid" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/instanceID" value="uuid()" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/appVersion" value="instance('commcaresession')/session/context/appversion" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/drift" value="if(count(instance('commcaresession')/session/context/drift) = 1, instance('commcaresession')/session/context/drift, '')" event="xforms-revalidate"/> | ||
</model> | ||
<odkx:intent xmlns:odkx="http://opendatakit.org/xforms" id="question2" class="org.commcare.identity.bioenroll"> | ||
<response key="guid" ref="/data/identity_guid"/> | ||
<response key="match_guid" ref="/data/duplicate_guid"/> | ||
<response key="match_confidence" ref="/data/duplicate_score"/> | ||
<response key="match_strength" ref="/data/duplicate_strength"/> | ||
</odkx:intent> | ||
<odkx:intent xmlns:odkx="http://opendatakit.org/xforms" id="verification" class="org.commcare.identity.bioverify"> | ||
<response key="match_guid" ref="/data/verify_guid"/> | ||
<response key="match_confidence" ref="/data/verify_score"/> | ||
<response key="match_strength" ref="/data/verify_strength"/> | ||
</odkx:intent> | ||
</h:head> | ||
<h:body> | ||
<input ref="/data/question2" appearance="intent:question2"> | ||
<label ref="jr:itext('question2-label')"/> | ||
</input> | ||
<input ref="/data/verification" appearance="intent:verification"> | ||
<label ref="jr:itext('verification-label')"/> | ||
</input> | ||
</h:body> | ||
</h:html> |
66 changes: 66 additions & 0 deletions
66
app/unit-tests/resources/commcare-apps/identity_callouts/modules-0/forms-1.xml
This file contains 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,66 @@ | ||
<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:orx="http://openrosa.org/jr/xforms" xmlns="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:vellum="http://commcarehq.org/xforms/vellum"> | ||
<h:head> | ||
<h:title>Registration with Templates</h:title> | ||
<model> | ||
<instance> | ||
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms" xmlns="http://openrosa.org/formdesigner/E3900AF4-43AC-435A-B0BB-E043AD9608A1" uiVersion="1" version="24" name="Registration with Templates"> | ||
<register/> | ||
<guid/> | ||
<templates/> | ||
<case xmlns="http://commcarehq.org/case/transaction/v2" case_id="" date_modified="" user_id=""> | ||
<create> | ||
<case_name/> | ||
<owner_id/> | ||
<case_type>case</case_type> | ||
</create> | ||
</case> | ||
<orx:meta xmlns:cc="http://commcarehq.org/xforms"> | ||
<orx:deviceID/> | ||
<orx:timeStart/> | ||
<orx:timeEnd/> | ||
<orx:username/> | ||
<orx:userID/> | ||
<orx:instanceID/> | ||
<cc:appVersion/> | ||
<orx:drift/> | ||
</orx:meta> | ||
</data> | ||
</instance> | ||
<instance id="commcaresession" src="jr://instance/session"/> | ||
<bind nodeset="/data/register" type="intent" required="true()"/> | ||
<bind nodeset="/data/guid"/> | ||
<bind nodeset="/data/templates"/> | ||
<itext> | ||
<translation lang="en" default=""> | ||
<text id="register-label"> | ||
<value>Register</value> | ||
</text> | ||
</translation> | ||
</itext> | ||
<bind nodeset="/data/case/@date_modified" type="xsd:dateTime" calculate="/data/meta/timeEnd"/> | ||
<bind nodeset="/data/case/@user_id" calculate="/data/meta/userID"/> | ||
<setvalue ref="/data/case/@case_id" value="instance('commcaresession')/session/data/case_id_new_case_0" event="xforms-ready"/> | ||
<bind nodeset="/data/case/create/case_name" calculate="/data/register"/> | ||
<bind nodeset="/data/case/create/owner_id" calculate="/data/meta/userID"/> | ||
<setvalue ref="/data/meta/deviceID" value="instance('commcaresession')/session/context/deviceid" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/timeStart" value="now()" event="xforms-ready"/> | ||
<bind nodeset="/data/meta/timeStart" type="xsd:dateTime"/> | ||
<setvalue ref="/data/meta/timeEnd" value="now()" event="xforms-revalidate"/> | ||
<bind nodeset="/data/meta/timeEnd" type="xsd:dateTime"/> | ||
<setvalue ref="/data/meta/username" value="instance('commcaresession')/session/context/username" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/userID" value="instance('commcaresession')/session/context/userid" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/instanceID" value="uuid()" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/appVersion" value="instance('commcaresession')/session/context/appversion" event="xforms-ready"/> | ||
<setvalue ref="/data/meta/drift" value="if(count(instance('commcaresession')/session/context/drift) = 1, instance('commcaresession')/session/context/drift, '')" event="xforms-revalidate"/> | ||
</model> | ||
<odkx:intent xmlns:odkx="http://opendatakit.org/xforms" id="register" class="org.commcare.identity.bioenroll"> | ||
<response key="guid" ref="/data/guid"/> | ||
<response key="templates" ref="/data/templates"/> | ||
</odkx:intent> | ||
</h:head> | ||
<h:body> | ||
<input ref="/data/register" appearance="intent:register"> | ||
<label ref="jr:itext('register-label')"/> | ||
</input> | ||
</h:body> | ||
</h:html> |
This file contains 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.
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: diffs like this are very hard to review and should be avoided. Will you be able to highlight what's changed here with comments at the very least.
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.
it is confusing, do we have a practice around this? I just made the modification in HQ, downloaded the app and replaced the files.
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.
We should only change the parts that changed. I generally edit the files by hand manually to add the new/modified parts.
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 undid this and followed your advice - e81b21b