Skip to content

LG-7203: Use DB for service provider IPP feature enablement#6945

Merged
NavaTim merged 4 commits intomainfrom
tbradley/lg-7203-check-sp-config-for-ipp
Sep 14, 2022
Merged

LG-7203: Use DB for service provider IPP feature enablement#6945
NavaTim merged 4 commits intomainfrom
tbradley/lg-7203-check-sp-config-for-ipp

Conversation

@NavaTim
Copy link
Contributor

@NavaTim NavaTim commented Sep 13, 2022

This supplants the config key in_person_proofing_enabled_issuers with a new database field in_person_proofing_enabled on each ServiceProvider record. This field will be managed elsewhere.

Testing

  1. Run the migrations in this repo, then start the IDP
  2. Setup and run the Sinatra app
  3. Open the Sinatra app - default local stack URL is http://127.0.0.1:9292
  4. Select "IAL2" in the options under the sign-in button, then click "Sign in"
  5. Proceed through to the doc auth step of IPP
  6. Trigger a non-terminal failure of doc auth, e.g. image resolution error
  7. You should not initially see the option to verify at a post office
  8. Run the Rails console in the IDP repo folder via a terminal:
    rails console
  9. Run this Ruby code in the console:
    ServiceProvider.find_by(issuer: "urn:gov:gsa:openidconnect:sp:sinatra").update(in_person_proofing_enabled: true)
  10. Refresh the doc auth page
  11. Trigger a non-terminal failure of doc auth again
  12. You should see the option to verify at a post office displayed

@NavaTim NavaTim requested review from a team, aduth and tomas-nava September 13, 2022 02:16
@NavaTim NavaTim changed the title LG-7202: Use DB for service provider IPP feature enablement LG-7203: Use DB for service provider IPP feature enablement Sep 13, 2022
@NavaTim NavaTim force-pushed the tbradley/lg-7203-check-sp-config-for-ipp branch from 880dcc2 to 61428f3 Compare September 13, 2022 20:32
Copy link
Contributor

Choose a reason for hiding this comment

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

am i understanding this correctly - we're finding a service provider by issuer who has in person proofing enabled or using false (issuer was not found?). Is "false" allowing for a situation where an issuer is provided but either does not exist or does not have in person proofing enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is "false" allowing for a situation where an issuer is provided but either does not exist or does not have in person proofing enabled?

Yes, this allows for both situations.

(query logs removed below)

$ rails console   
Loading development environment (Rails 7.0.3.1)
[1] pry(main)> ServiceProvider.find_by(issuer: "doesnotexist")&.in_person_proofing_enabled || false
=> false
[2] pry(main)> ServiceProvider.find_by(issuer: "urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:dashboard")&.in_person_proofing_enabled || false
=> false
[3] pry(main)> ServiceProvider.find_by(issuer: "urn:gov:gsa:openidconnect:sp:sinatra")&.in_person_proofing_enabled || false
=> true

Copy link
Contributor

Choose a reason for hiding this comment

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

oh i think i see my answer to the above question here and on line 39

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM, but I think we should hold off to merge until the config pieces are in place, so that we could fall back to the current configuration in case there's any delay in having that approved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Do you think using the auto-created ?-suffixed version of this method would better communicate that we're expecting a boolean value? One thing that tripped me up reading this at first glance was the thought that || false existed because we're expecting that in_person_proofing_enabled could be nil, which isn't the case. It took me a moment to recognize that it exists as a fallback for the nil-safe &. operator.

Suggested change
ServiceProvider.find_by(issuer: issuer)&.in_person_proofing_enabled || false
ServiceProvider.find_by(issuer: issuer)&.in_person_proofing_enabled? || false

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 was thinking about it before, but since you're bringing it up I decided to go ahead with this instead:

ServiceProvider.exists?(
  issuer: issuer,
  in_person_proofing_enabled: true
)

