-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error attaching сloud storage «STORJ» #5512
Labels
Comments
Today I created exactly the same request :D |
Hi, @darkAlert |
As for me - the same problem related to the key length limit |
7 tasks
nmanovic
pushed a commit
that referenced
this issue
Oct 16, 2023
It is currently not possible to add a Cloudflare R2 Bucket as a Cloud Storage source, since the Secret access key of R2 has a length of 64 but the ui/serializer restricts the length to 44. [This issue](#5512) addresses the same problem when using STORJ but with a max length of `128`. For me it would make the most sense to completely remove the max length, but this PR currently only fixes the R2 compatibility by increasing the max length to `64`.
mikhail-treskin
pushed a commit
to retailnext/cvat
that referenced
this issue
Oct 25, 2023
It is currently not possible to add a Cloudflare R2 Bucket as a Cloud Storage source, since the Secret access key of R2 has a length of 64 but the ui/serializer restricts the length to 44. [This issue](cvat-ai#5512) addresses the same problem when using STORJ but with a max length of `128`. For me it would make the most sense to completely remove the max length, but this PR currently only fixes the R2 compatibility by increasing the max length to `64`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An error occurs when trying to attach cloud storage «STORJ»( Provider: AWS S3; Authorization type: Key id and secret key pair ). The number of characters that can be input in the "SECRET ACCESS KEY ID" field is not enough. It's necessary to change the maximum number of characters allowed for the "SECRET ACCESS KEY ID" field (file /cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx; line 347: maxLength={44}; and file cvat/apps/engine/serializers.py; line 1179: secret_key = serializers.CharField(max_length=44, allow_blank=True, required=False))
Thank you in advance
patchfile:
diff --git a/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx b/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx
index f8b62a7c..583c1861 100644
--- a/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx
+++ b/cvat-ui/src/components/create-cloud-storage-page/cloud-storage-form.tsx
@@ -344,7 +344,7 @@ export default function CreateCloudStorageForm(props: Props): JSX.Element {
{...internalCommonProps}
>
<Input.Password
-maxLength={44}
+maxLength={128}
visibilityToggle={secretKeyVisibility}
onChange={() => setSecretKeyVisibility(true)}
onFocus={() => onFocusCredentialsItem('secretKey', 'secret_key')}
diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py
index fd2448b5..92f80a60 100644
--- a/cvat/apps/engine/serializers.py
+++ b/cvat/apps/engine/serializers.py
@@ -1176,7 +1176,7 @@ class CloudStorageWriteSerializer(serializers.ModelSerializer):
owner = BasicUserSerializer(required=False)
session_token = serializers.CharField(max_length=440, allow_blank=True, required=False)
key = serializers.CharField(max_length=40, allow_blank=True, required=False)
-secret_key = serializers.CharField(max_length=44, allow_blank=True, required=False)
+secret_key = serializers.CharField(max_length=128, allow_blank=True, required=False)
key_file = serializers.FileField(required=False)
account_name = serializers.CharField(max_length=24, allow_blank=True, required=False)
manifests = ManifestSerializer(many=True, default=[])
The text was updated successfully, but these errors were encountered: