Skip to content
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

Cleaning up PII annotations #2293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions .annotation_safe_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,52 @@
# ".. choice_annotation:": foo, bar, baz

canvas.HistoricalCanvasEnterpriseCustomerConfiguration:
".. no_pii:": ""
".. no_pii:": ""
consent.HistoricalDataSharingConsent:
".. pii:": "The username field inherited from DataSharingConsent contains PII"
".. pii_types:": username
".. pii_retirement:": consumer_api
".. pii:": "The username field inherited from DataSharingConsent contains PII"
".. pii_types:": username
".. pii_retirement:": consumer_api
degreed.HistoricalDegreedEnterpriseCustomerConfiguration:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalDefaultEnterpriseEnrollmentIntention:
".. no_pii:": ""
enterprise.HistoricalDefaultEnterpriseEnrollmentRealization:
".. no_pii:": ""
enterprise.HistoricalEnrollmentNotificationEmailTemplate:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCourseEnrollment:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCustomer:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCustomerCatalog:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCustomerEntitlement:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseAnalyticsUser:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalPendingEnterpriseCustomerUser:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalPendingEnterpriseCustomerAdminUser:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalLicensedEnterpriseCourseEnrollment:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalPendingEnrollment:
".. no_pii:": ""
".. no_pii:": ""
moodle.HistoricalMoodleEnterpriseCustomerConfiguration:
".. no_pii:": ""
enterprise.EnterpriseCourseEntitlement:
Copy link
Author

@bmtcril bmtcril Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this one and the next are necessary here, I annotated them on the models, but if we need them here let me know so I can comment why.

".. no_pii:": ""
enterprise.EnterpriseCustomerSsoConfiguration:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCourseEntitlement:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCustomerInviteKey:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCustomerSsoConfiguration:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseCustomerUser:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseGroup:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalEnterpriseGroupMembership:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalLearnerCreditEnterpriseCourseEnrollment:
".. no_pii:": ""
".. no_pii:": ""
enterprise.HistoricalSystemWideEnterpriseUserRoleAssignment:
".. no_pii:": ""
".. no_pii:": ""
23 changes: 11 additions & 12 deletions .pii_annotations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ safelist_path: .annotation_safe_list.yml

# Local models are all fully annotated, but non-local models are not annotated
# because this repo does not contain an IDA/Django project (which, according to
# our own PII annotating policy, doesn't require non-local annotations). 75%
# our own PII annotating policy, doesn't require non-local annotations). 84.7%
# coverage represents all local models, and is the current theoretical maximum
# coverage.
# TODO: PLAT-2422
coverage_target: 75.0
coverage_target: 84.7

annotations:
".. no_pii:":
"pii_group":
- ".. pii:":
- ".. pii_types:":
choices: [id, name, username, email_address, other]
- ".. pii_retirement:":
choices: [retained, local_api, consumer_api, third_party]
".. no_pii:":
"pii_group":
- ".. pii:":
- ".. pii_types:":
choices: [id, name, username, email_address, other]
- ".. pii_retirement:":
choices: [retained, local_api, consumer_api, third_party]
extensions:
python:
- py
python:
- py
4 changes: 4 additions & 0 deletions enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1874,6 +1874,8 @@ def get_queryset(self):
class EnterpriseCourseEntitlement(TimeStampedModel):
"""
Store the information about the entitlement of an enterprise user for a course

.. no_pii:
"""

objects = EnterpriseCourseEntitlementManager()
Expand Down Expand Up @@ -4256,6 +4258,8 @@ def __repr__(self):
class EnterpriseCustomerSsoConfiguration(TimeStampedModel, SoftDeletableModel):
"""
Stores records of individual customer integrations with the SSO orchestration api.

.. no_pii:
"""
all_objects = models.Manager()

Expand Down
2 changes: 2 additions & 0 deletions integrated_channels/blackboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def __repr__(self):
class BlackboardEnterpriseCustomerConfiguration(EnterpriseCustomerPluginConfiguration):
"""
The Enterprise-specific configuration we need for integrating with Blackboard.

.. no_pii:
"""

decrypted_client_id = EncryptedCharField(
Expand Down
2 changes: 2 additions & 0 deletions integrated_channels/canvas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class CanvasEnterpriseCustomerConfiguration(EnterpriseCustomerPluginConfiguratio
The Enterprise-specific configuration we need for integrating with Canvas.

Based on: https://canvas.instructure.com/doc/api/file.oauth.html#oauth2-flow-3

.. no_pii:
"""

decrypted_client_id = EncryptedCharField(
Expand Down
8 changes: 7 additions & 1 deletion integrated_channels/integrated_channel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ def update_content_transmission_catalog(self, user):
class GenericEnterpriseCustomerPluginConfiguration(EnterpriseCustomerPluginConfiguration):
"""
A generic implementation of EnterpriseCustomerPluginConfiguration which can be instantiated

.. no_pii:
"""

def __str__(self):
Expand All @@ -479,7 +481,7 @@ class ApiResponseRecord(TimeStampedModel):
"""
Api response data for learner and content metadata transmissions

.. no_pii;
.. no_pii:
"""
status_code = models.PositiveIntegerField(
help_text='The most recent remote API call response HTTP status code',
Expand Down Expand Up @@ -891,6 +893,8 @@ class OrphanedContentTransmissions(TimeStampedModel):
"""
A model to track content metadata transmissions that were successfully sent to the integrated channel but then
subsequently were orphaned by a removal of their associated catalog from the customer.

.. no_pii:
"""
class Meta:
index_together = [('integrated_channel_code', 'plugin_configuration_id', 'resolved')]
Expand All @@ -909,6 +913,8 @@ class Meta:
class IntegratedChannelAPIRequestLogs(TimeStampedModel):
"""
A model to track basic information about every API call we make from the integrated channels.

.. no_pii:
"""

enterprise_customer = models.ForeignKey(
Expand Down
Loading