@NavaTim NavaTim force-pushed the tbradley/lg-7203-check-sp-config-for-ipp branch from 61428f3 to 016a06b Compare September 14, 2022 17:44
@NavaTim NavaTim merged commit 5b09848 into main Sep 14, 2022
@NavaTim NavaTim deleted the tbradley/lg-7203-check-sp-config-for-ipp branch September 14, 2022 18:30
@aduth aduth mentioned this pull request Sep 15, 2022
aduth added a commit that referenced this pull request Sep 15, 2022
* LG-6497: Revert Memorable Date Changes (#6940)

* Revert "LG-6497: Minor style/doc fixes related to memorable date change (#6929)"

This reverts commit e0e8ad4.

* Revert "LG-6497: Create and use new Memorable Date component in State ID step of IPP flow (#6713)"

This reverts commit cead2c1.

* [skip changelog]

* Build frontend analytics method parameters from method signature (#6927)

* Build frontend analytics method parameters from method signature

**Why**:

- To avoid confusion where a developer would expect analytics method parameters to be fulfilled from the frontend payload (#6791)
- To ensure that all of the analytics methods are explicit and documented in the parameters they're expecting

See: #6918 (comment)

changelog: Internal, Analytics, Improve frontend analytics payload documentation

* Fix YARDoc parameter name documentation

* Restore flow path parameter to front-end mapped events

* Add flow_path handling to specs

* Destructure, use compact for kwarg aggregation

* Extract hash_from_method_kwargs to service class

See: #6927 (comment)

* Extract FrontendLogger service class from FrontendLogController

See: #6927 (comment)

* Remove leftover code from earlier iterations

* Collapse MethodSignatureHashBuilder to FrontendLogger

See: #6927 (comment)

* LG-6497: Reintroduce Memorable Date on IPP State ID Page (#6943)

* Revert "LG-6497: Revert Memorable Date Changes (#6940)"

This reverts commit d2500a8.

* [skip changelog]

* Try to fix intermittent failure for in-person feature spec (#6933)

**Why**: So that our builds pass reliably.

changelog: Internal, Automated Testing, Reduce intermittent failures in automated testing

* LG-7431 Logged In User Change Password (#6948)

* LG-7431 Logged In User Change Password

changelog: Internal, Attempts API, Track additional events

* Qualify script rails executable properly with bin/ (#6951)

changelog: Internal, Upcoming Features, Qualify script rails executable properly with bin/

* LG-6497: Workaround New Relic addEventListener bug and improve error styles (#6938)

* LG-6497: Circumvent New Relic event bug

* LG-6497: Ensure memorable date correctly assigns errors for error styling

* [skip changelog]

* Update app/javascript/packages/memorable-date/index.spec.ts

Co-authored-by: Sheldon Bachstein <sheldon.bachstein@gsa.gov>

* Revert "LG-6497: Revert Memorable Date Changes (#6940)"

This reverts commit d2500a8.

* [skip changelog]

* Update app/javascript/packages/memorable-date/index.ts

Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>

Co-authored-by: Sheldon Bachstein <sheldon.bachstein@gsa.gov>
Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>

* Refactor PhoneFinder (#6920)

This commit refactors the PhoneFinder proofer client so that it does not user the `Proofer::Base` super class any more. It converts the PhoneFinder proofer into a plain old ruby object with its own result object.

[skip changelog]

Co-authored-by: Jonathan Hooper <jonathan.hooper@gsa.gov>

* ThreatMetrix JS verification (LG-7518) (#6937)

* Add ThreatMetrix code signing cert to config

Cert includes public key used to verify signature on ThreatMetrix Javascript

* Add job to verify ThreatMetrix javascript

Periodically request TMX JS and validate the signature at the end of the file

* Remove stale job stuff

* Don't hardcode test certs

Generate keys / certs so we don't have scary-looking private keys in repo

* Minor tweak to session_id arg

changelog: Upcoming Features, ThreatMetrix, Periodically check signature on ThreatMetrix Javascript

* Use pack to do hex-to-binary conversion

* how do you spell Javascript

* Fail if signing certificate is expired

* Run ThreatMetrixJsVerificationJob on 1h intervals

* Remove cert from application.default.yml

will be in config, just not going to include in code

* Lint

* Trigger devops on merges to main. (#6944)

* Trigger devops on merges to main.

* typo

* testing

[skip changelog]

* Only run on main

* Update total-monthly-auths report to pull from the raw table (#6952)

**Why**: We've found some discrepancies with the aggregated monthly
table so this helps us have more precise reports

changelog: Internal, Reporting, Update billing reports to be more accurate

* Log digest of OIDC "code" param (LG-7440) (#6942)

* Log digest of OIDC "code" param (LG-7440)

**Why**: to assist with debugging requests from partners

* Work around nil code

**How**: By submitting the form a second time after the identity
has been linked, because we need the session uuid from that linkage
for the code, for the param.

Somehow it was getting into the success_redirect_uri before

changelog: Internal, Logging, Log hash of OpenID Connect "code" param

Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>

* update ready to verify presenter to use enrollment_established_at (#6950)

* update ready to verify presenter to use enrollment_established_at

* [skip changelog]

* refactor

* fix lint errors

* added new event for idv phone send link rate limit (#6958)

changelog: Internal, Attempts API, Track additional events

* Lg 7545 password change reauth (#6954)

* LG-7545 Password Change Reauth Submit

changelog: Internal, Attempts API, Track additional events

* LG-7411 Analytics event for TM Proofing Failure Page (#6953)

* added setup errors visited

* Add redirect tracking to contact url on sorry page

* add changelog

changelog: Internal, Analytics, Add analytics to sorry for proofing page

* add tracker method for contact page analytics

* LG-6497: Set min date for State ID page to January 1, 1900 (#6960)

* LG-6497: Set min date for State ID page to January 1, 1900; remove leading zero from day

* [skip changelog]

* LG-7203: Use DB for service provider IPP feature enablement (#6945)

* LG-7203: Add in_person_proofing_enabled field to service_providers; update feature check to use new field

* LG-7203: Replace use of hardcoded IPP issuer config and update tests

* changelog: Upcoming Features, In-person proofing, Use DB for configuring service providers

* LG-7203: Switch to leaner query query clear expected value for in_person_proofing_enabled

* LG-7547-Password-Change-Reauthentication-Rate-Limit (#6955)

* LG-7547-Password-Change-Reauthentication-Rate-Limit

changelog: Internal, Attempts API, Track additional events

* LG-7195 | Adds reproof completed event (#6957)

changelog: Internal, Attempts API, Adds reproofing complete event

* Update Password Change to Profile Change (#6962)

changelog: Internal, Attempts API, Track additional events

* Enforce YARD parameter documentation for tracker_events.rb, fix errors (#6964)

[skip changelog]

Co-authored-by: Tim Bradley <90272033+NavaTim@users.noreply.github.com>
Co-authored-by: Luis H. Matos <ThatSpaceGuy@users.noreply.github.com>
Co-authored-by: Gene M. Angelo, Jr <web.gma@gmail.com>
Co-authored-by: Sheldon Bachstein <sheldon.bachstein@gsa.gov>
Co-authored-by: Kimball Bighorse <kimball.bighorse@gsa.gov>
Co-authored-by: Jonathan Hooper <jonathan.hooper@gsa.gov>
Co-authored-by: Matt Hinz <matthinz@gmail.com>
Co-authored-by: Alex Kritikos <alex.kritikos@gsa.gov>
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Co-authored-by: Shannon A <20867088+svalexander@users.noreply.github.com>
Co-authored-by: Rwolfe-Nava <87499456+Rwolfe-Nava@users.noreply.github.com>
Co-authored-by: Alex Bradley <alexander.bradley@gsa.gov>
Co-authored-by: Matt Wagner <mattwagner@navapbc.com>
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.

3 participants