-
Notifications
You must be signed in to change notification settings - Fork 4.6k
add basic routes for secrets recovery #31412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a193a70
06cd58f
40e44eb
304fa74
c3afabb
771a6cc
3284ff6
080d7bf
6c26cb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {{! | ||
| Copyright (c) HashiCorp, Inc. | ||
| SPDX-License-Identifier: BUSL-1.1 | ||
| }} | ||
|
|
||
| {{! TODO: This is an empty skeleton component which will be completed as part of 1.21 feature work on single item recovery }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {{! | ||
| Copyright (c) HashiCorp, Inc. | ||
| SPDX-License-Identifier: BUSL-1.1 | ||
| }} | ||
|
|
||
| {{! TODO: This is an empty skeleton component which will be completed as part of 1.21 feature work on single item recovery }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {{! | ||
| Copyright (c) HashiCorp, Inc. | ||
| SPDX-License-Identifier: BUSL-1.1 | ||
| }} | ||
|
|
||
| {{! TODO: This is an empty skeleton component which will be completed as part of 1.21 feature work on single item recovery }} |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,15 @@ Router.map(function () { | |||||||
| this.route('dashboard'); | ||||||||
| this.mount('config-ui'); | ||||||||
| this.mount('sync'); | ||||||||
| // TODO remove conditional once further feature work for single item recovery for release 1.21 is completed | ||||||||
| if (config.environment !== 'production') { | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The router is a special place in ember land. You might want to double check that nothing weird happens once you build this for prod.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is how we've been rendering the docfy docs, so far nothing weird has been reported 🙃 |
||||||||
| this.route('recovery', function () { | ||||||||
| this.route('snapshots', function () { | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Optional] - It's 100% superflous, but I think it's nice to explicitly call out the index route in the router. I know it'd be diverent pattern in this file, but it's nice to see that there's something there at the default
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lol yeah I definitely advised against this since ember docs callout it's not necessary so feels overly verbose. Plus if we explicitly defined an index route for every index that would make our router file huge and it's already a challenge to parse |
||||||||
| this.route('load'); | ||||||||
| this.route('snapshot', { path: '/:snapshot_id' }); | ||||||||
| }); | ||||||||
| }); | ||||||||
| } | ||||||||
| this.route('oidc-provider-ns', { path: '/*namespace/identity/oidc/provider/:provider_name/authorize' }); | ||||||||
| this.route('oidc-provider', { path: '/identity/oidc/provider/:provider_name/authorize' }); | ||||||||
| this.route('oidc-callback', { path: '/auth/*auth_path/oidc/callback' }); | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: BUSL-1.1 | ||
| */ | ||
|
|
||
| import Route from '@ember/routing/route'; | ||
|
|
||
| export default class RecoveryRoute extends Route {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: BUSL-1.1 | ||
| */ | ||
|
|
||
| import Route from '@ember/routing/route'; | ||
|
|
||
| export default class RecoverySnapshotsRoute extends Route {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: BUSL-1.1 | ||
| */ | ||
|
|
||
| import Route from '@ember/routing/route'; | ||
|
|
||
| export default class RecoverySnapshotsIndexRoute extends Route {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: BUSL-1.1 | ||
| */ | ||
|
|
||
| import Route from '@ember/routing/route'; | ||
|
|
||
| export default class RecoverySnapshotsLoadRoute extends Route {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: BUSL-1.1 | ||
| */ | ||
|
|
||
| import Route from '@ember/routing/route'; | ||
|
|
||
| export default class RecoverySnapshotsSnapshotRoute extends Route { | ||
| model(params) { | ||
| return params.snapshot_id; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {{! | ||
| Copyright (c) HashiCorp, Inc. | ||
| SPDX-License-Identifier: BUSL-1.1 | ||
| }} | ||
|
|
||
| <Recovery::Page::Snapshots /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {{! | ||
| Copyright (c) HashiCorp, Inc. | ||
| SPDX-License-Identifier: BUSL-1.1 | ||
| }} | ||
|
|
||
| <Recovery::Page::Snapshots::Load /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| {{! | ||
| Copyright (c) HashiCorp, Inc. | ||
| SPDX-License-Identifier: BUSL-1.1 | ||
| }} | ||
| <Recovery::Page::Snapshots::Snapshot /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,12 +49,12 @@ module('Integration | Component | sidebar-nav-cluster', function (hooks) { | |
| }); | ||
| }); | ||
|
|
||
| test('it should hide links and headings user does not have access too', async function (assert) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏 |
||
| test('it should hide links and headings user does not have access to', async function (assert) { | ||
| await renderComponent(); | ||
|
|
||
| assert | ||
| .dom('[data-test-sidebar-nav-link]') | ||
| .exists({ count: 2 }, 'Nav links are hidden other than secrets and dashboard'); | ||
| .exists({ count: 3 }, 'Nav links are hidden other than secrets, recovery and dashboard'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add a todo since this will change, we'll want to gate these in the has-permission helper? Or we could update the helper api path map with the relevant routes and wrap the sidenav link now - up to you :) |
||
| assert | ||
| .dom('[data-test-sidebar-nav-heading]') | ||
| .exists({ count: 1 }, 'Headings are hidden other than Vault'); | ||
|
|
@@ -65,6 +65,7 @@ module('Integration | Component | sidebar-nav-cluster', function (hooks) { | |
| 'Dashboard', | ||
| 'Secrets Engines', | ||
| 'Secrets Sync', | ||
| 'Secrets Recovery', | ||
| 'Access', | ||
| 'Policies', | ||
| 'Tools', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool, so this acts as a sort of development feature flag. Good idea!
(This can be in a separate PR) but this could be formalized a bit and drawn into a helper so you don't need the getter every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is definitely a new pattern to use the environment state like this. But with the new release cycle, I foresee us developing more iteratively instead of relying on sidebranches so it would make sense to make an app-wide helper!