mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
* add config directory, rename crl and urls models * fix imports * add cluster config fields to edit form * reorder url save * update tests * add to details page * add details test; * fix adapter name * fix cluster adapter test name * combine adapter tests * update imports * fix git diff * move crl and urls adapters to config folder * add config file * woops add config adapter * final renaming!! * fix imports after naming to base * add cluster to beforeModel hook * hide help text * maybe you should write tests that actually pass, claire * seriously claire its embarrassing
30 lines
1.1 KiB
JavaScript
30 lines
1.1 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({
|
|
role: this.pathHelp.getNewModel('pki/role', mountPath),
|
|
urls: this.pathHelp.getNewModel('pki/config/urls', mountPath),
|
|
cluster: this.pathHelp.getNewModel('pki/config/cluster', mountPath),
|
|
key: this.pathHelp.getNewModel('pki/key', mountPath),
|
|
signCsr: this.pathHelp.getNewModel('pki/sign-intermediate', mountPath),
|
|
certGenerate: this.pathHelp.getNewModel('pki/certificate/generate', mountPath),
|
|
certSign: this.pathHelp.getNewModel('pki/certificate/sign', mountPath),
|
|
});
|
|
}
|
|
}
|