Skip to content

Commit 3d46115

Browse files
authored
add basic routes for secrets recovery (#31412)
* add basic routes for secrets recovery * lint fix no index invocation * hide routes in production * update routes * add missing route js files * add comments and clean up * update tests
1 parent bce06a8 commit 3d46115

File tree

18 files changed

+107
-5
lines changed

18 files changed

+107
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{!
2+
Copyright (c) HashiCorp, Inc.
3+
SPDX-License-Identifier: BUSL-1.1
4+
}}
5+
6+
{{! TODO: This is an empty skeleton component which will be completed as part of 1.21 feature work on single item recovery }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{!
2+
Copyright (c) HashiCorp, Inc.
3+
SPDX-License-Identifier: BUSL-1.1
4+
}}
5+
6+
{{! TODO: This is an empty skeleton component which will be completed as part of 1.21 feature work on single item recovery }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{!
2+
Copyright (c) HashiCorp, Inc.
3+
SPDX-License-Identifier: BUSL-1.1
4+
}}
5+
6+
{{! TODO: This is an empty skeleton component which will be completed as part of 1.21 feature work on single item recovery }}

ui/app/components/sidebar/nav/cluster.hbs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
data-test-sidebar-nav-link="Secrets Sync"
2222
/>
2323
{{/if}}
24+
{{#if this.isNotProduction}}
25+
<Nav.Link
26+
@route="vault.cluster.recovery.snapshots"
27+
@text="Secrets Recovery"
28+
data-test-sidebar-nav-link="Secrets Recovery"
29+
/>
30+
{{/if}}
2431
{{#if (has-permission "access")}}
2532
<Nav.Link
2633
@route={{get (route-params-for "access") "route"}}

ui/app/components/sidebar/nav/cluster.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import Component from '@glimmer/component';
77
import { service } from '@ember/service';
8+
import config from 'vault/config/environment';
89

910
export default class SidebarNavClusterComponent extends Component {
1011
@service currentCluster;
@@ -57,4 +58,9 @@ export default class SidebarNavClusterComponent extends Component {
5758
// otherwise we show the link depending on whether or not the feature exists
5859
return this.version.hasSecretsSync;
5960
}
61+
62+
// TODO remove conditional once further feature work for single item recovery for release 1.21 is completed
63+
get isNotProduction() {
64+
return config.environment !== 'production';
65+
}
6066
}

ui/app/router.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ Router.map(function () {
1717
this.route('dashboard');
1818
this.mount('config-ui');
1919
this.mount('sync');
20+
// TODO remove conditional once further feature work for single item recovery for release 1.21 is completed
21+
if (config.environment !== 'production') {
22+
this.route('recovery', function () {
23+
this.route('snapshots', function () {
24+
this.route('load');
25+
this.route('snapshot', { path: '/:snapshot_id' });
26+
});
27+
});
28+
}
2029
this.route('oidc-provider-ns', { path: '/*namespace/identity/oidc/provider/:provider_name/authorize' });
2130
this.route('oidc-provider', { path: '/identity/oidc/provider/:provider_name/authorize' });
2231
this.route('oidc-callback', { path: '/auth/*auth_path/oidc/callback' });
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright (c) HashiCorp, Inc.
3+
* SPDX-License-Identifier: BUSL-1.1
4+
*/
5+
6+
import Route from '@ember/routing/route';
7+
8+
export default class RecoveryRoute extends Route {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright (c) HashiCorp, Inc.
3+
* SPDX-License-Identifier: BUSL-1.1
4+
*/
5+
6+
import Route from '@ember/routing/route';
7+
8+
export default class RecoverySnapshotsRoute extends Route {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright (c) HashiCorp, Inc.
3+
* SPDX-License-Identifier: BUSL-1.1
4+
*/
5+
6+
import Route from '@ember/routing/route';
7+
8+
export default class RecoverySnapshotsIndexRoute extends Route {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Copyright (c) HashiCorp, Inc.
3+
* SPDX-License-Identifier: BUSL-1.1
4+
*/
5+
6+
import Route from '@ember/routing/route';
7+
8+
export default class RecoverySnapshotsLoadRoute extends Route {}

0 commit comments

Comments
 (0)