Merge pull request #35779 from openedx/bmtcril/pii_safelist_update

chore: Add missing PII annotations, update safelist
This commit is contained in:
Brian Mesick
2024-11-06 16:27:09 +00:00
committed by GitHub
21 changed files with 188 additions and 10 deletions

View File

@@ -27,6 +27,8 @@ class IntegritySignature(TimeStampedModel):
class LTIPIITool(TimeStampedModel):
"""
This model stores the relationship between a course and the LTI tools in the course that share PII.
.. no_pii:
"""
course_key = CourseKeyField(max_length=255, unique=True, db_index=True)
lti_tools = models.JSONField()
@@ -39,6 +41,8 @@ class LTIPIITool(TimeStampedModel):
class LTIPIISignature(TimeStampedModel):
"""
This model stores a user's acknowledgement to share PII via LTI tools in a particular course.
.. no_pii:
"""
user = models.ForeignKey(User, db_index=True, on_delete=models.CASCADE)
course_key = CourseKeyField(max_length=255, db_index=True)
@@ -57,6 +61,8 @@ class LTIPIISignature(TimeStampedModel):
class ProctoringPIISignature(TimeStampedModel):
"""
This model stores a user's acknowledgment to share PII via proctoring in a particular course.
.. no_pii:
"""
user = models.ForeignKey(User, db_index=True, on_delete=models.CASCADE)
course_key = CourseKeyField(max_length=255, db_index=True)

View File

