vault/ui/lib/pki/addon/routes/application.js
claire bontempo 34a722195e
UI: add pki/config/acme, fix pki/configcluster save bug (#20944)
* fix cluster/config actually saving doh

* add mkdown copy

* add acme config to edit form

* fix tests

* add empty state capabilities test

* add acceptance test for mixed permission save

* swap order to match form

* update copy

* make markdown changes

* fix y
2023-06-02 02:59:03 +00:00

32 lines
1.3 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
export default class PkiRoute extends Route {
@service pathHelp;
@service secretMountPath;
beforeModel() {
// We call pathHelp for all the models in this engine that use OpenAPI before any model hooks
// so that the model attributes hydrate correctly. These only need to be called once to add
// the openAPI attributes to the model prototype
const mountPath = this.secretMountPath.currentPath;
return hash({
acme: this.pathHelp.getNewModel('pki/config/acme', mountPath),
certGenerate: this.pathHelp.getNewModel('pki/certificate/generate', mountPath),
certSign: this.pathHelp.getNewModel('pki/certificate/sign', mountPath),
cluster: this.pathHelp.getNewModel('pki/config/cluster', mountPath),
key: this.pathHelp.getNewModel('pki/key', mountPath),
role: this.pathHelp.getNewModel('pki/role', mountPath),
signCsr: this.pathHelp.getNewModel('pki/sign-intermediate', mountPath),
tidy: this.pathHelp.getNewModel('pki/tidy', mountPath),
urls: this.pathHelp.getNewModel('pki/config/urls', mountPath),
});
}
}