From 707fded72db3347a32416ece39844aaf784e8565 Mon Sep 17 00:00:00 2001 From: MueezKhan246 <93375917+MueezKhan246@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:45:51 +0500 Subject: [PATCH] Altering client id and secret in sap configuration (#2219) * feat: altered decrypted_secret to be encrypted and made credentials nullable --- CHANGELOG.rst | 4 +++ enterprise/__init__.py | 2 +- .../migrations/0018_auto_20240829_0910.py | 29 +++++++++++++++++++ .../sap_success_factors/models.py | 8 +++-- 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 integrated_channels/sap_success_factors/migrations/0018_auto_20240829_0910.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9972ee595..14abbd18c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,10 @@ Unreleased ---------- * nothing unreleased +[4.23.15] +---------- +* feat: altered decrypted_secret to be encrypted and made credentials nullable + [4.23.14] ---------- * feat: populate encrypted client id and secret for canvas integration and remove references to unencrypted fields diff --git a/enterprise/__init__.py b/enterprise/__init__.py index eedfeb528..b977ea46c 100644 --- a/enterprise/__init__.py +++ b/enterprise/__init__.py @@ -2,4 +2,4 @@ Your project description goes here. """ -__version__ = "4.23.14" +__version__ = "4.23.15" diff --git a/integrated_channels/sap_success_factors/migrations/0018_auto_20240829_0910.py b/integrated_channels/sap_success_factors/migrations/0018_auto_20240829_0910.py new file mode 100644 index 000000000..2545b2eef --- /dev/null +++ b/integrated_channels/sap_success_factors/migrations/0018_auto_20240829_0910.py @@ -0,0 +1,29 @@ +# Generated by Django 3.2.23 on 2024-08-29 09:10 + +from django.db import migrations, models +import fernet_fields.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('sap_success_factors', '0017_auto_20240823_0936'), + ] + + operations = [ + migrations.AlterField( + model_name='sapsuccessfactorsenterprisecustomerconfiguration', + name='decrypted_secret', + field=fernet_fields.fields.EncryptedCharField(blank=True, default='', help_text='The encrypted OAuth client secret. It will be encrypted when stored in the database.', max_length=255, null=True, verbose_name='Encrypted Client Secret'), + ), + migrations.AlterField( + model_name='sapsuccessfactorsenterprisecustomerconfiguration', + name='key', + field=models.CharField(blank=True, default='', help_text='OAuth client identifier.', max_length=255, null=True, verbose_name='Client ID'), + ), + migrations.AlterField( + model_name='sapsuccessfactorsenterprisecustomerconfiguration', + name='secret', + field=models.CharField(blank=True, default='', help_text='OAuth client secret.', max_length=255, null=True, verbose_name='Client Secret'), + ), + ] diff --git a/integrated_channels/sap_success_factors/models.py b/integrated_channels/sap_success_factors/models.py index 4cf8e7e73..6ed925744 100644 --- a/integrated_channels/sap_success_factors/models.py +++ b/integrated_channels/sap_success_factors/models.py @@ -79,7 +79,8 @@ class SAPSuccessFactorsEnterpriseCustomerConfiguration(EnterpriseCustomerPluginC blank=True, default='', verbose_name="Client ID", - help_text=_("OAuth client identifier.") + help_text=_("OAuth client identifier."), + null=True ) decrypted_key = EncryptedCharField( @@ -120,10 +121,11 @@ class SAPSuccessFactorsEnterpriseCustomerConfiguration(EnterpriseCustomerPluginC blank=True, default='', verbose_name="Client Secret", - help_text=_("OAuth client secret.") + help_text=_("OAuth client secret."), + null=True ) - decrypted_secret = models.CharField( + decrypted_secret = EncryptedCharField( max_length=255, blank=True, default='',