LG-12858 - Add new vtr option (enhanced ipp)#161
Conversation
app.rb
Outdated
| def is_eipp_allowed() | ||
| env = ENV['idp_environment'] | ||
| is_eipp_allowed = (env == 'dev' || env == 'staging') | ||
| end |
There was a problem hiding this comment.
- I'd drop the
is_and name this with a?to match the previous comment - No need for the final assignment, the result is just the value
| def is_eipp_allowed() | |
| env = ENV['idp_environment'] | |
| is_eipp_allowed = (env == 'dev' || env == 'staging') | |
| end | |
| def eipp_allowed? | |
| env = ENV['idp_environment'] | |
| env == 'dev' || env == 'staging' | |
| end |
There was a problem hiding this comment.
Another thought: hardcoding specific environment names in source code is a 12-factor app antipattern, could we add a new config for ENV['eipp_allowed'] and set that in the appropriate environments?
There was a problem hiding this comment.
@zachmargolis I think that is a better solution. Resolved with commit 97fd794
This repository is set up different than idp and is new territory for me. I paired with others and this is what we came up with. Please double check that I set up the variable accurately to only display the eipp option in staging once deployed. (It works locally when I edit the value of idp_enviroment in .env). I believe I do not need to do anything else, is that correct?
Thank you!
eileen-nava
left a comment
There was a problem hiding this comment.
I tested this locally with Keith's branch from identity-idp and it worked as expected. LGTM!
(Caveat: I'm still getting back into the swing of things on Joy, which means it might be helpful to have another Joy developer review this, too.)
ae25bab to
e6a36b0
Compare
|
@KeithNava @eileen-nava I am re-requesting a review because I made what I think are fairly large changes to the conditional logic of the drop down. Pay extra attention to the last commit (see default_config func in config.rb). I think this is how we should go about this but not 100% confident. Please review and fire up again. The testing plan has been updated. Thanks! |
zachmargolis
left a comment
There was a problem hiding this comment.
LGTM with some suggestions
eileen-nava
left a comment
There was a problem hiding this comment.
I tested this locally and it worked well. Approved.
| ial == 'biometric-comparison-required' | ||
| end | ||
|
|
||
| def requires_enhanced_ipp?(ial) |
There was a problem hiding this comment.
I’d expect this method to return nil when it returns from line 276. I know there's a Ruby style convention that if a method returns a boolean, then the method should end with ?. Should a method also end with ? if it returns a boolean or nil?
There was a problem hiding this comment.
I am now returning false, see commit d9607e4
3cdcd78 to
9ede314
Compare
app.rb
Outdated
| end | ||
|
|
||
| def requires_enhanced_ipp?(ial) | ||
| return unless config.vtr_disabled? |
There was a problem hiding this comment.
maybe we add an explicit false here to address Eileen's comment?
| return unless config.vtr_disabled? | |
| return false unless config.vtr_disabled? |
|
@eileen-nava @KeithNava This is ready for a final review! Sorry for the delay. I updated the solution to use env variable set in Cloud.gov as suggested by @zachmargolis. 🙏 💯 I added screenshots above for each env so you can see how "eipp_allowed" is set in each environment. I also updated the testing instructions to fit this new approach. I request review again primary to ensure how I am fetching that env variable is accurate. It should default to false (even though I set in all envs) and I am expecting it to come in as a string. I was using Thanks again. |
🎫 Ticket
LG-12858 Implementation: Add new Vector of Trust Option on Sinatra for F&F testing
🛠 Summary of changes
* I think this is achieved. Please see changes in
.env.exampleandconfig.rbEnhanced In-Person Proofingoption to the ial (level of service) drop down conditionally (to display in staging only)P1: Identity proofing is performedPe:Enhanced proofing)📜 Testing Plan
keithw/LG-13235-consume-eipp-data-from-sinatrafrom idp. Open fileapp/services/service_provider_request_handler.rband addputs sp_sessionon the first line in decorated_sp_session.keithw/LG-13235-consume-eipp-data-from-sinatraeipp_allowedis set to falsehttp://localhost:9292/Enhanced In-Person Proofingas an option.eipp_allowedto true. Start the server.Enhanced In-Person Proofingas an option now.Enhanced In-Person Proofingand click sign in.C1.P1.Pe(Pe= enhanced proofing) and that the ial is set toenhanced-ipp-requiredhttp://localhost:9292/again.C1.P1.Pevalue be passed in whenEnhanced In-Person Proofingis not selected (ie you should see Pb for biometrics rather than Pe) and that the ial set is notenhanced-ipp-required. (Step 12 and 13)📷 Screenshots of env variable set in Cloud.gov [env]-identity-oidc-sinatra