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

UI: Adds tidy_revoked_certs and revoked_cert_deleted_count to PKI tidy status page #23232

Merged
merged 2 commits into from
Sep 21, 2023
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
3 changes: 3 additions & 0 deletions changelog/23232.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: Adds tidy_revoked_certs to PKI tidy status page
```
8 changes: 7 additions & 1 deletion ui/lib/pki/addon/components/page/pki-tidy-status.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
/>
{{/each}}

{{#if this.isEnterprise}}
{{#each this.crossClusterOperation.status as |attr|}}
<InfoTableRow @label={{humanize (dasherize attr)}} @value={{get @tidyStatus attr}} @alwaysRender={{true}} />
{{/each}}
{{/if}}

<h2 class="title is-4 has-bottom-margin-xs has-top-margin-l has-border-bottom-light has-bottom-padding-s">
{{if (eq this.tidyState "Running") "Current" "Last"}}
tidy settings
Expand All @@ -81,7 +87,7 @@
{{/each}}

{{#if this.isEnterprise}}
{{#each this.crossClusterOperation as |attr|}}
{{#each this.crossClusterOperation.config as |attr|}}
<InfoTableRow
@label={{humanize (dasherize attr)}}
@value={{get @tidyStatus attr}}
Expand Down
35 changes: 20 additions & 15 deletions ui/lib/pki/addon/components/page/pki-tidy-status.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Organized params a bit so it's easier to follow what goes where

Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,28 @@ interface Args {
}

interface TidyStatusParams {
safety_buffer: number;
tidy_cert_store: boolean;
tidy_revoked_certs: boolean;
// tidy banner
state: string;
error: string;
message: string;
// tidy status
time_started: string | null;
time_finished: string | null;
message: string;
cert_store_deleted_count: number;
revoked_cert_deleted_count: number;
missing_issuer_cert_count: number;
revocation_queue_deleted_count: number; // enterprise only
cross_revoked_cert_deleted_count: number; // enterprise only
// tidy settings
tidy_cert_store: boolean;
tidy_revoked_certs: boolean;
tidy_expired_issuers: boolean;
issuer_safety_buffer: string;
safety_buffer: number;
tidy_move_legacy_ca_bundle: boolean;
tidy_revocation_queue: boolean;
revocation_queue_deleted_count: number;
tidy_cross_cluster_revoked_certs: boolean;
cross_revoked_cert_deleted_count: number;
revocation_queue_safety_buffer: string;
issuer_safety_buffer: string;
tidy_revocation_queue: boolean; // enterprise only
tidy_cross_cluster_revoked_certs: boolean; // enterprise only
revocation_queue_safety_buffer: string; // enterprise only
}

export default class PkiTidyStatusComponent extends Component<Args> {
Expand All @@ -57,24 +60,26 @@ export default class PkiTidyStatusComponent extends Component<Args> {
tidyStatusGeneralFields = [
'time_started',
'time_finished',
'last_auto_tidy_finished',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This param doesn't behave as expected. It behaves similarly to time_finished, and isn't specific to auto-tidying

'cert_store_deleted_count',
'revoked_cert_deleted_count',
'missing_issuer_cert_count',
'revocation_queue_deleted_count',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enterprise only moved below to crossClusterOperation array

];

tidyStatusConfigFields = [
'tidy_cert_store',
'tidy_revocation_queue',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

duplicate (enterprise only, below) - this should have originally been tidy_revoked_certs

'tidy_cross_cluster_revoked_certs',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enterprise only (moved below)

'tidy_revoked_certs',
'safety_buffer',
'pause_duration',
'tidy_expired_issuers',
'tidy_move_legacy_ca_bundle',
'issuer_safety_buffer',
];

crossClusterOperation = ['tidy_revocation_queue', 'revocation_queue_safety_buffer'];
// enterprise only
crossClusterOperation = {
status: ['revocation_queue_deleted_count', 'cross_revoked_cert_deleted_count'],
config: ['tidy_revocation_queue', 'tidy_cross_cluster_revoked_certs', 'revocation_queue_safety_buffer'],
};

get isEnterprise() {
return this.version.isEnterprise;
Expand Down