Skip to content

Commit

Permalink
[Uptime] Certificates page (elastic#64059)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed May 4, 2020
1 parent c0d021a commit f03acae
Show file tree
Hide file tree
Showing 73 changed files with 4,488 additions and 1,006 deletions.
9 changes: 9 additions & 0 deletions x-pack/plugins/uptime/common/constants/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const OVERVIEW_ROUTE = '/';

export const SETTINGS_ROUTE = '/settings';

export const CERTIFICATES_ROUTE = '/certificates';

export enum STATUS {
UP = 'up',
DOWN = 'down',
Expand Down Expand Up @@ -41,3 +43,10 @@ export const SHORT_TIMESPAN_LOCALE = {
yy: '%d Yr',
},
};

export enum CERT_STATUS {
OK = 'OK',
EXPIRING_SOON = 'EXPIRING_SOON',
EXPIRED = 'EXPIRED',
TOO_OLD = 'TOO_OLD',
}
30 changes: 20 additions & 10 deletions x-pack/plugins/uptime/common/runtime_types/certs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,45 @@ import * as t from 'io-ts';

export const GetCertsParamsType = t.intersection([
t.type({
from: t.string,
to: t.string,
index: t.number,
size: t.number,
sortBy: t.string,
direction: t.string,
}),
t.partial({
search: t.string,
from: t.string,
to: t.string,
}),
]);

export type GetCertsParams = t.TypeOf<typeof GetCertsParamsType>;

export const CertMonitorType = t.partial({
name: t.string,
id: t.string,
url: t.string,
});

export const CertType = t.intersection([
t.type({
monitors: t.array(
t.partial({
name: t.string,
id: t.string,
})
),
monitors: t.array(CertMonitorType),
sha256: t.string,
}),
t.partial({
certificate_not_valid_after: t.string,
certificate_not_valid_before: t.string,
not_after: t.string,
not_before: t.string,
common_name: t.string,
issuer: t.string,
sha1: t.string,
}),
]);

export const CertResultType = t.type({
certs: t.array(CertType),
total: t.number,
});

export type Cert = t.TypeOf<typeof CertType>;
export type CertMonitor = t.TypeOf<typeof CertMonitorType>;
export type CertResult = t.TypeOf<typeof CertResultType>;
4 changes: 2 additions & 2 deletions x-pack/plugins/uptime/common/runtime_types/ping/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const HttpResponseBodyType = t.partial({
export type HttpResponseBody = t.TypeOf<typeof HttpResponseBodyType>;

export const TlsType = t.partial({
certificate_not_valid_after: t.string,
certificate_not_valid_before: t.string,
not_after: t.string,
not_before: t.string,
});

export type Tls = t.TypeOf<typeof TlsType>;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f03acae

Please sign in to comment.