From 12010a2191157d3bbfb5dcf84dfe1c5ad3b50f23 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Mon, 19 Aug 2024 17:07:49 -0400 Subject: [PATCH 01/12] feat: Add IDV attempt events --- docs/decisions/0016 | 45 +++++++++++++++++++++++++++ openedx_events/learning/data.py | 16 ++++++++++ openedx_events/learning/signals.py | 49 ++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 docs/decisions/0016 diff --git a/docs/decisions/0016 b/docs/decisions/0016 new file mode 100644 index 00000000..c53f7370 --- /dev/null +++ b/docs/decisions/0016 @@ -0,0 +1,45 @@ +16. Event definitions for ID Verification +######################################### + +NOTE: This decision doc is still a work in progress. + +Status +****** + +**Draft** 2024-08-19 + +Context +******* + +IDV Change: +=========== +* We're changing it b/c software secure no longer supports IDV + +The IDV Vendor: +=============== +* Persona + + +Decision +******** + +Where these events will be produced/consumed: +============================================= + +* `persona-integration` will produce these events. + + * NOTE: There is no plan to have the legacy backend in `edx-platform`, produce these events. + +* `edx-platform` will consume these events in order to handle all behavior as it pertains to the state of an ID Verification. + +Event Definitions: +================== + +* We will define the events that as planned in `the ADR for events in persona_integration `_. + +Consequences +************ + +* `persona_integration` will emit events via the event bus to send information without needing a response. +* These events are dynamic, in that they can also be consumed by other services/applications as needed in the future. + diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index ba22df9a..f081e05d 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -589,3 +589,19 @@ class BadgeData: uuid = attr.ib(type=str) user = attr.ib(type=UserData) template = attr.ib(type=BadgeTemplateData) + + +@attr.s(frozen=True) +class VerificationAttemptData: + """ + Attributes defined for the persona-integration IDV attempt data object. + + Arguments: + asdf (type): description + """ + + user = attr.ib(type=UserData) + name = attr.ib(type=str) + status = attr.ib(type=str) + expiration_date = attr.ib(type=datetime) + inquiry_id = attr.ib(type=str) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index d3970066..288194d1 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -25,6 +25,7 @@ ProgramCertificateData, UserData, UserNotificationData, + VerificationAttemptData, XBlockSkillVerificationData, ) from openedx_events.tooling import OpenEdxPublicSignal @@ -401,3 +402,51 @@ "badge": BadgeData, } ) + + +# .. event_type: org.openedx.learning.idv_attempt.created.v1 +# .. event_name: IDV_ATTEMPT_CREATED +# .. event_description: Emitted when a IDV attempt is created by an IDV vendor +# .. event_data: VerificationAttemptData +IDV_ATTEMPT_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.idv_attempt.created.v1", + data={ + "idv_attempt": VerificationAttemptData, + } +) + + +# .. event_type: org.openedx.learning.idv_attempt.pending.v1 +# .. event_name: IDV_ATTEMPT_PENDING +# .. event_description: Emitted when a IDV attempt is marked as pending by an IDV vendor +# .. event_data: VerificationAttemptData +IDV_ATTEMPT_PENDING = OpenEdxPublicSignal( + event_type="org.openedx.learning.idv_attempt.pending.v1", + data={ + "idv_attempt": VerificationAttemptData, + } +) + + +# .. event_type: org.openedx.learning.idv_attempt.approved.v1 +# .. event_name: IDV_ATTEMPT_APPROVED +# .. event_description: Emitted when a IDV attempt is approved by an IDV vendor +# .. event_data: VerificationAttemptData +IDV_ATTEMPT_APPROVED = OpenEdxPublicSignal( + event_type="org.openedx.learning.idv_attempt.approved.v1", + data={ + "idv_attempt": VerificationAttemptData, + } +) + + +# .. event_type: org.openedx.learning.idv_attempt.denied.v1 +# .. event_name: IDV_ATTEMPT_DENIED +# .. event_description: Emitted when a IDV attempt is denied by an IDV vendor +# .. event_data: VerificationAttemptData +IDV_ATTEMPT_DENIED = OpenEdxPublicSignal( + event_type="org.openedx.learning.idv_attempt.denied.v1", + data={ + "idv_attempt": VerificationAttemptData, + } +) From 85f963f703ff28b4620a69b7008f349000a82a83 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Mon, 26 Aug 2024 15:40:07 -0400 Subject: [PATCH 02/12] test: added avro schemas --- .../{0016 => 0016-idv-attempt-events.rst} | 2 +- ...arning+idv_attempt+approved+v1_schema.avsc | 71 +++++++++++++++++++ ...earning+idv_attempt+created+v1_schema.avsc | 71 +++++++++++++++++++ ...learning+idv_attempt+denied+v1_schema.avsc | 71 +++++++++++++++++++ ...earning+idv_attempt+pending+v1_schema.avsc | 71 +++++++++++++++++++ 5 files changed, 285 insertions(+), 1 deletion(-) rename docs/decisions/{0016 => 0016-idv-attempt-events.rst} (91%) create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc diff --git a/docs/decisions/0016 b/docs/decisions/0016-idv-attempt-events.rst similarity index 91% rename from docs/decisions/0016 rename to docs/decisions/0016-idv-attempt-events.rst index c53f7370..f16dce68 100644 --- a/docs/decisions/0016 +++ b/docs/decisions/0016-idv-attempt-events.rst @@ -40,6 +40,6 @@ Event Definitions: Consequences ************ -* `persona_integration` will emit events via the event bus to send information without needing a response. +* The `verify_student` app will emit events via the event bus to send information without needing a response. * These events are dynamic, in that they can also be consumed by other services/applications as needed in the future. diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc new file mode 100644 index 00000000..db555bff --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc @@ -0,0 +1,71 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "idv_attempt", + "type": { + "name": "VerificationAttemptData", + "type": "record", + "fields": [ + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "name", + "type": "string" + }, + { + "name": "status", + "type": "string" + }, + { + "name": "expiration_date", + "type": "string" + }, + { + "name": "inquiry_id", + "type": "string" + } + ] + } + } + ], + "namespace": "org.openedx.learning.idv_attempt.approved.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc new file mode 100644 index 00000000..fe418fd6 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc @@ -0,0 +1,71 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "idv_attempt", + "type": { + "name": "VerificationAttemptData", + "type": "record", + "fields": [ + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "name", + "type": "string" + }, + { + "name": "status", + "type": "string" + }, + { + "name": "expiration_date", + "type": "string" + }, + { + "name": "inquiry_id", + "type": "string" + } + ] + } + } + ], + "namespace": "org.openedx.learning.idv_attempt.created.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc new file mode 100644 index 00000000..947d6e78 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc @@ -0,0 +1,71 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "idv_attempt", + "type": { + "name": "VerificationAttemptData", + "type": "record", + "fields": [ + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "name", + "type": "string" + }, + { + "name": "status", + "type": "string" + }, + { + "name": "expiration_date", + "type": "string" + }, + { + "name": "inquiry_id", + "type": "string" + } + ] + } + } + ], + "namespace": "org.openedx.learning.idv_attempt.denied.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc new file mode 100644 index 00000000..6b7e6376 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc @@ -0,0 +1,71 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "idv_attempt", + "type": { + "name": "VerificationAttemptData", + "type": "record", + "fields": [ + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "name", + "type": "string" + }, + { + "name": "status", + "type": "string" + }, + { + "name": "expiration_date", + "type": "string" + }, + { + "name": "inquiry_id", + "type": "string" + } + ] + } + } + ], + "namespace": "org.openedx.learning.idv_attempt.pending.v1" +} \ No newline at end of file From d216a9ce82f30b7c3c5105424512b9de455b57b2 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Mon, 26 Aug 2024 15:47:41 -0400 Subject: [PATCH 03/12] docs: quick lint fix --- docs/decisions/0016-idv-attempt-events.rst | 5 ++--- docs/decisions/index.rst | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/decisions/0016-idv-attempt-events.rst b/docs/decisions/0016-idv-attempt-events.rst index f16dce68..77b80271 100644 --- a/docs/decisions/0016-idv-attempt-events.rst +++ b/docs/decisions/0016-idv-attempt-events.rst @@ -26,10 +26,9 @@ Decision Where these events will be produced/consumed: ============================================= -* `persona-integration` will produce these events. - - * NOTE: There is no plan to have the legacy backend in `edx-platform`, produce these events. +* `persona-integration` will produce these events. +* NOTE: There is no plan to have the legacy backend in `edx-platform`, produce these events. * `edx-platform` will consume these events in order to handle all behavior as it pertains to the state of an ID Verification. Event Definitions: diff --git a/docs/decisions/index.rst b/docs/decisions/index.rst index 1a1f053a..d7cb3067 100644 --- a/docs/decisions/index.rst +++ b/docs/decisions/index.rst @@ -20,3 +20,4 @@ Architectural Decision Records (ADRs) 0013-special-exam-submission-and-review-events 0014-new-event-bus-producer-config 0015-outbox-pattern-and-production-modes + 0016-idv-attempt-events From 655e17e3b98fbb1e9eb55897b6cf9af4c31bb798 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Mon, 26 Aug 2024 15:51:10 -0400 Subject: [PATCH 04/12] chore: version bump --- openedx_events/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx_events/__init__.py b/openedx_events/__init__.py index 434522ad..445806a0 100644 --- a/openedx_events/__init__.py +++ b/openedx_events/__init__.py @@ -5,4 +5,4 @@ more information about the project. """ -__version__ = "9.12.0" +__version__ = "9.13.0" From c1984ea3775d7c9e8555198b238214bdf1073baf Mon Sep 17 00:00:00 2001 From: ilee2u Date: Wed, 28 Aug 2024 14:27:09 -0400 Subject: [PATCH 05/12] docs: improved ADR --- docs/decisions/0016-idv-attempt-events.rst | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/decisions/0016-idv-attempt-events.rst b/docs/decisions/0016-idv-attempt-events.rst index 77b80271..5934cfe8 100644 --- a/docs/decisions/0016-idv-attempt-events.rst +++ b/docs/decisions/0016-idv-attempt-events.rst @@ -1,12 +1,10 @@ 16. Event definitions for ID Verification ######################################### -NOTE: This decision doc is still a work in progress. - Status ****** -**Draft** 2024-08-19 +**Draft** 2024-08-28 Context ******* @@ -25,20 +23,16 @@ Decision Where these events will be produced/consumed: ============================================= - - -* `persona-integration` will produce these events. -* NOTE: There is no plan to have the legacy backend in `edx-platform`, produce these events. +* The intention is for the verify_student application to produce these events. +* These events should be vendor agnostic and should not produced by any IDV plugin. * `edx-platform` will consume these events in order to handle all behavior as it pertains to the state of an ID Verification. Event Definitions: ================== - -* We will define the events that as planned in `the ADR for events in persona_integration `_. +* We will define the events that as planned in `the ADR for events in persona_integration `_. Consequences ************ -* The `verify_student` app will emit events via the event bus to send information without needing a response. +* The `verify_student` app will emit events to send information to other applications, which can be handled as normal Django signals. * These events are dynamic, in that they can also be consumed by other services/applications as needed in the future. - From 47f7d48b741a164fc71c5fb356d137d1d50f112e Mon Sep 17 00:00:00 2001 From: ilee2u Date: Wed, 28 Aug 2024 14:40:40 -0400 Subject: [PATCH 06/12] fix: some param changes + nits - regenerated avro schemas --- ...arning+idv_attempt+approved+v1_schema.avsc | 24 ++++++++++++------- ...earning+idv_attempt+created+v1_schema.avsc | 24 ++++++++++++------- ...learning+idv_attempt+denied+v1_schema.avsc | 24 ++++++++++++------- ...earning+idv_attempt+pending+v1_schema.avsc | 24 ++++++++++++------- openedx_events/learning/data.py | 15 +++++++----- openedx_events/learning/signals.py | 8 +++---- 6 files changed, 77 insertions(+), 42 deletions(-) diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc index db555bff..e6a186ae 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+approved+v1_schema.avsc @@ -9,6 +9,10 @@ "name": "VerificationAttemptData", "type": "record", "fields": [ + { + "name": "attempt_id", + "type": "long" + }, { "name": "user", "type": { @@ -47,21 +51,25 @@ ] } }, - { - "name": "name", - "type": "string" - }, { "name": "status", "type": "string" }, { - "name": "expiration_date", - "type": "string" + "name": "name", + "type": [ + "null", + "string" + ], + "default": null }, { - "name": "inquiry_id", - "type": "string" + "name": "expiration_date", + "type": [ + "null", + "string" + ], + "default": null } ] } diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc index fe418fd6..665f18ad 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+created+v1_schema.avsc @@ -9,6 +9,10 @@ "name": "VerificationAttemptData", "type": "record", "fields": [ + { + "name": "attempt_id", + "type": "long" + }, { "name": "user", "type": { @@ -47,21 +51,25 @@ ] } }, - { - "name": "name", - "type": "string" - }, { "name": "status", "type": "string" }, { - "name": "expiration_date", - "type": "string" + "name": "name", + "type": [ + "null", + "string" + ], + "default": null }, { - "name": "inquiry_id", - "type": "string" + "name": "expiration_date", + "type": [ + "null", + "string" + ], + "default": null } ] } diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc index 947d6e78..4059bcf4 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+denied+v1_schema.avsc @@ -9,6 +9,10 @@ "name": "VerificationAttemptData", "type": "record", "fields": [ + { + "name": "attempt_id", + "type": "long" + }, { "name": "user", "type": { @@ -47,21 +51,25 @@ ] } }, - { - "name": "name", - "type": "string" - }, { "name": "status", "type": "string" }, { - "name": "expiration_date", - "type": "string" + "name": "name", + "type": [ + "null", + "string" + ], + "default": null }, { - "name": "inquiry_id", - "type": "string" + "name": "expiration_date", + "type": [ + "null", + "string" + ], + "default": null } ] } diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc index 6b7e6376..6e3d639b 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+idv_attempt+pending+v1_schema.avsc @@ -9,6 +9,10 @@ "name": "VerificationAttemptData", "type": "record", "fields": [ + { + "name": "attempt_id", + "type": "long" + }, { "name": "user", "type": { @@ -47,21 +51,25 @@ ] } }, - { - "name": "name", - "type": "string" - }, { "name": "status", "type": "string" }, { - "name": "expiration_date", - "type": "string" + "name": "name", + "type": [ + "null", + "string" + ], + "default": null }, { - "name": "inquiry_id", - "type": "string" + "name": "expiration_date", + "type": [ + "null", + "string" + ], + "default": null } ] } diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index f081e05d..814728a5 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -594,14 +594,17 @@ class BadgeData: @attr.s(frozen=True) class VerificationAttemptData: """ - Attributes defined for the persona-integration IDV attempt data object. + Attributes defined for the Open edX IDV attempt data object. Arguments: - asdf (type): description + attempt_id (int): the verification attempt id of the attempt being created or updated + user (User): the user (usually a learner) performing the verification attempt + name (string): the name being ID verified + status (string): the status of the verification attempt. Defaults to None. + expiration_datetime (datetime, optional): When the verification attempt expires. Defaults to None. """ - + attempt_id = attr.ib(type=int) user = attr.ib(type=UserData) - name = attr.ib(type=str) status = attr.ib(type=str) - expiration_date = attr.ib(type=datetime) - inquiry_id = attr.ib(type=str) + name = attr.ib(type=str, default=None) + expiration_date = attr.ib(type=datetime, default=None) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 288194d1..914708e0 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -406,7 +406,7 @@ # .. event_type: org.openedx.learning.idv_attempt.created.v1 # .. event_name: IDV_ATTEMPT_CREATED -# .. event_description: Emitted when a IDV attempt is created by an IDV vendor +# .. event_description: Emitted when a IDV attempt is created # .. event_data: VerificationAttemptData IDV_ATTEMPT_CREATED = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.created.v1", @@ -418,7 +418,7 @@ # .. event_type: org.openedx.learning.idv_attempt.pending.v1 # .. event_name: IDV_ATTEMPT_PENDING -# .. event_description: Emitted when a IDV attempt is marked as pending by an IDV vendor +# .. event_description: Emitted when a IDV attempt is marked as pending # .. event_data: VerificationAttemptData IDV_ATTEMPT_PENDING = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.pending.v1", @@ -430,7 +430,7 @@ # .. event_type: org.openedx.learning.idv_attempt.approved.v1 # .. event_name: IDV_ATTEMPT_APPROVED -# .. event_description: Emitted when a IDV attempt is approved by an IDV vendor +# .. event_description: Emitted when a IDV attempt is approved # .. event_data: VerificationAttemptData IDV_ATTEMPT_APPROVED = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.approved.v1", @@ -442,7 +442,7 @@ # .. event_type: org.openedx.learning.idv_attempt.denied.v1 # .. event_name: IDV_ATTEMPT_DENIED -# .. event_description: Emitted when a IDV attempt is denied by an IDV vendor +# .. event_description: Emitted when a IDV attempt is denied # .. event_data: VerificationAttemptData IDV_ATTEMPT_DENIED = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.denied.v1", From c0b1caaaefa65fe2699f5ef31881bd6589025301 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Wed, 28 Aug 2024 14:43:19 -0400 Subject: [PATCH 07/12] chore: quality --- openedx_events/learning/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 814728a5..f490e301 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -603,7 +603,7 @@ class VerificationAttemptData: status (string): the status of the verification attempt. Defaults to None. expiration_datetime (datetime, optional): When the verification attempt expires. Defaults to None. """ - attempt_id = attr.ib(type=int) + attempt_id = attr.ib(type=int) user = attr.ib(type=UserData) status = attr.ib(type=str) name = attr.ib(type=str, default=None) From 41901e6a2b9534bcd912543d8dcc55d8f8786122 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Wed, 28 Aug 2024 14:45:18 -0400 Subject: [PATCH 08/12] chore: quality again --- openedx_events/learning/data.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index f490e301..23ef5c98 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -603,6 +603,7 @@ class VerificationAttemptData: status (string): the status of the verification attempt. Defaults to None. expiration_datetime (datetime, optional): When the verification attempt expires. Defaults to None. """ + attempt_id = attr.ib(type=int) user = attr.ib(type=UserData) status = attr.ib(type=str) From c772157e2a592209770bf8bc6a6e2b147371161c Mon Sep 17 00:00:00 2001 From: ilee2u Date: Wed, 28 Aug 2024 14:49:33 -0400 Subject: [PATCH 09/12] docs: remove negligible adr --- docs/decisions/0016-idv-attempt-events.rst | 38 ---------------------- 1 file changed, 38 deletions(-) delete mode 100644 docs/decisions/0016-idv-attempt-events.rst diff --git a/docs/decisions/0016-idv-attempt-events.rst b/docs/decisions/0016-idv-attempt-events.rst deleted file mode 100644 index 5934cfe8..00000000 --- a/docs/decisions/0016-idv-attempt-events.rst +++ /dev/null @@ -1,38 +0,0 @@ -16. Event definitions for ID Verification -######################################### - -Status -****** - -**Draft** 2024-08-28 - -Context -******* - -IDV Change: -=========== -* We're changing it b/c software secure no longer supports IDV - -The IDV Vendor: -=============== -* Persona - - -Decision -******** - -Where these events will be produced/consumed: -============================================= -* The intention is for the verify_student application to produce these events. -* These events should be vendor agnostic and should not produced by any IDV plugin. -* `edx-platform` will consume these events in order to handle all behavior as it pertains to the state of an ID Verification. - -Event Definitions: -================== -* We will define the events that as planned in `the ADR for events in persona_integration `_. - -Consequences -************ - -* The `verify_student` app will emit events to send information to other applications, which can be handled as normal Django signals. -* These events are dynamic, in that they can also be consumed by other services/applications as needed in the future. From b652222951d608917855c7d8beb1d52e56a094f5 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Wed, 28 Aug 2024 14:51:26 -0400 Subject: [PATCH 10/12] chore: remove from toctree --- docs/decisions/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/decisions/index.rst b/docs/decisions/index.rst index d7cb3067..1a1f053a 100644 --- a/docs/decisions/index.rst +++ b/docs/decisions/index.rst @@ -20,4 +20,3 @@ Architectural Decision Records (ADRs) 0013-special-exam-submission-and-review-events 0014-new-event-bus-producer-config 0015-outbox-pattern-and-production-modes - 0016-idv-attempt-events From 5fcc3c808ec44e639fae2f6d913befb6c513324f Mon Sep 17 00:00:00 2001 From: ilee2u Date: Tue, 3 Sep 2024 13:33:00 -0400 Subject: [PATCH 11/12] chore: a few nits --- openedx_events/learning/data.py | 8 ++++---- openedx_events/learning/signals.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 23ef5c98..962dda35 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -597,10 +597,10 @@ class VerificationAttemptData: Attributes defined for the Open edX IDV attempt data object. Arguments: - attempt_id (int): the verification attempt id of the attempt being created or updated - user (User): the user (usually a learner) performing the verification attempt - name (string): the name being ID verified - status (string): the status of the verification attempt. Defaults to None. + attempt_id (int): the id of the verification attempt + user (User): the user (usually a learner) performing the verification attempt. + status (string): the status of the verification attempt. + name (string): the name being ID verified. Defaults to None. expiration_datetime (datetime, optional): When the verification attempt expires. Defaults to None. """ diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 914708e0..68fd2118 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -406,7 +406,7 @@ # .. event_type: org.openedx.learning.idv_attempt.created.v1 # .. event_name: IDV_ATTEMPT_CREATED -# .. event_description: Emitted when a IDV attempt is created +# .. event_description: Emitted when an IDV attempt is created # .. event_data: VerificationAttemptData IDV_ATTEMPT_CREATED = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.created.v1", @@ -418,7 +418,7 @@ # .. event_type: org.openedx.learning.idv_attempt.pending.v1 # .. event_name: IDV_ATTEMPT_PENDING -# .. event_description: Emitted when a IDV attempt is marked as pending +# .. event_description: Emitted when an IDV attempt is marked as pending # .. event_data: VerificationAttemptData IDV_ATTEMPT_PENDING = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.pending.v1", @@ -430,7 +430,7 @@ # .. event_type: org.openedx.learning.idv_attempt.approved.v1 # .. event_name: IDV_ATTEMPT_APPROVED -# .. event_description: Emitted when a IDV attempt is approved +# .. event_description: Emitted when an IDV attempt is approved # .. event_data: VerificationAttemptData IDV_ATTEMPT_APPROVED = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.approved.v1", @@ -442,7 +442,7 @@ # .. event_type: org.openedx.learning.idv_attempt.denied.v1 # .. event_name: IDV_ATTEMPT_DENIED -# .. event_description: Emitted when a IDV attempt is denied +# .. event_description: Emitted when an IDV attempt is denied # .. event_data: VerificationAttemptData IDV_ATTEMPT_DENIED = OpenEdxPublicSignal( event_type="org.openedx.learning.idv_attempt.denied.v1", From 19c9a4c781779c69c131682443c99b66cfeee9f9 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Thu, 5 Sep 2024 10:18:59 -0400 Subject: [PATCH 12/12] docs: update changelog --- CHANGELOG.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c49ab2c7..855dcae7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,14 @@ Change Log Unreleased ---------- +[9.13.0] - 2024-09-05 +--------------------- + +Added +~~~~~~~ + +* Added new IDV events ``LEARNER_CREDIT_COURSE_ENROLLMENT_REVOKED``, ``IDV_ATTEMPT_CREATED``, ``IDV_ATTEMPT_PENDING``, ``IDV_ATTEMPT_APPROVED``, and ``IDV_ATTEMPT_DENIED`` in learning. + [9.12.0] - 2024-07-31 ---------------------