Skip to content

Remove unused phone PATCH route#7947

Merged
aduth merged 2 commits intomainfrom
aduth-rm-phone-patch-route
Mar 14, 2023
Merged

Remove unused phone PATCH route#7947
aduth merged 2 commits intomainfrom
aduth-rm-phone-patch-route

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Mar 8, 2023

DO NOT MERGE until after #7944 has been deployed to production.

🛠 Summary of changes

Follow-up to #7944 (and #7826) to remove the phone creation PATCH route, which has to be removed separately to avoid issues during deployment.

changelog: Internal, Code Quality, Reconcile routes for adding phone
RackAttack throttles for any non-GET request, not specifically on the PATCH method: https://github.com/18F/identity-idp/blob/e10b263/config/initializers/rack_attack.rb#L202
@aduth
Copy link
Contributor Author

aduth commented Mar 13, 2023

#7944 was deployed in RC 260, so this is no longer blocked.

it 'does not throttle the request' do
(phone_setups_per_ip_limit - 1).times do
patch '/phone_setup', headers: { REMOTE_ADDR: '1.2.3.4' }
post '/phone_setup', headers: { REMOTE_ADDR: '1.2.3.4' }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned in the extended commit message, this is fortunately not cause for concern, since throttling applies to any non-GET request:

req.remote_ip if req.path.match?(%r{/add/phone|/phone_setup}) && !req.get?

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@aduth aduth merged this pull request into main Mar 14, 2023
@aduth aduth deleted the aduth-rm-phone-patch-route branch March 14, 2023 12:13
mitchellhenke pushed a commit that referenced this pull request Mar 14, 2023
* Remove unused phone PATCH route

changelog: Internal, Code Quality, Reconcile routes for adding phone

* Update spec method

RackAttack throttles for any non-GET request, not specifically on the PATCH method: https://github.com/18F/identity-idp/blob/e10b263/config/initializers/rack_attack.rb#L202
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.

2 participants