Skip to content

Commit

Permalink
Add post_idv_follow_up_url to URI validations
Browse files Browse the repository at this point in the history
* Add `post_idv_follow_up_url` to URI validations

In 18F/identity-idp#11591 we added a new `post_idv_follow_up_url` to the service provider. In https://gitlab.login.gov/lg/identity-dashboard/-/merge_requests/163 we are making that configurable by service provider maintainers.

This commit helps that effort by adding URI validations to this new field. This will help ensure that it has a valid value everywhere we expect.
  • Loading branch information
jmhooper committed Dec 6, 2024
1 parent a728dc4 commit 0851a16
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/identity_validations/service_provider_validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def self.included(base)

validates_with AllowedRedirectsValidator
validates_with UriValidator, attribute: :failure_to_proof_url
validates_with UriValidator, attribute: :post_idv_follow_up_url
validates_with UriValidator, attribute: :push_notification_url
validates_with UriValidator, attribute: :acs_url
validates_with UriValidator, attribute: :assertion_consumer_logout_service_url
Expand Down
2 changes: 2 additions & 0 deletions spec/identity_validations/service_provider_validation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
end
it { is_expected.to allow_value(*valid_urls, nil).for(:failure_to_proof_url) }
it { is_expected.not_to allow_value(*invalid_urls).for(:failure_to_proof_url) }
it { is_expected.to allow_value(*valid_urls, nil).for(:post_idv_follow_up_url) }
it { is_expected.not_to allow_value(*invalid_urls).for(:post_idv_follow_up_url) }
it { is_expected.to allow_value(*valid_urls, nil).for(:push_notification_url) }
it { is_expected.not_to allow_value(*invalid_urls).for(:push_notification_url) }
it { is_expected.to allow_value(*valid_urls, nil).for(:acs_url) }
Expand Down
1 change: 1 addition & 0 deletions spec/identity_validations/test_service_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
t.integer 'ial'
t.string 'redirect_uris'
t.text 'failure_to_proof_url'
t.string 'post_idv_follow_up_url'
t.string 'push_notification_url'
t.string 'certs'
t.string 'acs_url'
Expand Down

0 comments on commit 0851a16

Please sign in to comment.