From 3803df76aba9a9146a69f434a459b09e7f9ed022 Mon Sep 17 00:00:00 2001 From: Steve Urciuoli Date: Mon, 19 Oct 2020 22:19:24 -0500 Subject: [PATCH 1/5] LG-3645 Fix authentication costing for SAML --- app/controllers/saml_idp_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/saml_idp_controller.rb b/app/controllers/saml_idp_controller.rb index 096a6bcec22..fd577edbed9 100644 --- a/app/controllers/saml_idp_controller.rb +++ b/app/controllers/saml_idp_controller.rb @@ -105,6 +105,6 @@ def track_events analytics.track_event(Analytics::SP_REDIRECT_INITIATED) Db::SpReturnLog::AddReturn.call(request_id, current_user.id) increment_monthly_auth_count - add_sp_cost(sp_session[:ial2] ? :ial2_authentication : :ial1_authentication) + add_sp_cost(:authentication) end end From 4a4c873c5f3780785dbe3768bad991171b6765ad Mon Sep 17 00:00:00 2001 From: Steve Urciuoli Date: Mon, 19 Oct 2020 22:53:47 -0500 Subject: [PATCH 2/5] i18n unused --- config/locales/errors/en.yml | 2 -- config/locales/errors/es.yml | 2 -- config/locales/errors/fr.yml | 2 -- 3 files changed, 6 deletions(-) diff --git a/config/locales/errors/en.yml b/config/locales/errors/en.yml index 4825d9c4d33..dfae0f9f35b 100644 --- a/config/locales/errors/en.yml +++ b/config/locales/errors/en.yml @@ -67,8 +67,6 @@ en: photo_glare: Photo has glare, please try again. quota_reached: Sorry your service provider has reached its identity verification limit. Please contact your service provider for more information. - selfie: We couldn't read the photo of yourself, or match the photo to your ID. - Try taking a new picture. send_link_throttle: You tried too many times, please try again in 10 minutes. You can also click on Start Over and choose to use your computer instead. file_input: diff --git a/config/locales/errors/es.yml b/config/locales/errors/es.yml index 32b6fe726ab..8b988548ae4 100644 --- a/config/locales/errors/es.yml +++ b/config/locales/errors/es.yml @@ -68,8 +68,6 @@ es: quota_reached: Lo sentimos, su proveedor de servicios ha alcanzado su límite de verificación de identidad. Póngase en contacto con su proveedor de servicios para obtener más información. - selfie: No pudimos leer tu foto ni hacer coincidir la foto con tu identificación. - Intente tomar una nueva foto. send_link_throttle: Lo intentaste muchas veces, vuelve a intentarlo en 10 minutos. También puedes hacer clic en comenzar de nuevo y elegir usar tu computadora. file_input: diff --git a/config/locales/errors/fr.yml b/config/locales/errors/fr.yml index a1eda2b6c74..6e3384fa310 100644 --- a/config/locales/errors/fr.yml +++ b/config/locales/errors/fr.yml @@ -68,8 +68,6 @@ fr: quota_reached: Désolé, votre fournisseur de services a atteint sa limite de vérification d'identité. Veuillez contacter votre fournisseur de services pour plus d'informations. - selfie: Nous n'avons pas pu lire la photo de vous ni faire correspondre la photo - à votre pièce d'identité. Essayez de prendre une nouvelle photo. send_link_throttle: Vous avez essayé plusieurs fois, essayez à nouveau dans 10 minutes. Vous pouvez également cliquer sur recommencer et choisir d'utiliser votre ordinateur. From 41e888fe5c137a14450a582a3540d8bfbe3f800e Mon Sep 17 00:00:00 2001 From: Steve Urciuoli Date: Mon, 19 Oct 2020 23:25:24 -0500 Subject: [PATCH 3/5] Specs --- spec/controllers/saml_idp_controller_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/controllers/saml_idp_controller_spec.rb b/spec/controllers/saml_idp_controller_spec.rb index b6dc749d079..7e120fcc44c 100644 --- a/spec/controllers/saml_idp_controller_spec.rb +++ b/spec/controllers/saml_idp_controller_spec.rb @@ -989,6 +989,8 @@ def stub_requested_attributes expect(@analytics).to receive(:track_event).with(Analytics::SP_REDIRECT_INITIATED) generate_saml_response(user) + + expect_sp_authentication_cost end end @@ -1014,6 +1016,8 @@ def stub_requested_attributes expect(@analytics).to receive(:track_event).with(Analytics::SP_REDIRECT_INITIATED) generate_saml_response(user) + + expect_sp_authentication_cost end end end @@ -1029,4 +1033,9 @@ def stub_requested_attributes ) end end + + def expect_sp_authentication_cost + sp_cost = SpCost.where(issuer: 'http://localhost:3000', cost_type: 'authentication').first + expect(sp_cost).to be_present + end end From 9d42a31e584d8966357c0dcad3ce7e73ec472808 Mon Sep 17 00:00:00 2001 From: Steve Urciuoli Date: Tue, 20 Oct 2020 10:15:26 -0500 Subject: [PATCH 4/5] Revert i18n --- config/locales/errors/en.yml | 2 ++ config/locales/errors/es.yml | 2 ++ config/locales/errors/fr.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/config/locales/errors/en.yml b/config/locales/errors/en.yml index dfae0f9f35b..4825d9c4d33 100644 --- a/config/locales/errors/en.yml +++ b/config/locales/errors/en.yml @@ -67,6 +67,8 @@ en: photo_glare: Photo has glare, please try again. quota_reached: Sorry your service provider has reached its identity verification limit. Please contact your service provider for more information. + selfie: We couldn't read the photo of yourself, or match the photo to your ID. + Try taking a new picture. send_link_throttle: You tried too many times, please try again in 10 minutes. You can also click on Start Over and choose to use your computer instead. file_input: diff --git a/config/locales/errors/es.yml b/config/locales/errors/es.yml index 8b988548ae4..32b6fe726ab 100644 --- a/config/locales/errors/es.yml +++ b/config/locales/errors/es.yml @@ -68,6 +68,8 @@ es: quota_reached: Lo sentimos, su proveedor de servicios ha alcanzado su límite de verificación de identidad. Póngase en contacto con su proveedor de servicios para obtener más información. + selfie: No pudimos leer tu foto ni hacer coincidir la foto con tu identificación. + Intente tomar una nueva foto. send_link_throttle: Lo intentaste muchas veces, vuelve a intentarlo en 10 minutos. También puedes hacer clic en comenzar de nuevo y elegir usar tu computadora. file_input: diff --git a/config/locales/errors/fr.yml b/config/locales/errors/fr.yml index 6e3384fa310..a1eda2b6c74 100644 --- a/config/locales/errors/fr.yml +++ b/config/locales/errors/fr.yml @@ -68,6 +68,8 @@ fr: quota_reached: Désolé, votre fournisseur de services a atteint sa limite de vérification d'identité. Veuillez contacter votre fournisseur de services pour plus d'informations. + selfie: Nous n'avons pas pu lire la photo de vous ni faire correspondre la photo + à votre pièce d'identité. Essayez de prendre une nouvelle photo. send_link_throttle: Vous avez essayé plusieurs fois, essayez à nouveau dans 10 minutes. Vous pouvez également cliquer sur recommencer et choisir d'utiliser votre ordinateur. From 7c68d1d64896a855ae9300a547c8c336e0293bb3 Mon Sep 17 00:00:00 2001 From: Steve Urciuoli Date: Tue, 20 Oct 2020 10:17:16 -0500 Subject: [PATCH 5/5] Noop --- spec/controllers/saml_idp_controller_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/controllers/saml_idp_controller_spec.rb b/spec/controllers/saml_idp_controller_spec.rb index 7e120fcc44c..7af9c93b702 100644 --- a/spec/controllers/saml_idp_controller_spec.rb +++ b/spec/controllers/saml_idp_controller_spec.rb @@ -1035,7 +1035,8 @@ def stub_requested_attributes end def expect_sp_authentication_cost - sp_cost = SpCost.where(issuer: 'http://localhost:3000', cost_type: 'authentication').first + sp_cost = SpCost.where(issuer: 'http://localhost:3000', + cost_type: 'authentication').first expect(sp_cost).to be_present end end