Skip to content

Commit

Permalink
Update PII settings
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLamb committed Oct 9, 2023
1 parent eb62598 commit a421903
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
continue-on-error: true
run: |
git config user.name 'GitHub Actions'
git config user.email [email protected]
git config user.email [email protected] # /PS-IGNORE
git add .
git commit -m "Automated update of requirements.txt"
git push
Expand Down
34 changes: 17 additions & 17 deletions pii-secret-exclude.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
.env.ci
.env.example
.pre-commit-config.yaml
Procfile
README.md
config/stop-words.txt
config/synonyms.txt
core/templates/404.html
core/test/test_views.py
docs/features/search.excalidraw
import_wordpress/test/wordpress_test.xml
Makefile
package-lock.json
peoplefinder/test/conftest.py
peoplefinder/test/services/test_audit_log.py
poetry.lock
Procfile
README.md
requirements.txt
requirements/base.txt
requirements/dev.txt
requirements/prod.txt
runtime.txt
setup/init.sql
user/management/commands/create_test_users.py
user/migrations/0001_initial.py
user/migrations/0002_auto_20210216_0650.py
user/migrations/0004_historicaluser.py
user/test/factories.py
user/test/test_user.py
src/config/stop-words.txt
src/config/synonyms.txt
src/core/templates/404.html
src/core/test/test_views.py
src/peoplefinder/test/conftest.py
src/peoplefinder/test/services/test_audit_log.py
src/user/management/commands/create_test_users.py
src/user/migrations/0001_initial.py
src/user/migrations/0002_auto_20210216_0650.py
src/user/migrations/0004_historicaluser.py
src/user/test/factories.py
src/user/test/test_user.py
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "digital-workspace-v2"
version = "1.0.0"
description = ""
authors = ["Live Services <[email protected]>"]
authors = ["Live Services <[email protected]>"] # /PS-IGNORE
license = "MIT"
readme = "README.md"

Expand Down
2 changes: 1 addition & 1 deletion scripts/truncate_anonymise.py.cli
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ for person in Person.objects.all().reverse():
f"{person.first_name.lower()}.{person.last_name.lower()}@{email_parts[1]}"
)
person.user.username = (
f"{person.first_name.lower()}.{person.last_name.lower()}[email protected]"
f"{person.first_name.lower()}.{person.last_name.lower()}[email protected]" # /PS-IGNORE
)
person.user.email = person.email
if person.user.sso_contact_email is not None:
Expand Down
6 changes: 3 additions & 3 deletions src/e2e_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def recreate_db_between_tests(django_db_blocker):

@pytest.fixture
def superuser(django_db_blocker, django_user_model, page):
email = "[email protected]"
email = "[email protected]" # /PS-IGNORE

