Skip to content

Commit

Permalink
LG-15393 Allow SPs to update the Post-IdV follow-up URL on the dashboard
Browse files Browse the repository at this point in the history
In !165 we removed the ability for partners to make changes to post-IdV follow-up while we did some work on the IdP to make that attribute safe to use. The work on the IdP is captured in this pull request: 18F/identity-idp#11781

When that pull request is merged and deploy it will be safe to merge and deploy this change to allow partners to edit this value.
  • Loading branch information
jmhooper committed Jan 30, 2025
1 parent d18dca7 commit dfec57d
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/service_config_wizard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def wizard_step_params
:metadata_url,
:return_to_sp_url,
:failure_to_proof_url,
:post_idv_follow_up_url,
:push_notification_url,
:signed_response_message_requested,
:sp_initiated_login_url,
Expand Down Expand Up @@ -320,6 +321,7 @@ def clear_formatting(service_provider)
sp_initiated_login_url
return_to_sp_url
failure_to_proof_url
post_idv_follow_up_url
push_notification_url
app_name
]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/service_providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def service_provider_params
:metadata_url,
:return_to_sp_url,
:failure_to_proof_url,
:post_idv_follow_up_url,
:push_notification_url,
:signed_response_message_requested,
:sp_initiated_login_url,
Expand Down Expand Up @@ -255,6 +256,7 @@ def clear_formatting(service_provider)
sp_initiated_login_url
return_to_sp_url
failure_to_proof_url
post_idv_follow_up_url
push_notification_url
app_name
]
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/packs/service_provider_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function ialOptionSetup() {
const ialLevel = document.getElementById('service_provider_ial');
const ialAttributesCheckboxes = document.querySelectorAll('.ial-attr-wrapper');
const failureToProofURL = document.querySelector('.service_provider_failure_to_proof_url');
const postIdvFollowUpURL = document.querySelector('.service_provider_post_idv_follow_up_url');
const ial1Attributes = ['email', 'all_emails', 'x509_subject', 'x509_presented', 'verified_at'];
const failureToProofURLInput = failureToProofURL && failureToProofURL.querySelector('input');

Expand Down Expand Up @@ -34,14 +35,17 @@ function ialOptionSetup() {
switch (ial) {
case '1':
hideElement(failureToProofURL);
hideElement(postIdvFollowUpURL);
toggleIAL1Options();
break;
case '2':
showElement(failureToProofURL);
showElement(postIdvFollowUpURL);
toggleIAL2Options();
break;
default:
showElement(failureToProofURL);
showElement(postIdvFollowUpURL);
toggleIAL2Options();
}
};
Expand Down
5 changes: 4 additions & 1 deletion app/models/wizard_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def has_field?(name)
assertion_consumer_logout_service_url: '',
block_encryption: DEFAULT_SAML_ENCRYPTION,
failure_to_proof_url: '',
post_idv_follow_up_url: '',
push_notification_url: '',
redirect_uris: [],
return_to_sp_url: '',
Expand All @@ -69,7 +70,6 @@ def has_field?(name)
metadata_url: nil,
service_provider_id: nil,
service_provider_user_id: nil,
post_idv_follow_up_url: nil,
}),
}.with_indifferent_access.freeze

