Skip to content

LG-7602 Pull VA IP Data and Store It In Session (Form refactor) 1 of 3#7008

Merged
gangelo merged 1 commit intomainfrom
lg-7602-pull-va-ip-data-and-store-it-in-session-form-refactor
Sep 22, 2022
Merged

LG-7602 Pull VA IP Data and Store It In Session (Form refactor) 1 of 3#7008
gangelo merged 1 commit intomainfrom
lg-7602-pull-va-ip-data-and-store-it-in-session-form-refactor

Conversation

@gangelo
Copy link
Contributor

@gangelo gangelo commented Sep 22, 2022

https://cm-jira.usa.gov/browse/LG-7602

1 of 3.

This is simply an existing Form refactor that splits off a FormBase class.

This is a supporting change for the LG-7602 feature for Inherited Proofing (IP) where user PII needs to be stored in session for IP flow steps and subsequent IDV workflow flow steps that need this information for (example) Lexis Phone Finder look ups.

This change exposes a #user_pii method that retuns a Hash suitable to be stored in the idv_session and flow_session[:pii_from_user] (minus :uuid). The data mapped to the user PII returned from this method is Service Provider (SP)-specific in that the SP API returning the user PII may be returned having data keys that differ from what we need; consequently, create a mapper service for this, but that would disconnect what the SP service returns hash-wise. The Form knows about this, so it may be better suited "as is".

changelog: Upcoming Features, Inherited Proofing, Pull VA IP Data and Store It In Session (LG-7602)

@gangelo gangelo requested a review from jmhooper September 22, 2022 12:32
@gangelo gangelo self-assigned this Sep 22, 2022
@gangelo gangelo force-pushed the lg-7602-pull-va-ip-data-and-store-it-in-session-form-refactor branch from 1c2f522 to dc81426 Compare September 22, 2022 12:35
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand why we would introduce inheritance here while there is only one subclass? It seems like it introduces indirection and I'm not sure I see the benefit. This class looks a little prettier but there is complexity hiding in the superclass. Now a reader has to reference both places to understand what is going on.

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 hear you. I needed to split this up per the PR comment above. TLDR: the user PII is (#user_pii) is service provider-specific and I didn't want a user to have to refactor what would certainly be a very heavy lift later on, since we are trying to keep our inherited proofing code somewhat service-provider agnostic. The inheritance chain will never go beyond one generation, and the benefit will certainly outweigh the cost in the end IMHO. This is only the first of several changes I need to make. I have the 2nd of 3 changes I am going to push in a little bit, I think it will make more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example:

https://github.com/18F/identity-idp/pull/7012/files#diff-3316a6462ad5cc81ddc835c7d5a86652545ed8cb44e674e7ddcae5c85ca02379

The service provider-specific form returned from #inherited_proofing_form will be #submit_ted_ and the #user_pii obtained from the form used to populate flow_session[:pii_from_user] in one of our flow steps prior to handoff to the IDV workflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't think I see it. Since we only have 1 service provider providing inherited proofing at the moment we have to make assumptions about how future service providers will work. That makes me think we will likely need to refactor this no matter how we build it. With that in mind I'm suspicious of adding the indirection that comes with trying to generalize it through inheritance.

I can approve this but with the note that I foresee the complexity here being a problem in the future.

I also added a comment to the change you linked about because I don't think I understand the direction there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmhooper that's fine for now, thank you. The only assumption I am trying to make with our Form codez is that we cannot make assumptions about how our future service providers, at least by way of what they will return to us; this is why I used a little meta programming to build/return the hash passed from the Service class.

I'd like to understand more about your concerns about "how future service providers will work"; what exactly are you concerned about in regards to the way we coded our Form class, because all it is doing is accepting a hash from our Service class? If you could take the time to answer at some point, I'd appreciate understanding this more because I don't want to be blind to anything.

https://cm-jira.usa.gov/browse/LG-7602

This is a supporting change for the LG-7602 feature for Inherited Proofing (IP)
where user PII needs to be stored in session for IP flow steps and
subsequent IDV workflow flow steps that need this information for (example)
Lexis Phone Finder look ups.

This change exposes a #user_pii method that retuns a Hash suitable to be
stored in the idv_session and flow_session[:pii_from_user] (minus :uuid).
The data mapped  to the user PII returned from this method is Service
Provider (SP)-specific in that the SP API returning the user PII may
be returned having data keys that differ from what we need; consequently,
create a mapper service for this, but that would disconnect what
the SP service returns hash-wise. The Form knows about this, so it
may be better suited "as is".

changelog: Upcoming Features, Inherited Proofing, Pull VA IP Data and Store It In Session (LG-7602)
@gangelo gangelo force-pushed the lg-7602-pull-va-ip-data-and-store-it-in-session-form-refactor branch from dc81426 to 62a7fe3 Compare September 22, 2022 18:43
@gangelo gangelo added the inherited proofing Pull Requests for the Inherited Proofing feature label Sep 22, 2022
@gangelo gangelo merged commit 6cb7589 into main Sep 22, 2022
@gangelo gangelo deleted the lg-7602-pull-va-ip-data-and-store-it-in-session-form-refactor branch September 22, 2022 19:53
@gangelo gangelo changed the title LG-7602 Pull VA IP Data and Store It In Session (Form refactor) LG-7602 Pull VA IP Data and Store It In Session (Form refactor) 1 of 3 Sep 23, 2022
@solipet solipet mentioned this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inherited proofing Pull Requests for the Inherited Proofing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants