Skip to content

Jmax/lg 11942 add a selfie check performed prop to the doc auth response#9825

Closed
jmax-gsa wants to merge 7 commits intomainfrom
jmax/LG-11942-Add-a-selfie_check_performed-prop-to-the-doc-auth-response
Closed

Jmax/lg 11942 add a selfie check performed prop to the doc auth response#9825
jmax-gsa wants to merge 7 commits intomainfrom
jmax/LG-11942-Add-a-selfie_check_performed-prop-to-the-doc-auth-response

Conversation

@jmax-gsa
Copy link
Contributor

@jmax-gsa jmax-gsa commented Dec 22, 2023

🎫 Ticket

LG-11942

🛠 Summary of changes

Added selfie_check_performed? method and property to DocAuth::Response object.

As a temporary measure, we default this value to true if selfie checks are enabled, and false if they are not.

This is stub code, and needs to be replaced with real values from the IdV vendors, with the specs updated accordingly, before selfies are enabled in production.

📜 Testing Plan

  • In your application.yml, set doc_auth_selfie_capture_enabled to true
  • Start a Rails console, and create a DocAuth::Response object. Do not specify a value for the selfie_check_performed parameter.
  • Verify that your new response object returns true from selfie_check_performed?
  • Exit the console and set doc_auth_selfie_capture_enabled to false
  • Start a new console, and create a DocAuth::Response object. Do not specify a value for the selfie_check_performed parameter.
  • Verify that your new response object returns false from selfie_check_performed?

👀 Screenshots

Selfie check disabled:
Loading development environment (Rails 7.1.2)
[1] pry(main)> response = DocAuth::Response.new(success: true)
=> #<DocAuth::Response:0x000000010d738fd0
 @attention_with_barcode=false,
 @doc_type_supported=true,
 @errors={},
 @exception=nil,
 @extra={},
 @pii_from_doc={},
 @selfie_check_performed=false,
 @success=true>
[9] pry(main)> response.selfie_check_performed?
=> false
[16] pry(main)> quit

Process rails finished

Selfie check enabled:
Loading development environment (Rails 7.1.2)
[1] pry(main)> response = DocAuth::Response.new(success: true)
=> #<DocAuth::Response:0x0000000111626198
 @attention_with_barcode=false,
 @doc_type_supported=true,
 @errors={},
 @exception=nil,
 @extra={},
 @pii_from_doc={},
 @selfie_check_performed=true,
 @success=true>
[17] pry(main)> response.selfie_check_performed?
=> true
[21] pry(main)> quit

Process rails finished

@jmax-gsa jmax-gsa force-pushed the jmax/LG-11942-Add-a-selfie_check_performed-prop-to-the-doc-auth-response branch from 06255be to 52847c4 Compare December 22, 2023 16:19
@jmax-gsa jmax-gsa marked this pull request as ready for review December 22, 2023 16:19
@jmax-gsa jmax-gsa requested review from a team and jmhooper December 22, 2023 16:20
doc_type_supported: true
doc_type_supported: true,
# This is a stub to get data paths in place. Replace this as soon as possible.
selfie_check_performed: IdentityConfig.store.doc_auth_selfie_capture_enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check whether the sp requested a selfie (which also checks the config value). If the session isn't available here we'll need to pass in the value.

Suggested change
selfie_check_performed: IdentityConfig.store.doc_auth_selfie_capture_enabled
selfie_check_performed: decorated_sp_session.selfie_required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that #selfie_required? would be better, but since this is stub code anyway, I'm really reluctant to pass in the decorated session. The other alternative is to remove the default value for selfie_check_performed and pass in a value everywhere it's called, and I like that even less for stub code.

Comment on lines +167 to +169
allow(IdentityConfig.store).
to receive(:doc_auth_selfie_capture_enabled).
and_return(selfies_enabled)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will also need to set sp[:biometric_comparison_required] here to go with the above code change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above; I think this is too much for the stub.

@jmax-gsa jmax-gsa requested review from a team and charleyf and removed request for a team December 22, 2023 16:46
@jmax-gsa jmax-gsa closed this Dec 27, 2023
@jmax-gsa
Copy link
Contributor Author

After consultation with @jmhooper, closing this PR in favor of #9833

@aduth aduth deleted the jmax/LG-11942-Add-a-selfie_check_performed-prop-to-the-doc-auth-response branch January 2, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants