-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Check mobile endpoints access across the board. #30761
Conversation
except form submission, as that handles things very differently
I'm not totally certain of the _noauth_post endpoint, but from looking at it, it's probably best to default to locking it down
corehq/apps/ota/views.py
Outdated
@@ -79,7 +79,6 @@ | |||
@location_safe | |||
@handle_401_response | |||
@mobile_auth_or_formplayer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really related but why does the restore endpoint need mobile_auth_or_formplayer
? Is it because SMS forms don't have user auth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I believe that's the case.
commcare-hq/corehq/apps/domain/decorators.py
Lines 361 to 364 in d5b9a30
- formplayer auth: for SMS forms there is no active user involved in the session and so | |
formplayer can not use the session cookie to auth. To allow formplayer access to the | |
endpoints we validate each formplayer request using a shared key. See the auth | |
function for more details. |
The restore endpoint is the only place that mechanism is used.
deployed to staging yesterday |
This PR has (finally) been superseded: |
Product Description
Technical Summary
Restrict access to all mobile endpoints when "restrict mobile endpoints" feature flag is enabled. I've done some testing on staging, and this seems to behave as expected, with one tangential caveat.
Note that this does also disable non-sensitive mobile operations like device log submissions, heartbeat, and so forth, though I think that's fine, as the idea is that nobody should be using mobile without permissions.
I think the only blocker on merge here is that we likely have APIs submitting to the mobile submission endpoint. We'll need to move them over to the new API submission endpoint before we can close that up.
Feature Flag
USH: Require explicit permissions to access mobile app endpoints
Safety Assurance
Safety story
Automated test coverage
QA Plan
I tested this on staging and found the expected behavior:
Rollback instructions
Labels & Review