2018-09-25 16:28:26 +00:00
|
|
|
import EmberRouter from '@ember/routing/router';
|
2018-04-03 14:16:57 +00:00
|
|
|
import config from './config/environment';
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
const Router = EmberRouter.extend({
|
2018-04-03 14:16:57 +00:00
|
|
|
location: config.locationType,
|
|
|
|
rootURL: config.rootURL,
|
|
|
|
});
|
|
|
|
|
|
|
|
Router.map(function() {
|
|
|
|
this.route('vault', { path: '/' }, function() {
|
|
|
|
this.route('cluster', { path: '/:cluster_name' }, function() {
|
2019-02-14 15:39:19 +00:00
|
|
|
this.route('oidc-callback', { path: '/auth/*auth_path/oidc/callback' });
|
2018-04-03 14:16:57 +00:00
|
|
|
this.route('auth');
|
|
|
|
this.route('init');
|
|
|
|
this.route('logout');
|
2019-07-02 22:41:23 +00:00
|
|
|
this.mount('open-api-explorer', { path: '/api-explorer' });
|
2018-10-12 19:03:01 +00:00
|
|
|
this.route('license');
|
2019-06-19 23:14:25 +00:00
|
|
|
this.route('requests', { path: '/metrics/requests' });
|
2019-10-14 18:23:29 +00:00
|
|
|
this.route('storage', { path: '/storage/raft' });
|
|
|
|
this.route('storage-restore', { path: '/storage/raft/restore' });
|
2018-04-03 14:16:57 +00:00
|
|
|
this.route('settings', function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('seal');
|
|
|
|
this.route('auth', function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('enable');
|
|
|
|
this.route('configure', { path: '/configure/:method' }, function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('section', { path: '/:section_name' });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.route('mount-secret-backend');
|
|
|
|
this.route('configure-secret-backend', { path: '/secrets/configure/:backend' }, function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('section', { path: '/:section_name' });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.route('unseal');
|
|
|
|
this.route('tools', function() {
|
2018-09-25 16:28:26 +00:00
|
|
|
this.route('tool', { path: '/:selected_action' });
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
|
|
|
this.route('access', function() {
|
|
|
|
this.route('methods', { path: '/' });
|
|
|
|
this.route('method', { path: '/:path' }, function() {
|
|
|
|
this.route('index', { path: '/' });
|
2019-06-21 15:18:26 +00:00
|
|
|
this.route('item', { path: '/item/:item_type' }, function() {
|
|
|
|
this.route('list', { path: '/' });
|
|
|
|
this.route('create');
|
|
|
|
this.route('edit', { path: '/edit/:item_id' });
|
|
|
|
this.route('show', { path: '/show/:item_id' });
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
this.route('section', { path: '/:section_name' });
|
|
|
|
});
|
|
|
|
this.route('leases', function() {
|
|
|
|
// lookup
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
// lookup prefix
|
|
|
|
// revoke prefix + revoke force
|
|
|
|
this.route('list-root', { path: '/list/' });
|
|
|
|
this.route('list', { path: '/list/*prefix' });
|
|
|
|
//renew + revoke
|
|
|
|
this.route('show', { path: '/show/*lease_id' });
|
|
|
|
});
|
|
|
|
// the outer identity route handles group and entity items
|
|
|
|
this.route('identity', { path: '/identity/:item_type' }, function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('create');
|
|
|
|
this.route('merge');
|
|
|
|
this.route('edit', { path: '/edit/:item_id' });
|
|
|
|
this.route('show', { path: '/:item_id/:section' });
|
|
|
|
this.route('aliases', function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('add', { path: '/add/:item_id' });
|
|
|
|
this.route('edit', { path: '/edit/:item_alias_id' });
|
|
|
|
this.route('show', { path: '/:item_alias_id/:section' });
|
|
|
|
});
|
|
|
|
});
|
2018-07-19 01:59:04 +00:00
|
|
|
this.route('control-groups');
|
2018-10-21 19:19:34 +00:00
|
|
|
this.route('control-groups-configure', { path: '/control-groups/configure' });
|
2018-07-19 01:59:04 +00:00
|
|
|
this.route('control-group-accessor', { path: '/control-groups/:accessor' });
|
2018-08-16 17:48:24 +00:00
|
|
|
this.route('namespaces', function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('create');
|
|
|
|
});
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|
|
|
|
this.route('secrets', function() {
|
|
|
|
this.route('backends', { path: '/' });
|
|
|
|
this.route('backend', { path: '/:backend' }, function() {
|
2019-06-21 21:05:45 +00:00
|
|
|
this.mount('kmip');
|
2018-04-03 14:16:57 +00:00
|
|
|
this.route('index', { path: '/' });
|
2018-05-23 16:25:52 +00:00
|
|
|
this.route('configuration');
|
2018-04-03 14:16:57 +00:00
|
|
|
// because globs / params can't be empty,
|
|
|
|
// we have to special-case ids of '' with thier own routes
|
|
|
|
this.route('list-root', { path: '/list/' });
|
|
|
|
this.route('create-root', { path: '/create/' });
|
|
|
|
this.route('show-root', { path: '/show/' });
|
|
|
|
this.route('edit-root', { path: '/edit/' });
|
|
|
|
|
|
|
|
this.route('list', { path: '/list/*secret' });
|
|
|
|
this.route('show', { path: '/show/*secret' });
|
|
|
|
this.route('create', { path: '/create/*secret' });
|
|
|
|
this.route('edit', { path: '/edit/*secret' });
|
|
|
|
|
|
|
|
this.route('credentials-root', { path: '/credentials/' });
|
|
|
|
this.route('credentials', { path: '/credentials/*secret' });
|
|
|
|
|
2018-10-19 22:24:57 +00:00
|
|
|
// kv v2 versions
|
|
|
|
this.route('versions-root', { path: '/versions/' });
|
|
|
|
this.route('versions', { path: '/versions/*secret' });
|
|
|
|
|
2018-04-03 14:16:57 +00:00
|
|
|
// ssh sign
|
|
|
|
this.route('sign-root', { path: '/sign/' });
|
|
|
|
this.route('sign', { path: '/sign/*secret' });
|
|
|
|
// transit-specific routes
|
|
|
|
this.route('actions-root', { path: '/actions/' });
|
|
|
|
this.route('actions', { path: '/actions/*secret' });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.route('policies', { path: '/policies/:type' }, function() {
|
|
|
|
this.route('index', { path: '/' });
|
|
|
|
this.route('create', { path: '/create' });
|
|
|
|
});
|
|
|
|
this.route('policy', { path: '/policy/:type' }, function() {
|
|
|
|
this.route('show', { path: '/:policy_name' });
|
|
|
|
this.route('edit', { path: '/:policy_name/edit' });
|
|
|
|
});
|
|
|
|
this.route('replication-dr-promote');
|
2019-05-13 19:05:25 +00:00
|
|
|
if (config.addRootMounts) {
|
|
|
|
config.addRootMounts.call(this);
|
|
|
|
}
|
2019-06-21 21:05:45 +00:00
|
|
|
|
2018-04-03 14:16:57 +00:00
|
|
|
this.route('not-found', { path: '/*path' });
|
|
|
|
});
|
|
|
|
this.route('not-found', { path: '/*path' });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
export default Router;
|