@@ -53,6 +53,8 @@ class LearningContext(TimeStampedModel):
because this table can contain things that are not courses.
It is okay to make a foreign key against this table.
.. no_pii:
"""
id = models.BigAutoField(primary_key=True)
context_key = LearningContextKeyField(
@@ -74,6 +76,8 @@ class LearningContext(TimeStampedModel):
class CourseContext(TimeStampedModel):
"""
A model containing course specific information e.g course_visibility
.. no_pii:
"""
learning_context = models.OneToOneField(
LearningContext, on_delete=models.CASCADE, primary_key=True, related_name="course_context"
@@ -106,6 +110,8 @@ class LearningSequence(TimeStampedModel):
CourseSectionSequence.
It is okay to make a foreign key against this table.
.. no_pii:
"""
id = models.BigAutoField(primary_key=True)
learning_context = models.ForeignKey(
@@ -131,6 +137,8 @@ class CourseContentVisibilityMixin(models.Model):
We keep the XBlock field names here, even if they're somewhat misleading.
Please read the comments carefully for each field.
.. no_pii:
"""
# This is an obscure, OLX-only flag (there is no UI for it in Studio) that
# lets you define a Sequence that is reachable by direct URL but not shown
@@ -174,6 +182,8 @@ class UserPartitionGroup(models.Model):
UserPartitionGroups are not associated with LearningSequence directly
because User Partitions often carry course-level assumptions (e.g.
Enrollment Track) that don't make sense outside of a Course.
.. no_pii:
"""
id = models.BigAutoField(primary_key=True)
partition_id = models.BigIntegerField(null=False)
@@ -191,6 +201,8 @@ class UserPartitionGroup(models.Model):
class CourseSection(CourseContentVisibilityMixin, TimeStampedModel):
"""
Course Section data, mapping to the 'chapter' block type.
.. no_pii:
"""
id = models.BigAutoField(primary_key=True)
course_context = models.ForeignKey(
@@ -225,6 +237,8 @@ class SectionPartitionGroup(models.Model):
Used for the user_partition_groups ManyToManyField field in the CourseSection model above.
Adds a cascading delete which will delete these many-to-many relations
whenever a UserPartitionGroup or CourseSection object is deleted.
.. no_pii:
"""
class Meta:
unique_together = [
@@ -249,6 +263,8 @@ class CourseSectionSequence(CourseContentVisibilityMixin, TimeStampedModel):
Do NOT make a foreign key against this table, as the values are deleted and
re-created on course publish.
.. no_pii:
"""
id = models.BigAutoField(primary_key=True)
course_context = models.ForeignKey(
@@ -289,6 +305,8 @@ class SectionSequencePartitionGroup(models.Model):
Used for the user_partition_groups ManyToManyField field in the CourseSectionSequence model above.
Adds a cascading delete which will delete these many-to-many relations
whenever a UserPartitionGroup or CourseSectionSequence object is deleted.
.. no_pii:
"""
class Meta:
unique_together = [
@@ -303,6 +321,8 @@ class CourseSequenceExam(TimeStampedModel):
"""
This model stores XBlock information that affects outline level information
pertaining to special exams
.. no_pii:
"""
course_section_sequence = models.OneToOneField(CourseSectionSequence, on_delete=models.CASCADE, related_name='exam')
@@ -318,6 +338,8 @@ class PublishReport(models.Model):
All these fields could be derived with aggregate SQL functions, but it would
be slower and make the admin code more complex. Since we only write at
publish time, keeping things in sync is less of a concern.
.. no_pii:
"""
learning_context = models.OneToOneField(
LearningContext, on_delete=models.CASCADE, related_name='publish_report'
@@ -350,6 +372,8 @@ class ContentError(models.Model):
freeform messages. It is quite possible that at some point we will come up
with a more comprehensive taxonomy of error messages, at which point we
could do a backfill to regenerate this data in a more normalized way.
.. no_pii:
"""
id = models.BigAutoField(primary_key=True)
publish_report = models.ForeignKey(

View File

@@ -89,6 +89,8 @@ class ContentLibrary(models.Model):
re-imported on another Open edX instance should be kept in Learning Core. This
model in Studio should only be used to track settings specific to this Open
edX instance, like who has permission to edit this content library.
.. no_pii:
"""
objects: ContentLibraryManager[ContentLibrary] = ContentLibraryManager()
@@ -183,6 +185,8 @@ class ContentLibrary(models.Model):
class ContentLibraryPermission(models.Model):
"""
Row recording permissions for a content library
.. no_pii:
"""
library = models.ForeignKey(ContentLibrary, on_delete=models.CASCADE, related_name="permission_grants")
# One of the following must be set (but not both):
@@ -226,6 +230,8 @@ class ContentLibraryPermission(models.Model):
class ContentLibraryBlockImportTask(models.Model):
"""
Model of a task to import blocks from an external source (e.g. modulestore).
.. no_pii:
"""
library = models.ForeignKey(
@@ -331,6 +337,8 @@ class LtiProfile(models.Model):
Unless Anonymous, this should be a unique representation of the LTI subject
(as per the client token ``sub`` identify claim) that initiated an LTI
launch through Content Libraries.
.. no_pii:
"""
objects = LtiProfileManager()
@@ -453,6 +461,8 @@ class LtiGradedResource(models.Model):
launch. This model links the profile that launched the resource with the
resource itself, allowing identifcation of the link through its usage key
string and user id.
.. no_pii:
"""
objects = LtiGradedResourceManager()

View File

@@ -16,6 +16,8 @@ class TaxonomyOrg(models.Model):
We keep this as a separate class from ContentTaxonomy so that class can remain a proxy for Taxonomy, keeping the
data models and usage simple.
.. no_pii:
"""
class RelType(models.TextChoices):

View File

@@ -12,6 +12,8 @@ from simple_history.models import HistoricalRecords
class CourseLiveConfiguration(TimeStampedModel):
"""
Associates a Course with a LTI provider and configuration
.. no_pii:
"""
course_key = CourseKeyField(max_length=255, db_index=True, null=False)
enabled = models.BooleanField(

View File

@@ -318,6 +318,8 @@ def get_supported_providers() -> List[str]:
class ProviderFilter(StackedConfigurationModel):
"""
Associate allow/deny-lists of discussions providers with courses/orgs
.. no_pii:
"""
allow = ListCharField(
@@ -406,6 +408,8 @@ T = TypeVar('T', bound='DiscussionsConfiguration')
class DiscussionsConfiguration(TimeStampedModel):
"""
Associates a learning context with discussion provider and configuration
.. no_pii:
"""
context_key = LearningContextKeyField(
@@ -554,6 +558,8 @@ class DiscussionsConfiguration(TimeStampedModel):
class DiscussionTopicLink(models.Model):
"""
A model linking discussion topics ids to the part of a course they are linked to.
..no_pii:
"""
context_key = LearningContextKeyField(
db_index=True,

View File

@@ -72,8 +72,14 @@ class AbstractProgramLTIConfiguration(TimeStampedModel):
class ProgramLiveConfiguration(AbstractProgramLTIConfiguration):
"""
.. no_pii:
"""
history = HistoricalRecords()
class ProgramDiscussionsConfiguration(AbstractProgramLTIConfiguration):
"""
.. no_pii:
"""
history = HistoricalRecords()

View File

@@ -426,6 +426,8 @@ class UserRetirementStatus(TimeStampedModel):
class BulkUserRetirementConfig(ConfigurationModel):
"""
Configuration to store a csv file that will be used in retire_user management command.
.. no_pii:
"""
# Timeout set to 0 so that the model does not read from cached config in case the config entry is deleted.
cache_timeout = 0

View File

@@ -98,7 +98,8 @@ class CourseYoutubeBlockedFlag(ConfigurationModel):
Disables the playback of youtube videos for a given course.
If the flag is present for the course, and set to "enabled",
then youtube is disabled for that course.
.. no_pii
.. no_pii:
"""
KEY_FIELDS = ('course_id',)