Expand Down Expand Up @@ -130,6 +130,9 @@ def has_field?(name)
validates_with IdentityValidations::UriValidator,
attribute: :failure_to_proof_url,
on: 'redirects'
validates_with IdentityValidations::UriValidator,
attribute: :post_idv_follow_up_url,
on: 'redirects'
validates_with IdentityValidations::UriValidator,
attribute: :push_notification_url,
on: 'redirects'
Expand Down
4 changes: 4 additions & 0 deletions app/views/service_config_wizard/_redirects_oidc.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
label: accessible_label(form, 'Failure to Proof URL', :failure_to_proof_url),
hint: I18n.t('service_provider_form.failure_to_proof_url'),
required: true %>
<%= form.input :post_idv_follow_up_url,
input_html: { class: 'usa-input' },
label: accessible_label(form, 'Post IdV Follow-up URL', :post_idv_follow_up_url),
hint: I18n.t('service_provider_form.post_idv_follow_up_url') %>
<% end %>
<%= render(WizardFieldsetComponent.new(
form:,
Expand Down
4 changes: 4 additions & 0 deletions app/views/service_config_wizard/_redirects_saml.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
label: accessible_label(form, 'Failure to Proof URL', :failure_to_proof_url),
hint: I18n.t('service_provider_form.failure_to_proof_url'),
required: true %>
<%= form.input :post_idv_follow_up_url,
input_html: { class: 'usa-input' },
label: accessible_label(form, 'Post IdV Follow-up URL', :post_idv_follow_up_url),
hint: I18n.t('service_provider_form.post_idv_follow_up_url') %>
<% end %>
<%= render(WizardFieldsetComponent.new(
form:,
Expand Down
5 changes: 5 additions & 0 deletions app/views/service_providers/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ B7xxt8BVc69rHV15A0qyx77CLSj3tCx2IUXVqRs5mlvA==
hint: I18n.t('service_provider_form.failure_to_proof_url'),
required: true %>

<%= form.input :post_idv_follow_up_url,
input_html: { class: 'usa-input' },
label: 'Post IdV Follow-Up URL',
hint: I18n.t('service_provider_form.post_idv_follow_up_url') %>

<%= form.input :push_notification_url,
input_html: { class: 'usa-input' },
label: 'Push notification URL',
Expand Down
1 change: 1 addition & 0 deletions config/locales/simple_form.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ en:
identity_protocol: Identity Protocol
issuer: Issuer
logo_file: Logo file
post_idv_follow_up_url: Post IdV Follow-up URL
push_notification_url: Push notification URL
public_certificate: Public certificate
production: Ready for Production
Expand Down
2 changes: 2 additions & 0 deletions spec/controllers/service_providers_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
sp_initiated_login_url: ' https://login.me ',
return_to_sp_url: ' https://returntospurl.biz ',
failure_to_proof_url: ' https://failuretoproof.com ',
post_idv_follow_up_url: ' https://postidvfollowupurl.com ',
push_notification_url: ' https://pushnotifications.com ',
app_name: ' app name ',
help_text: init_help_params,
Expand All @@ -275,6 +276,7 @@
expect(sp.sp_initiated_login_url).to eq('https://login.me')
expect(sp.return_to_sp_url).to eq('https://returntospurl.biz')
expect(sp.failure_to_proof_url).to eq('https://failuretoproof.com')
expect(sp.post_idv_follow_up_url).to eq('https://postidvfollowupurl.com')
expect(sp.push_notification_url).to eq('https://pushnotifications.com')
expect(sp.app_name).to eq('app name')
end
Expand Down
26 changes: 26 additions & 0 deletions spec/features/service_config_wizard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,32 @@
end
end

it 'renders Post IdV Follow-up URL input if IAL2 is selected' do
existing_config = create(:service_provider,
:ready_to_activate_ial_2,
team:)
visit service_provider_path(existing_config)
click_on 'Edit'
visit service_config_wizard_path('redirects')

expect(page).to have_content(
t('simple_form.labels.service_provider.post_idv_follow_up_url'),
)
end

it 'does not render Post IdV Follow-up URL input if IAL1 is selected' do
existing_config = create(:service_provider,
:ready_to_activate_ial_1,
team:)
visit service_provider_path(existing_config)
click_on 'Edit'
visit service_config_wizard_path('redirects')

expect(page).to_not have_content(
t('simple_form.labels.service_provider.post_idv_follow_up_url'),
)
end

it 'renders Help text as expected' do
IdentityConfig.store[:service_config_wizard_enabled] = true
visit service_config_wizard_path('help_text')
Expand Down

0 comments on commit dfec57d

Please sign in to comment.