From 0da1bb3cd32a7f8abdc8095f44549898457c26fd Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Wed, 17 May 2023 16:27:59 +0530 Subject: [PATCH] mgr/dashboard: default encryption type to sse-s3 in rgw 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 (cherry picked from commit a08f89e777852f73d4900808a69bfcae0e4aa961) --- .../frontend/cypress/integration/rgw/buckets.e2e-spec.ts | 5 +++++ .../frontend/cypress/integration/rgw/buckets.po.ts | 9 +++++++++ .../rgw/rgw-bucket-form/rgw-bucket-form.component.html | 5 +++-- .../rgw/rgw-bucket-form/rgw-bucket-form.component.ts | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.e2e-spec.ts index e5ffdeee93fe6..6c50b48ec0b8a 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.e2e-spec.ts @@ -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); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.po.ts index 4804753d16734..a27be3c6ba487 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/rgw/buckets.po.ts @@ -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); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html index ad1534025c2b5..761081c374433 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html @@ -294,11 +294,12 @@ - + 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 Click here + (click)="openConfigModal()" + aria-label="click here">Click here diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts index 91449c7d3d888..de8e0383ac020 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts @@ -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'); } } -- 2.39.5