user, _ = django_user_model.objects.get_or_create(
username="testsuperuser",
Expand All @@ -142,10 +142,10 @@ def superuser(django_db_blocker, django_user_model, page):
@pytest.fixture
def user(django_db_blocker, django_user_model):
user, _ = django_user_model.objects.get_or_create(
username="[email protected]",
username="[email protected]", # /PS-IGNORE
first_name="John",
last_name="Smith",
email="[email protected]",
email="[email protected]", # /PS-IGNORE
legacy_sso_user_id="1234abcd-1234-abcd-1234-abcd1234abcd",
)
user.set_password("password")
Expand Down
16 changes: 10 additions & 6 deletions src/feedback/test/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from unittest.mock import call

import pytest
from django.test import override_settings
from django_feedback_govuk.models import BaseFeedback

Expand Down Expand Up @@ -56,7 +57,7 @@ def test_send_feedback_notification_with_no_email_recipients():

@override_settings(
GOVUK_NOTIFY_API_KEY="this-is-my-really-long-api-key-because-gov-uk-notify-expects-it-to-be-long-when-you-create-a-service",
FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS=["[email protected]"],
FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS=["[email protected]"], # /PS-IGNORE
FEEDBACK_NOTIFICATION_EMAIL_TEMPLATE_ID="test-template-id",
WAGTAILADMIN_BASE_URL="https://test.example.com/",
)
Expand All @@ -67,7 +68,7 @@ def test_send_feedback_notification_with_valid_settings(mocker):
)
send_feedback_notification()
mock_send_email_notification.assert_called_once_with(
email_address="[email protected]",
email_address="[email protected]", # /PS-IGNORE
template_id="test-template-id",
personalisation={
"feedback_url": "https://test.example.com/feedback/submitted/"
Expand All @@ -77,7 +78,10 @@ def test_send_feedback_notification_with_valid_settings(mocker):

@override_settings(
GOVUK_NOTIFY_API_KEY="this-is-my-really-long-api-key-because-gov-uk-notify-expects-it-to-be-long-when-you-create-a-service",
FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS=["[email protected]", "[email protected]"],
FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS=[
"[email protected]", # /PS-IGNORE
"[email protected]", # /PS-IGNORE
],
FEEDBACK_NOTIFICATION_EMAIL_TEMPLATE_ID="test-template-id",
WAGTAILADMIN_BASE_URL="https://test.example.com/",
)
Expand All @@ -88,14 +92,14 @@ def test_send_feedback_notification_with_multiple_emails(mocker):
)
expected_calls = [
call(
email_address="[email protected]",
email_address="[email protected]", # /PS-IGNORE
template_id="test-template-id",
personalisation={
"feedback_url": "https://test.example.com/feedback/submitted/"
},
),
call(
email_address="[email protected]",
email_address="[email protected]", # /PS-IGNORE
template_id="test-template-id",
personalisation={
"feedback_url": "https://test.example.com/feedback/submitted/"
Expand Down
2 changes: 1 addition & 1 deletion src/peoplefinder/backports.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Backport of Django's Postgres specific ArraySubquery expression.
# Documentation: https://docs.djangoproject.com/en/dev/ref/contrib/postgres/expressions/#arraysubquery-expressions
# Commit: https://github.com/django/django/commit/a06b977a91f043c509df781670fb4cf35cb437b7
# Commit: https://github.com/django/django/commit/a06b977a91f043c509df781670fb4cf35cb437b7 /PS-IGNORE
# TODO: Remove once Django has released this and we upgrade to that version.
class ArraySubquery(Subquery):
template = "ARRAY(%(subquery)s)"
Expand Down
4 changes: 2 additions & 2 deletions src/peoplefinder/legacy_migration/migrate_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ def migrate_person(legacy_person, person):
if legacy_person.ditsso_user_id:
person.legacy_sso_user_id = legacy_person.ditsso_user_id

# first name
# first name /PS-IGNORE
if legacy_person.given_name:
person.first_name = legacy_person.given_name

# last name
# last name /PS-IGNORE
if legacy_person.surname:
person.last_name = legacy_person.surname

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Migration(migrations.Migration):
name="preferred_first_name",
field=models.CharField(
blank=True,
help_text="This name appears on your profile. Colleagues can search for you using either of your first names",
help_text="This name appears on your profile. Colleagues can search for you using either of your first names", # /PS-IGNORE
max_length=200,
null=True,
),
Expand Down
2 changes: 1 addition & 1 deletion src/peoplefinder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ class RemoteWorking(models.TextChoices):
max_length=200,
help_text=(
"This name appears on your profile. Colleagues can search for you"
" using either of your first names"
" using either of your first names" # /PS-IGNORE
),
null=True,
blank=True,
Expand Down
2 changes: 1 addition & 1 deletion src/peoplefinder/services/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def create_user_profile(self, user: User) -> Person:
Q(legacy_sso_user_id=user.legacy_sso_user_id),
# Next see if we can match on the email.
Q(email=user.email),
# Finally try and match on the first and last name.
# Finally try and match on the first and last names /PS-IGNORE.
Q(first_name=user.first_name, last_name=user.last_name),
]

Expand Down
4 changes: 2 additions & 2 deletions src/peoplefinder/test/services/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_already_has_profile(self, normal_user):
{
"user": None,
"legacy_sso_user_id": "not-a-match",
"email": "[email protected]",
"email": "[email protected]", # /PS-IGNORE
},
),
)
Expand All @@ -120,7 +120,7 @@ def test_no_match(self, normal_user):

profile.user = None
profile.legacy_sso_user_id = "not-a-match"
profile.email = "[email protected]"
profile.email = "[email protected]" # /PS-IGNORE
profile.first_name = "no"
profile.last_name = "match"
profile.save()
Expand Down
6 changes: 3 additions & 3 deletions src/peoplefinder/test/views/test_delete_profile_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ def test_delete_profile_with_no_user(state):
other_user = UserFactory(
first_name="Other",
last_name="User",
email="[email protected]",
email="[email protected]", # /PS-IGNORE
legacy_sso_user_id=None,
username="[email protected]",
sso_contact_email="[email protected]",
username="[email protected]", # /PS-IGNORE
sso_contact_email="[email protected]", # /PS-IGNORE
)
other_user.save()
other_person = PersonService().create_user_profile(other_user)
Expand Down
6 changes: 3 additions & 3 deletions src/peoplefinder/test/views/test_profile_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,13 @@ def test_profile_edit_contact_view(state):
response = state.client.get(view_url)

assert response.status_code == 200
assert state.person.contact_email == "[email protected]"
assert state.person.contact_email == "[email protected]" # /PS-IGNORE
assert state.person.primary_phone_number is None
assert state.person.secondary_phone_number is None

form = ContactProfileEditForm(
{
"contact_email": "[email protected]",
"contact_email": "[email protected]", # /PS-IGNORE
"primary_phone_number": "01234567890",
"secondary_phone_number": "09876543210",
},
Expand All @@ -445,7 +445,7 @@ def test_profile_edit_contact_view(state):

assert response.status_code == 302
assert response.url == view_url
assert state.person.contact_email == "[email protected]"
assert state.person.contact_email == "[email protected]" # /PS-IGNORE
assert state.person.primary_phone_number == "01234567890"
assert state.person.secondary_phone_number == "09876543210"

Expand Down
2 changes: 1 addition & 1 deletion src/peoplefinder/test/views/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_updated_profile(self, another_normal_user):

another_normal_user.profile.first_name = "Tim"
another_normal_user.profile.preferred_first_name = "Tim"
another_normal_user.profile.email = "[email protected]"
another_normal_user.profile.email = "[email protected]" # /PS-IGNORE
another_normal_user.profile.save()

call_command("update_index")
Expand Down
8 changes: 4 additions & 4 deletions src/peoplefinder/test/views/test_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ def test_order_team_leaders(self, team_admin_user, software_team):
red_leader = UserFactory(
first_name="Red",
last_name="Leader",
email="[email protected]",
email="[email protected]", # /PS-IGNORE
legacy_sso_user_id=None,
username="red-leader",
sso_contact_email="[email protected]",
sso_contact_email="[email protected]", # /PS-IGNORE
)
gold_leader = UserFactory(
first_name="Gold",
last_name="Leader",
email="[email protected]",
email="[email protected]", # /PS-IGNORE
legacy_sso_user_id=None,
username="gold-leader",
sso_contact_email="[email protected]",
sso_contact_email="[email protected]", # /PS-IGNORE
)

call_command("create_user_profiles")
Expand Down

0 comments on commit a421903

Please sign in to comment.