From 8fd1ac3e7dc818c25ca07629649059605febe110 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 16 Nov 2022 10:53:07 -0800 Subject: [PATCH 01/10] reroute pki config routes --- ui/lib/pki/addon/routes.js | 9 +-------- ui/lib/pki/addon/routes/configuration.js | 3 +++ ui/lib/pki/addon/routes/configuration/create.js | 3 +++ .../addon/routes/configuration/create/generate-csr.js | 3 --- .../addon/routes/configuration/create/generate-root.js | 3 --- .../pki/addon/routes/configuration/create/import-ca.js | 3 --- ui/lib/pki/addon/routes/configuration/create/index.js | 3 --- ui/lib/pki/addon/routes/configuration/details.js | 3 --- ui/lib/pki/addon/routes/configuration/index.js | 3 --- .../{configuration/index.hbs => configuration.hbs} | 0 ui/lib/pki/addon/templates/configuration/create.hbs | 1 + .../templates/configuration/create/generate-csr.hbs | 1 - .../templates/configuration/create/generate-root.hbs | 1 - .../addon/templates/configuration/create/import-ca.hbs | 1 - .../pki/addon/templates/configuration/create/index.hbs | 1 - ui/lib/pki/addon/templates/configuration/details.hbs | 1 - ui/lib/pki/addon/templates/overview.hbs | 4 ++-- 17 files changed, 10 insertions(+), 33 deletions(-) create mode 100644 ui/lib/pki/addon/routes/configuration.js create mode 100644 ui/lib/pki/addon/routes/configuration/create.js delete mode 100644 ui/lib/pki/addon/routes/configuration/create/generate-csr.js delete mode 100644 ui/lib/pki/addon/routes/configuration/create/generate-root.js delete mode 100644 ui/lib/pki/addon/routes/configuration/create/import-ca.js delete mode 100644 ui/lib/pki/addon/routes/configuration/create/index.js delete mode 100644 ui/lib/pki/addon/routes/configuration/details.js delete mode 100644 ui/lib/pki/addon/routes/configuration/index.js rename ui/lib/pki/addon/templates/{configuration/index.hbs => configuration.hbs} (100%) create mode 100644 ui/lib/pki/addon/templates/configuration/create.hbs delete mode 100644 ui/lib/pki/addon/templates/configuration/create/generate-csr.hbs delete mode 100644 ui/lib/pki/addon/templates/configuration/create/generate-root.hbs delete mode 100644 ui/lib/pki/addon/templates/configuration/create/import-ca.hbs delete mode 100644 ui/lib/pki/addon/templates/configuration/create/index.hbs delete mode 100644 ui/lib/pki/addon/templates/configuration/details.hbs diff --git a/ui/lib/pki/addon/routes.js b/ui/lib/pki/addon/routes.js index fb54435516a1..aa2c3313e8c1 100644 --- a/ui/lib/pki/addon/routes.js +++ b/ui/lib/pki/addon/routes.js @@ -3,16 +3,9 @@ import buildRoutes from 'ember-engines/routes'; export default buildRoutes(function () { this.route('overview'); this.route('configuration', function () { - this.route('index', { path: '/' }); this.route('tidy'); - this.route('create', function () { - this.route('index', { path: '/' }); - this.route('import-ca'); - this.route('generate-root'); - this.route('generate-csr'); - }); + this.route('create'); this.route('edit'); - this.route('details'); }); this.route('roles', function () { this.route('index', { path: '/' }); diff --git a/ui/lib/pki/addon/routes/configuration.js b/ui/lib/pki/addon/routes/configuration.js new file mode 100644 index 000000000000..c7a5d12c71c9 --- /dev/null +++ b/ui/lib/pki/addon/routes/configuration.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class PkiConfigurationRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/configuration/create.js b/ui/lib/pki/addon/routes/configuration/create.js new file mode 100644 index 000000000000..73d6caa11f41 --- /dev/null +++ b/ui/lib/pki/addon/routes/configuration/create.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class PkiConfigurationCreateRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/configuration/create/generate-csr.js b/ui/lib/pki/addon/routes/configuration/create/generate-csr.js deleted file mode 100644 index bd35d7c0ef0f..000000000000 --- a/ui/lib/pki/addon/routes/configuration/create/generate-csr.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class PkiConfigurationCreateGenerateCsrRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/configuration/create/generate-root.js b/ui/lib/pki/addon/routes/configuration/create/generate-root.js deleted file mode 100644 index 4db5cef108ac..000000000000 --- a/ui/lib/pki/addon/routes/configuration/create/generate-root.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class PkiConfigurationCreateGenerateRootRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/configuration/create/import-ca.js b/ui/lib/pki/addon/routes/configuration/create/import-ca.js deleted file mode 100644 index 34021583d672..000000000000 --- a/ui/lib/pki/addon/routes/configuration/create/import-ca.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class PkiConfigurationCreateImportCaRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/configuration/create/index.js b/ui/lib/pki/addon/routes/configuration/create/index.js deleted file mode 100644 index 70fc318ba2f0..000000000000 --- a/ui/lib/pki/addon/routes/configuration/create/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class ConfigurationCreateIndexRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/configuration/details.js b/ui/lib/pki/addon/routes/configuration/details.js deleted file mode 100644 index a7208797762f..000000000000 --- a/ui/lib/pki/addon/routes/configuration/details.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class PkiConfigurationDetailsRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/configuration/index.js b/ui/lib/pki/addon/routes/configuration/index.js deleted file mode 100644 index 008389a1ca51..000000000000 --- a/ui/lib/pki/addon/routes/configuration/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import Route from '@ember/routing/route'; - -export default class PkiConfigurationIndexRoute extends Route {} diff --git a/ui/lib/pki/addon/templates/configuration/index.hbs b/ui/lib/pki/addon/templates/configuration.hbs similarity index 100% rename from ui/lib/pki/addon/templates/configuration/index.hbs rename to ui/lib/pki/addon/templates/configuration.hbs diff --git a/ui/lib/pki/addon/templates/configuration/create.hbs b/ui/lib/pki/addon/templates/configuration/create.hbs new file mode 100644 index 000000000000..5df068240ee0 --- /dev/null +++ b/ui/lib/pki/addon/templates/configuration/create.hbs @@ -0,0 +1 @@ +route: pki.configuration.create \ No newline at end of file diff --git a/ui/lib/pki/addon/templates/configuration/create/generate-csr.hbs b/ui/lib/pki/addon/templates/configuration/create/generate-csr.hbs deleted file mode 100644 index 69caa62151c2..000000000000 --- a/ui/lib/pki/addon/templates/configuration/create/generate-csr.hbs +++ /dev/null @@ -1 +0,0 @@ -configuration.create.generate-csr \ No newline at end of file diff --git a/ui/lib/pki/addon/templates/configuration/create/generate-root.hbs b/ui/lib/pki/addon/templates/configuration/create/generate-root.hbs deleted file mode 100644 index 539da1070340..000000000000 --- a/ui/lib/pki/addon/templates/configuration/create/generate-root.hbs +++ /dev/null @@ -1 +0,0 @@ -configuration.create.generate-root \ No newline at end of file diff --git a/ui/lib/pki/addon/templates/configuration/create/import-ca.hbs b/ui/lib/pki/addon/templates/configuration/create/import-ca.hbs deleted file mode 100644 index 6627ec6760dd..000000000000 --- a/ui/lib/pki/addon/templates/configuration/create/import-ca.hbs +++ /dev/null @@ -1 +0,0 @@ -configuration.create.import-ca \ No newline at end of file diff --git a/ui/lib/pki/addon/templates/configuration/create/index.hbs b/ui/lib/pki/addon/templates/configuration/create/index.hbs deleted file mode 100644 index 6b8911318eb4..000000000000 --- a/ui/lib/pki/addon/templates/configuration/create/index.hbs +++ /dev/null @@ -1 +0,0 @@ -configuration.create.index \ No newline at end of file diff --git a/ui/lib/pki/addon/templates/configuration/details.hbs b/ui/lib/pki/addon/templates/configuration/details.hbs deleted file mode 100644 index 313389f22708..000000000000 --- a/ui/lib/pki/addon/templates/configuration/details.hbs +++ /dev/null @@ -1 +0,0 @@ -configuration.details \ No newline at end of file diff --git a/ui/lib/pki/addon/templates/overview.hbs b/ui/lib/pki/addon/templates/overview.hbs index 9f27316275e2..ffd90bb995fe 100644 --- a/ui/lib/pki/addon/templates/overview.hbs +++ b/ui/lib/pki/addon/templates/overview.hbs @@ -10,14 +10,14 @@ /> - + Configure PKI - + Configure PKI \ No newline at end of file From 2f5906f24d4a94de7b8e40026e20a086ad6011b0 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 16 Nov 2022 13:33:59 -0800 Subject: [PATCH 02/10] issuers routes --- ui/app/serializers/pki/issuer.js | 2 ++ ui/lib/pki/addon/routes.js | 6 +++++- ui/lib/pki/addon/routes/issuers/index.js | 7 +++---- ui/lib/pki/addon/routes/issuers/issuer/cross-sign.js | 3 +++ ui/lib/pki/addon/routes/issuers/issuer/details.js | 3 +++ ui/lib/pki/addon/routes/issuers/issuer/edit.js | 3 +++ ui/lib/pki/addon/routes/issuers/issuer/sign.js | 3 +++ ui/lib/pki/addon/templates/issuers/index.hbs | 6 +++--- ui/lib/pki/addon/templates/issuers/issuer/cross-sign.hbs | 1 + ui/lib/pki/addon/templates/issuers/issuer/details.hbs | 1 + ui/lib/pki/addon/templates/issuers/issuer/edit.hbs | 1 + ui/lib/pki/addon/templates/issuers/issuer/sign.hbs | 1 + 12 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 ui/lib/pki/addon/routes/issuers/issuer/cross-sign.js create mode 100644 ui/lib/pki/addon/routes/issuers/issuer/details.js create mode 100644 ui/lib/pki/addon/routes/issuers/issuer/edit.js create mode 100644 ui/lib/pki/addon/routes/issuers/issuer/sign.js create mode 100644 ui/lib/pki/addon/templates/issuers/issuer/cross-sign.hbs create mode 100644 ui/lib/pki/addon/templates/issuers/issuer/details.hbs create mode 100644 ui/lib/pki/addon/templates/issuers/issuer/edit.hbs create mode 100644 ui/lib/pki/addon/templates/issuers/issuer/sign.hbs diff --git a/ui/app/serializers/pki/issuer.js b/ui/app/serializers/pki/issuer.js index 5db741e40853..9d5eddaa8931 100644 --- a/ui/app/serializers/pki/issuer.js +++ b/ui/app/serializers/pki/issuer.js @@ -1,6 +1,8 @@ import ApplicationSerializer from '../application'; export default class PkiIssuerSerializer extends ApplicationSerializer { + primaryKey = 'issuer_ref'; + // rehydrate each issuer model so all model attributes are accessible from the LIST response normalizeItems(payload) { if (payload.data) { diff --git a/ui/lib/pki/addon/routes.js b/ui/lib/pki/addon/routes.js index aa2c3313e8c1..e99ae29a299b 100644 --- a/ui/lib/pki/addon/routes.js +++ b/ui/lib/pki/addon/routes.js @@ -4,6 +4,8 @@ export default buildRoutes(function () { this.route('overview'); this.route('configuration', function () { this.route('tidy'); + this.route('generate'); + this.route('import'); this.route('create'); this.route('edit'); }); @@ -17,9 +19,11 @@ export default buildRoutes(function () { }); this.route('issuers', function () { this.route('index', { path: '/' }); - this.route('issuer', { path: '/:id' }, function () { + this.route('issuer', { path: '/:issuer_ref' }, function () { this.route('details'); this.route('edit'); + this.route('sign'); + this.route('cross-sign'); }); }); this.route('certificates', function () { diff --git a/ui/lib/pki/addon/routes/issuers/index.js b/ui/lib/pki/addon/routes/issuers/index.js index b945ff308136..14667bdc310e 100644 --- a/ui/lib/pki/addon/routes/issuers/index.js +++ b/ui/lib/pki/addon/routes/issuers/index.js @@ -8,15 +8,14 @@ export default class PkiIssuersIndexRoute extends Route { beforeModel() { // Must call this promise before the model hook otherwise it doesn't add OpenApi to record. - return this.pathHelp.getNewModel('pki/pki-issuer-engine', 'pki'); + return this.pathHelp.getNewModel('pki/issuer', 'pki'); } model() { // the pathHelp service is needed for adding openAPI to the model - this.pathHelp.getNewModel('pki/pki-issuer-engine', 'pki'); - + this.pathHelp.getNewModel('pki/issuer', 'pki'); return this.store - .query('pki/pki-issuer-engine', { backend: this.secretMountPath.currentPath }) + .query('pki/issuer', { backend: this.secretMountPath.currentPath }) .then((issuersModel) => { return { issuersModel, parentModel: this.modelFor('issuers') }; }) diff --git a/ui/lib/pki/addon/routes/issuers/issuer/cross-sign.js b/ui/lib/pki/addon/routes/issuers/issuer/cross-sign.js new file mode 100644 index 000000000000..7b4d515d5271 --- /dev/null +++ b/ui/lib/pki/addon/routes/issuers/issuer/cross-sign.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class PkiIssuerCrossSignRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/issuers/issuer/details.js b/ui/lib/pki/addon/routes/issuers/issuer/details.js new file mode 100644 index 000000000000..db8ba0c3ce9e --- /dev/null +++ b/ui/lib/pki/addon/routes/issuers/issuer/details.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class PkiIssuerDetailsRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/issuers/issuer/edit.js b/ui/lib/pki/addon/routes/issuers/issuer/edit.js new file mode 100644 index 000000000000..31614efcf696 --- /dev/null +++ b/ui/lib/pki/addon/routes/issuers/issuer/edit.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class PkiIssuerEditRoute extends Route {} diff --git a/ui/lib/pki/addon/routes/issuers/issuer/sign.js b/ui/lib/pki/addon/routes/issuers/issuer/sign.js new file mode 100644 index 000000000000..dc2476b60df2 --- /dev/null +++ b/ui/lib/pki/addon/routes/issuers/issuer/sign.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class PkiIssuerSignRoute extends Route {} diff --git a/ui/lib/pki/addon/templates/issuers/index.hbs b/ui/lib/pki/addon/templates/issuers/index.hbs index 34c685be583f..f10803d107e9 100644 --- a/ui/lib/pki/addon/templates/issuers/index.hbs +++ b/ui/lib/pki/addon/templates/issuers/index.hbs @@ -10,7 +10,7 @@ /> - + Import @@ -22,12 +22,12 @@