Skip to content

Commit 3f2bab5

Browse files
authored
feat: adds setting to prevent nrps pii (#315)
We would like to enable PII in an LTI1.3 launch but turning that flag on would allow the tool to grab PII for the entire course roster via NRPS. We have not fully evaluated the privacy concerns if that is allowed. For the time being this platform setting can wholly disable PII over NRPS to avoid the issue
1 parent 3036835 commit 3f2bab5

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ Please See the [releases tab](https://github.com/openedx/xblock-lti-consumer/rel
1616
Unreleased
1717
~~~~~~~~~~
1818

19+
7.1.0 - 2022-12-09
20+
------------------
21+
* Add support for platform setting `LTI_NRPS_DISALLOW_PII` to prevent sharing of pii over the names and roles
22+
provisioning service.
23+
1924
7.0.3 - 2022-12-02
2025
------------------
2126
* Removed check against LMS specific `database_config_enabled` in LtiConfiguration model.

lti_consumer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from .apps import LTIConsumerApp
55
from .lti_xblock import LtiConsumerXBlock
66

7-
__version__ = '7.0.3'
7+
__version__ = '7.1.0'

lti_consumer/plugin/compat.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
from typing import Callable
66

7+
from django.conf import settings
78
from django.core.exceptions import ValidationError
89
from django.forms import ModelForm
910
from opaque_keys.edx.keys import CourseKey
@@ -303,3 +304,11 @@ def get_event_tracker(): # pragma: nocover
303304
return tracker
304305
except ModuleNotFoundError:
305306
return None
307+
308+
309+
def nrps_pii_disallowed():
310+
"""
311+
Check if platform disallows sharing pii over NRPS
312+
"""
313+
return (hasattr(settings, 'LTI_NRPS_DISALLOW_PII') and
314+
settings.LTI_NRPS_DISALLOW_PII is True)

lti_consumer/plugin/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,8 @@ def get_serializer_class(self):
682682
Overrides ModelViewSet's `get_serializer_class` method.
683683
Checks if PII fields can be exposed and returns appropiate serializer.
684684
"""
685-
if get_lti_pii_sharing_state_for_course(self.request.lti_configuration.location.course_key):
685+
if (not compat.nrps_pii_disallowed() and
686+
get_lti_pii_sharing_state_for_course(self.request.lti_configuration.location.course_key)):
686687
return LtiNrpsContextMembershipPIISerializer
687688
else:
688689
return LtiNrpsContextMembershipBasicSerializer

0 commit comments

Comments
 (0)