-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
ABDM API for related mobile app #32332
Conversation
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.
Took a first pass. Need to understand it better to review properly. Will offline.
@@ -0,0 +1,44 @@ | |||
import logging |
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.
what is the motivation behind having a module called "milestone_one"? I understand this is the first for 3 stages in terms of implementations but does it need to reflect in code?
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.
All milestones have different usecases and if there is need to add or remove certain usecases, based on certifications received, it will be easier to locate the code milestone wise.
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.
Can we add a README for milestone one? To explain things like
- what is ABHA?
- what is the ABDM mobile app?
- what interaction happen between CommCare App and HQ?
- A quick summary of how ABDM mobile app works with the CommCare App or a link if its written elsewhere.
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.
Can we take that as supplementary change for another PR as I believe that should be more formal and researched. We will require to pick content from mobile app's doc.
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.
Cool.
|
||
|
||
def generate_aadhar_otp(aadhaar_number): | ||
generate_aadhar_otp_url = "v1/registration/aadhaar/generateOtp" |
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.
Can these URLs be constants?
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.
moved
|
||
def required_request_params(params: List[str]): | ||
""" | ||
A version of the requires_privilege decorator which raises an Http404 |
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.
I don't understand the reference to requires_privilege
function here. Is that needed?
The name of the function seems good enough to me to signify what it does, so does not look like it needs any documentation at all too.
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.
Yes, it is copy paste residue, was removed.
def wrapped(request, *args, **kwargs): | ||
if not (params and isinstance(params, List)): | ||
error_msg = f"Request {request} could not be validated as validation input not provided." | ||
logger.warning(error_msg) |
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.
Is this still needed? Guessing this was added during development?
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.
Kept to audit invalid requests. Any harm in retaining?
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.
this would be in the logs where it would get removed from time to time. You would need something permanent if its for audit later.
settings.py
Outdated
@@ -2015,6 +2020,9 @@ def _pkce_required(client_id): | |||
|
|||
REST_FRAMEWORK = { | |||
'DATETIME_FORMAT': '%Y-%m-%dT%H:%M:%S.%fZ', | |||
'DEFAULT_AUTHENTICATION_CLASSES': ( | |||
'rest_framework.authentication.TokenAuthentication', | |||
), |
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.
what all does this impact outside of the abdm app?
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.
This is removed.
@@ -65,6 +66,7 @@ | |||
'util.TransientBounceEmail', | |||
'registration.AsyncSignupRequest', | |||
'users.UserHistory', | |||
'custom.abdm.models.ABDMUser', |
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.
why should this be ignored?
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.
Seems strange that this is included in dump but ignored during deletion.
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.
corrected, it should be included in deletion flow.
""" | ||
A version of the requires_privilege decorator which raises an Http404 | ||
if PermissionDenied is raised. | ||
Checks if the parameters provided in the decorator(a list of strings) are present in the DRF request. |
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.
👍
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.
Are these sensitive enough that they should be present in the request header and not in the params?
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.
These are in the POST body of request. Do you mean something else, which I misinterpreted?
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.
Okay.
I think its the term parameters that is being used. I would always think of these as params that are a part of the URL.
A better name could be required_request_data
or required_request_post_data
. Not sure what a better name could be for params.
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.
CONTRIBUTING.rst
Outdated
Contributing to CommCareHQ | ||
========================== | ||
=========================== | ||
Contributing to CommCare HQ |
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.
Oh, I think we need CommCareHQ only.
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.
This commit looks like things went wrong here?
…ficiary Existing abha check in verification flow
…ficiary Moved existing abha check to API used by mobile app
…ficiary ABHA Validation on HQ for Creation flow
Updated this m1 branch with |
I'm not sure what's up with the PR diff but I'm seeing changes from other branches. Perhaps try merge master? |
Yes we did integrated some changes from other branches. |
Hey @snopoke we don't intend to merge this into master. This PR is just to see the changes we have made for an long on-going integration effort. |
Product Description
Reopened PR of #32194
Changes include:
Technical Summary
https://docs.google.com/document/d/1gbQcAC3H4kj22iMCMMKSYMVO5_7kt56qiS8OWkd6e34/edit
Feature Flag
RESTORE_ADD_ABDM_TOKEN
Safety Assurance
Safety story
Manual testing in the local environment and dev instance of CommCare HQ deployed on Mumbai region.
Automated test coverage
[TODO]Automated unit tests
QA Plan
https://dimagi-dev.atlassian.net/browse/QA-4549
Migrations
Rollback instructions
Labels & Review