From e92a810245deb04fcdd45363c18df4da895907ea Mon Sep 17 00:00:00 2001 From: Saurabh Kumar <70131915+Saurabhkmr98@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:37:57 +0530 Subject: [PATCH] [SILO-171] Models and migration to support oauth flow in integrations #3056 --- ...tial_source_authorization_type_and_more.py | 33 +++++++++++++++++++ apiserver/plane/ee/models/workspace.py | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 apiserver/plane/ee/migrations/0029_workspacecredential_source_authorization_type_and_more.py diff --git a/apiserver/plane/ee/migrations/0029_workspacecredential_source_authorization_type_and_more.py b/apiserver/plane/ee/migrations/0029_workspacecredential_source_authorization_type_and_more.py new file mode 100644 index 0000000000..8221958056 --- /dev/null +++ b/apiserver/plane/ee/migrations/0029_workspacecredential_source_authorization_type_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 4.2.20 on 2025-04-25 12:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ee', '0028_initiativecomment_edited_at_projectcomment_edited_at_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='workspacecredential', + name='source_authorization_type', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='workspacecredential', + name='source_identifier', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='workspacecredential', + name='target_authorization_type', + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AddField( + model_name='workspacecredential', + name='target_identifier', + field=models.CharField(blank=True, max_length=255, null=True), + ), + ] diff --git a/apiserver/plane/ee/models/workspace.py b/apiserver/plane/ee/models/workspace.py index 59197a91f0..204e0270c0 100644 --- a/apiserver/plane/ee/models/workspace.py +++ b/apiserver/plane/ee/models/workspace.py @@ -113,11 +113,15 @@ class WorkspaceCredential(BaseModel): "db.User", on_delete=models.CASCADE, related_name="credentials" ) # Source being the type of importer where issues are imported example: jira + source_identifier = models.CharField(max_length=255, null=True, blank=True) + source_authorization_type = models.CharField(max_length=255, null=True, blank=True) source_auth_email = models.EmailField(null=True, blank=True) source_access_token = models.TextField(null=True, blank=True) source_refresh_token = models.TextField(null=True, blank=True) source_hostname = models.TextField(null=True, blank=True) # Target being Plane where issues are imported to. + target_identifier = models.CharField(max_length=255, null=True, blank=True) + target_authorization_type = models.CharField(max_length=255, null=True, blank=True) target_access_token = models.TextField(null=True, blank=True) target_refresh_token = models.TextField(null=True, blank=True) target_hostname = models.TextField(null=True, blank=True)