From e3953d324bf4a019cb76bd9b66dd7d67bb59e09c Mon Sep 17 00:00:00 2001 From: Pedro Gonzalez Gomez Date: Wed, 21 Aug 2024 13:20:53 +0200 Subject: [PATCH] mgr/dashboard: add service management for oauth2-proxy Fixes: https://tracker.ceph.com/issues/67651 Signed-off-by: Pedro Gonzalez Gomez --- .../cypress/e2e/cluster/services.po.ts | 8 + .../e2e/orchestrator/05-services.e2e-spec.ts | 9 ++ .../service-form/service-form.component.html | 149 +++++++++++++++++- .../service-form/service-form.component.ts | 94 ++++++++++- .../src/app/shared/forms/cd-validators.ts | 17 ++ .../app/shared/models/service.interface.ts | 5 + 6 files changed, 278 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts index 4cb5223d46ac2..c546d5cc513a5 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/services.po.ts @@ -100,6 +100,14 @@ export class ServicesPageHelper extends PageHelper { } break; + case 'oauth2-proxy': + cy.get('#https_address').type('localhost:8443'); + cy.get('#provider_display_name').type('provider'); + cy.get('#client_id').type('foo'); + cy.get('#client_secret').type('bar'); + cy.get('#oidc_issuer_url').type('http://127.0.0.0:8080/realms/ceph'); + break; + default: cy.get('#service_id').type('test'); unmanaged diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/05-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/05-services.e2e-spec.ts index 0f30542f793c0..6eb14315fdbd0 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/05-services.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/05-services.e2e-spec.ts @@ -40,5 +40,14 @@ describe('Services page', () => { services.deleteService('smb.testsmb'); }); + + it('should create and delete an oauth2-proxy service', () => { + services.navigateTo('create'); + services.addService('oauth2-proxy'); + + services.checkExist('oauth2-proxy', true); + + services.deleteService('oauth2-proxy'); + }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html index 586ca57209fe9..91271ed78d755 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html @@ -16,6 +16,13 @@ Click here to create a new Realm/Zone Group/Zone + + Authentication must be enabled in an active `mgtm-gateway` service to enable Single Sign-On(SSO) with `oauth2-proxy` + +