Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix updating Azure connection string && increase credentials max_length #7336

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading