Skip to content
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

Setup Routing for PKI tabs #17054

Merged
merged 20 commits into from
Sep 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ui/lib/core/addon/helpers/options-for-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ const ENGINE_SECRET_BACKENDS = {
label: 'Overview',
link: 'overview',
},
{
zofskeez marked this conversation as resolved.
Show resolved Hide resolved
label: 'Roles',
link: 'roles',
},
{
label: 'Issuers',
link: 'issuers',
},
{
label: 'Certificates',
link: 'certificates',
},
{
label: 'Keys',
link: 'keys',
},
{
label: 'Configuration',
link: 'configuration',
},
],
},
};
Expand Down
40 changes: 40 additions & 0 deletions ui/lib/pki/addon/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,44 @@ import buildRoutes from 'ember-engines/routes';

export default buildRoutes(function () {
this.route('overview');
this.route('configuration', function () {
this.route('index', { path: '/' });
zofskeez marked this conversation as resolved.
Show resolved Hide resolved
this.route('tidy');
this.route('create', function () {
this.route('index', { path: '/' });
this.route('import-ca');
this.route('generate-root');
this.route('generate-csr');
});
this.route('edit');
this.route('details');
});
this.route('roles', function () {
this.route('create');
this.route('role', { path: '/:name' }, function () {
this.route('details');
this.route('edit');
});
});
this.route('issuers', function () {
this.route('create');
this.route('issuer', { path: '/:name' }, function () {
this.route('details');
this.route('edit');
});
});
this.route('certificates', function () {
this.route('create');
this.route('certificate', { path: '/:name' }, function () {
this.route('details');
this.route('edit');
});
});
this.route('keys', function () {
this.route('create');
this.route('key', { path: '/:name' }, function () {
this.route('details');
this.route('edit');
});
});
});
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/certificates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class PkiCertificatesRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/configuration/create/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class ConfigurationCreateIndexRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/configuration/details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class ConfigurationDetailsRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/configuration/edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class ConfigurationEditRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/configuration/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class ConfigurationIndexRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/configuration/tidy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class ConfigurationTidyRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/issuers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class PkiIssuersRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/keys.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class PkiKeysRoute extends Route {}
2 changes: 1 addition & 1 deletion ui/lib/pki/addon/routes/overview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Route from '@ember/routing/route';

export default class OverviewRoute extends Route {}
export default class PkiOverviewRoute extends Route {}
3 changes: 3 additions & 0 deletions ui/lib/pki/addon/routes/roles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Route from '@ember/routing/route';

export default class PkiRolesRoute extends Route {}
10 changes: 10 additions & 0 deletions ui/lib/pki/addon/templates/certificates.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<SecretListHeader
@model={{this.model}}
@backendCrumb={{hash
label=this.model.id
text=this.model.id
path="vault.cluster.secrets.backend.list-root"
model=this.model.id
}}
@isEngine={{true}}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.create.index
1 change: 1 addition & 0 deletions ui/lib/pki/addon/templates/configuration/details.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.details
1 change: 1 addition & 0 deletions ui/lib/pki/addon/templates/configuration/edit.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.edit
39 changes: 39 additions & 0 deletions ui/lib/pki/addon/templates/configuration/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<SecretListHeader
@model={{this.model}}
@backendCrumb={{hash
label=this.model.id
text=this.model.id
path="vault.cluster.secrets.backend.list-root"
model=this.model.id
}}
@isEngine={{true}}
/>
<Toolbar>
<ToolbarActions>
<ToolbarLink @params={{array "configuration.tidy"}}>
Tidy
</ToolbarLink>
<ToolbarLink @params={{array "configuration.edit"}}>
Edit configuration
</ToolbarLink>
</ToolbarActions>
</Toolbar>

<div class="form-section">
<label class="title has-padding-top is-5">
URLs
</label>
</div>
<div class="form-section">
<label class="title has-padding-top is-5">
CRL
</label>
</div>
<div class="form-section">
<label class="title has-padding-top is-5">
Mount Configuration
</label>
<div class="box is-fullwidth is-sideless is-paddingless is-marginless">
{{! ARG TODO component and empty state }}
</div>
</div>
Comment on lines +1 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is still WIP but wanted to confirm that this will become a component because I think it's used in other routes as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The empty state section will, yep, and then I'll use the infoTableRows components for the three chunks of data dispaled.

1 change: 1 addition & 0 deletions ui/lib/pki/addon/templates/configuration/tidy.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configuration.tidy
10 changes: 10 additions & 0 deletions ui/lib/pki/addon/templates/issuers.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<SecretListHeader
@model={{this.model}}
@backendCrumb={{hash
label=this.model.id
text=this.model.id
path="vault.cluster.secrets.backend.list-root"
model=this.model.id
}}
@isEngine={{true}}
/>
10 changes: 10 additions & 0 deletions ui/lib/pki/addon/templates/keys.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<SecretListHeader
@model={{this.model}}
@backendCrumb={{hash
label=this.model.id
text=this.model.id
path="vault.cluster.secrets.backend.list-root"
model=this.model.id
}}
@isEngine={{true}}
/>
16 changes: 15 additions & 1 deletion ui/lib/pki/addon/templates/overview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,18 @@
model=this.model.id
}}
@isEngine={{true}}
/>
/>
<Toolbar>
<ToolbarActions>
<ToolbarLink @params={{array "configuration.create.index"}}>
Configure PKI
</ToolbarLink>
</ToolbarActions>
</Toolbar>

{{! ARG TODO: add conditional for empty state }}
<EmptyState @title="PKI not configured" @message="This PKI mount hasn’t yet been configured with a certificate issuer.">
<LinkTo @route="configuration.create.index" @model={{this.model}}>
Configure PKI
</LinkTo>
</EmptyState>
10 changes: 10 additions & 0 deletions ui/lib/pki/addon/templates/roles.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<SecretListHeader
@model={{this.model}}
@backendCrumb={{hash
label=this.model.id
text=this.model.id
path="vault.cluster.secrets.backend.list-root"
model=this.model.id
}}
@isEngine={{true}}
/>
1 change: 0 additions & 1 deletion ui/lib/pki/app/routes/overview.js

This file was deleted.

1 change: 0 additions & 1 deletion ui/lib/pki/app/templates/overview.js

This file was deleted.