]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: default encryption type to sse-s3 in rgw
authorNizamudeen A <nia@redhat.com>
Wed, 17 May 2023 10:57:59 +0000 (16:27 +0530)
committerNizamudeen A <nia@redhat.com>
Fri, 26 May 2023 06:30:58 +0000 (12:00 +0530)
by default the form doesn't select any values, so i am defaulting it to
sse-s3

Fixes: https://tracker.ceph.com/issues/61211
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit a08f89e777852f73d4900808a69bfcae0e4aa961)

src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.po.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts

index e5ffdeee93fe688e8d963793279536eee78ca186..6c50b48ec0b8af09a00b465f49ed4179b6261562 100644 (file)
@@ -32,6 +32,11 @@ describe('RGW buckets page', () => {
       buckets.delete(bucket_name);
     });
 
+    it('should check default encryption is SSE-S3', () => {
+      buckets.navigateTo('create');
+      buckets.checkForDefaultEncryption();
+    });
+
     it('should create bucket with object locking enabled', () => {
       buckets.navigateTo('create');
       buckets.create(bucket_name, BucketsPageHelper.USERS[0], 'default-placement', true);
index 4804753d167348b275cda402cd2aa265db4519a5..a27be3c6ba48767b4fb3bda9a5fb88ce10f17d53 100644 (file)
@@ -52,6 +52,15 @@ export class BucketsPageHelper extends PageHelper {
     this.getFirstTableCell(name).should('exist');
   }
 
+  @PageHelper.restrictTo(pages.create.url)
+  checkForDefaultEncryption() {
+    cy.get("cd-helper[aria-label='toggle encryption helper']").click();
+    cy.get("a[aria-label='click here']").click();
+    cy.get('cd-modal').within(() => {
+      cy.get('input[id=s3Enabled]').should('be.checked');
+    });
+  }
+
   @PageHelper.restrictTo(pages.index.url)
   edit(name: string, new_owner: string, isLocking = false) {
     this.navigateEdit(name);
index ad1534025c2b59a90f5bba8e9e5e65d03a1bd4ec..761081c374433226f35d0dae9731b7fd52044bc8 100644 (file)
                 <label class="form-check-label"
                        for="encryption_enabled"
                        i18n>Encryption</label>
-                <cd-helper>
+                <cd-helper aria-label="toggle encryption helper">
                   <span i18n>Enables encryption for the objects in the bucket.
                      To enable encryption on a bucket you need to set the configuration values for SSE-S3 or SSE-KMS.
                      To set the configuration values <a href="#/rgw/bucket/create"
-                                                        (click)="openConfigModal()">Click here</a></span>
+                                                        (click)="openConfigModal()"
+                                                        aria-label="click here">Click here</a></span>
                 </cd-helper>
               </div>
             </div>
index 91449c7d3d8880b75f2ecdb43b02517f2a810906..de8e0383ac020f6beca0cd726ea93e78f5119fd0 100644 (file)
@@ -335,6 +335,6 @@ export class RgwBucketFormComponent extends CdForm implements OnInit, AfterViewC
     const modalRef = this.modalService.show(RgwConfigModalComponent, null, { size: 'lg' });
     modalRef.componentInstance.configForm
       .get('encryptionType')
-      .setValue(this.bucketForm.getValue('encryption_type'));
+      .setValue(this.bucketForm.getValue('encryption_type') || 'AES256');
   }
 }