Skip to content

Commit 2386711

Browse files
committed
finish up config var rename
There were some straggling references to the "field" encryption key that are now changed to "DEK" encryption key (including the name of the key rotation management command).
1 parent bcbf081 commit 2386711

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

tom_common/apps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def ready(self):
1414
# https://docs.djangoproject.com/en/5.1/topics/signals/#connecting-receiver-functions
1515
import tom_common.signals # noqa
1616

17-
self._check_field_encryption_key()
17+
self._check_dek_encryption_key()
1818

1919
# Set default plotly theme on startup
2020
valid_themes = ['plotly', 'plotly_white', 'plotly_dark', 'ggplot2', 'seaborn', 'simple_white', 'none']
@@ -26,8 +26,8 @@ def ready(self):
2626

2727
pio.templates.default = plotly_theme
2828

29-
def _check_field_encryption_key(self) -> None:
30-
"""Verify that the field encryption master key is configured.
29+
def _check_dek_encryption_key(self) -> None:
30+
"""Verify that the DEK encryption master key is configured.
3131
3232
This key is required for encrypting sensitive user data (API keys,
3333
observatory credentials) at rest in the database. Without it, the

tom_common/management/commands/rotate_field_encryption_key.py renamed to tom_common/management/commands/rotate_dek_encryption_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
1. Generate a new Fernet key:
88
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
99
2. Run the rotation:
10-
python manage.py rotate_field_encryption_key --new-key <new_key>
10+
python manage.py rotate_dek_encryption_key --new-key <new_key>
1111
3. Update your environment / settings.py with the new key.
1212
4. Restart the server.
1313
"""

tom_setup/management/commands/tom_setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ def generate_secret_key(self):
214214
self.context['SECRET_KEY'] = get_random_secret_key()
215215
self.ok()
216216

217-
def generate_field_encryption_key(self):
218-
self.status('Generating field encryption key... ')
217+
def generate_dek_encryption_key(self):
218+
self.status('Generating DEK encryption key... ')
219219
self.context['TOMTOOLKIT_DEK_ENCRYPTION_KEY'] = Fernet.generate_key().decode()
220220
self.ok()
221221

@@ -292,7 +292,7 @@ def handle(self, *args, **options):
292292
self.create_custom_code_app()
293293
self.create_project_dirs()
294294
self.generate_secret_key()
295-
self.generate_field_encryption_key()
295+
self.generate_dek_encryption_key()
296296
self.get_target_type()
297297
self.get_hint_preference()
298298
self.generate_config()

0 commit comments

Comments
 (0)