-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: integrate with verification attempt events #226
Conversation
@@ -35,56 +41,52 @@ def verified_name_approved(sender, instance, **kwargs): # pylint: disable=unuse | |||
) | |||
|
|||
|
|||
def idv_attempt_handler(attempt_id, user_id, status, photo_id_name, full_name, **kwargs): |
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 only ever triggered by a SoftwareSecurePhotoVerification
and can removed since we will no longer be creating those records.
Why remove this?
We run idv_update_verified_name_task
on an attempt id which is not unique between the two data models making it ambiguous as to what field the attempt id from the LMS is really for. While we could start passing two fields (type, id) throughout the service that's going to be messy and type serves no purpose once SoftwareSecurePhotoVerification support is deprecated.
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.
Question: Do we need approval from Axim for this? I know we believe no one uses Software Secure outside of 2U, but if it's not deprecated, I'm a little concerned about breaking this flow. The Sumac release is being cut on 10/23/2024, so this will make it into that release before the Software Secure integration is removed. Do you have any concerns about this?
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.
ahh this is a great point. I originally wrote this under the assumption this repo was not part of Open edX since 2U is the only one using it. But as you pointed out earlier this is a default dependency so maybe we need to reconsider here
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.
to close out this thread. We've decided to move forward with this as is. Given the following:
- name-affirmation is only used by 2U
- name-affirmation can drop support for SoftwareSecurePhotoVerifications prior to it's full removal in the LMS
- functionally this would work as it did before for any verifications using the new models
@@ -43,7 +43,7 @@ def idv_update_verified_name_task(self, attempt_id, user_id, name_affirmation_st | |||
# want to grab all verified names for the same user and name combination, because | |||
# some of those records may already be associated with a different IDV attempt. | |||
verified_names = VerifiedName.objects.filter( | |||
(Q(verification_attempt_id=attempt_id) | Q(verification_attempt_id__isnull=True)) | |||
(Q(platform_verification_attempt_id=attempt_id) | Q(platform_verification_attempt_id__isnull=True)) |
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.
both here and with delete this library now assumes any future idv change is related to the new model, we've completely dropped support for SoftwareSecurePhotoVerification
changes.
3cc89c6
to
278cc6e
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
d6d6caf
to
220af76
Compare
# otherwise if there are no entries, we want to create one. | ||
|
||
# if there are no entries to update, we want to create one. | ||
if not verified_names_updated: |
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 actually fixes what appears to be an existing bug. If a user has a previously verified name using a different method (eg proctoring) and an new IDV creation event is emitted a new verified name record is not created. The event just gets dropped. From a user standpoint this doesn't really happen since the UI will post a blank name before that event but it still seemed like a gap.
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.
The change LGTM
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.
Looks good to me! I left a few questions but nothing blocking.
@@ -35,56 +41,52 @@ def verified_name_approved(sender, instance, **kwargs): # pylint: disable=unuse | |||
) | |||
|
|||
|
|||
def idv_attempt_handler(attempt_id, user_id, status, photo_id_name, full_name, **kwargs): |
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.
Question: Do we need approval from Axim for this? I know we believe no one uses Software Secure outside of 2U, but if it's not deprecated, I'm a little concerned about breaking this flow. The Sumac release is being cut on 10/23/2024, so this will make it into that release before the Software Secure integration is removed. Do you have any concerns about this?
edx_name_affirmation/handlers.py
Outdated
|
||
log.info(f'IDV_ATTEMPT {status} signal triggering Celery task for user {user.id} ' | ||
f'with photo_id_name {event_data.name}') |
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.
Nit. Could we use this as an opportunity to rename photo_id_name
? I have always found it a little confusing, and it's specific to Software Secure or forms of IDV that use IDs. Maybe "verified name" or something?
edx_name_affirmation/tasks.py
Outdated
else: | ||
verified_names = VerifiedName.objects.filter(proctored_exam_attempt_id=proctoring_attempt_id) | ||
log_message['field_name'] = 'proctored_exam_attempt_id' | ||
log_message['attempt_id'] = proctoring_attempt_id | ||
|
||
if verified_names: | ||
log.info( | ||
log.info( # there's a bug in this log message |
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's the bug? Is this something we need to ticket to fix or just a note-to-self that should be removed?
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.
ah this was a note to me to figure out if I wanted to fix this or ticket. The log message assumes the field the attempt_id is verification_attempt_id
(now updated to platform_verification) but it could be any of those types. It's minor, given our timeline I'll just remove the comment and backlog this
Description:
Adds support for handling events/signals on the new VerificationAttempt model added to edx-platform. This handling replaces this libraries support for reacting to changes on a SoftwareSecurePhotoVerification since those models are slated for deprecation -- openedx/edx-platform#35128.
Full details of this initiative can be found at: openedx/platform-roadmap#367
Decisions made in thisPR:
SoftwareSecurePhotoVerification
. Existing records will continue to support a verified name but no new verified names will be created (or removed) based on that model. This also means any existing pending records will no longer be updated.platform_verification_attempt_id
. This has some impact on edx-platform. We used IDV_ATTEMPT_APPROVED in those events to trigger a certificate update from theSSOVerification
andPhotoVerification
models. I now believe that was incorrect. Those records do not get any of the other openedx events for IDV_ATTEMPT_* and more importantly should not trigger name affirmation here. The event to trigger a certificate calculation from an SSOVerification should be wholly separate from this event.Impacts:
IDV_ATTEMPT_APPROVED
. SSO/PhotoVerification models should not emit the new openedx event. That work would block merging this.JIRA:
COSMO-493
Pre-Merge Checklist:
edx_name_affirmation/__init__.py
if these changes are to be released. See OEP-47: Semantic Versioning.CHANGELOG.rst
.Post-Merge: