Skip to content

Commit

Permalink
Fix updating Azure connection string && increase credentials max_leng…
Browse files Browse the repository at this point in the history
…th (#7336)
  • Loading branch information
Marishka17 committed Jan 9, 2024
1 parent 9b99f6a commit 40dc2a9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Updating cloud storage attached to CVAT using Azure connection string
(<https://github.com/opencv/cvat/pull/7336>)
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export default function CreateCloudStorageForm(props: Props): JSX.Element {
{...internalCommonProps}
>
<Input.Password
maxLength={440}
maxLength={1024}
visibilityToggle={connectionStringVisibility}
onChange={() => setConnectionStringVisibility(true)}
/>
Expand Down
17 changes: 17 additions & 0 deletions cvat/apps/engine/migrations/0078_alter_cloudstorage_credentials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.6 on 2024-01-09 09:55

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("engine", "0077_auto_20231121_1952"),
]

operations = [
migrations.AlterField(
model_name="cloudstorage",
name="credentials",
field=models.CharField(blank=True, max_length=1024, null=True),
),
]
2 changes: 1 addition & 1 deletion cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ class CloudStorage(models.Model):
on_delete=models.SET_NULL, related_name="cloud_storages")
created_date = models.DateTimeField(auto_now_add=True)
updated_date = models.DateTimeField(auto_now=True)
credentials = models.CharField(max_length=500, null=True, blank=True)
credentials = models.CharField(max_length=1024, null=True, blank=True)
credentials_type = models.CharField(max_length=29, choices=CredentialsTypeChoice.choices())#auth_type
specific_attributes = models.CharField(max_length=1024, blank=True)
description = models.TextField(blank=True)
Expand Down
4 changes: 2 additions & 2 deletions cvat/apps/engine/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@ class CloudStorageWriteSerializer(serializers.ModelSerializer):
key_file = serializers.FileField(required=False)
account_name = serializers.CharField(max_length=24, allow_blank=True, required=False)
manifests = ManifestSerializer(many=True, default=[])
connection_string = serializers.CharField(max_length=440, allow_blank=True, required=False)
connection_string = serializers.CharField(max_length=1024, allow_blank=True, required=False)

class Meta:
model = models.CloudStorage
Expand Down Expand Up @@ -1925,7 +1925,7 @@ def update(self, instance, validated_data):
})
credentials_dict = {k:v for k,v in validated_data.items() if k in {
'key','secret_key', 'account_name', 'session_token', 'key_file_path',
'credentials_type'
'credentials_type', 'connection_string'
}}

key_file = validated_data.pop('key_file', None)
Expand Down
4 changes: 2 additions & 2 deletions cvat/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6584,7 +6584,7 @@ components:
maxLength: 64
connection_string:
type: string
maxLength: 440
maxLength: 1024
key_file:
type: string
format: binary
Expand Down Expand Up @@ -8570,7 +8570,7 @@ components:
maxLength: 64
connection_string:
type: string
maxLength: 440
maxLength: 1024
key_file:
type: string
format: binary
Expand Down

0 comments on commit 40dc2a9

Please sign in to comment.