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

[Uptime] Update TLS settings #64111

Merged
merged 12 commits into from
Apr 24, 2020
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/uptime/common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { CHART_FORMAT_LIMITS } from './chart_format_limits';
export { CLIENT_DEFAULTS } from './client_defaults';
export { CONTEXT_DEFAULTS } from './context_defaults';
export * from './capabilities';
export * from './settings_defaults';
export { PLUGIN } from './plugin';
export { QUERY, STATES } from './query';
export * from './ui';
Expand Down
15 changes: 15 additions & 0 deletions x-pack/legacy/plugins/uptime/common/constants/settings_defaults.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { DynamicSettings } from '../runtime_types';

export const DYNAMIC_SETTINGS_DEFAULTS: DynamicSettings = {
heartbeatIndices: 'heartbeat-8*',
certThresholds: {
expiration: 30,
age: 365,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@

import * as t from 'io-ts';

export const CertificatesStatesThresholdType = t.interface({
warningState: t.number,
errorState: t.number,
export const CertStateThresholdsType = t.type({
age: t.number,
expiration: t.number,
});

export const DynamicSettingsType = t.intersection([
t.type({
heartbeatIndices: t.string,
}),
t.partial({
certificatesThresholds: CertificatesStatesThresholdType,
}),
]);
export const DynamicSettingsType = t.type({
heartbeatIndices: t.string,
certThresholds: CertStateThresholdsType,
});

export const DynamicSettingsSaveType = t.intersection([
t.type({
Expand All @@ -31,12 +27,4 @@ export const DynamicSettingsSaveType = t.intersection([

export type DynamicSettings = t.TypeOf<typeof DynamicSettingsType>;
export type DynamicSettingsSaveResponse = t.TypeOf<typeof DynamicSettingsSaveType>;
export type CertificatesStatesThreshold = t.TypeOf<typeof CertificatesStatesThresholdType>;

export const defaultDynamicSettings: DynamicSettings = {
heartbeatIndices: 'heartbeat-8*',
certificatesThresholds: {
errorState: 7,
warningState: 30,
},
};
export type CertStateThresholds = t.TypeOf<typeof CertStateThresholdsType>;

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.

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ describe('CertificateForm', () => {
expect(
shallowWithRouter(
<CertificateExpirationForm
loading={false}
onChange={jest.fn()}
formFields={{
heartbeatIndices: 'heartbeat-8*',
certificatesThresholds: { errorState: 7, warningState: 36 },
certThresholds: { expiration: 7, age: 36 },
}}
fieldErrors={{}}
fieldErrors={null}
isDisabled={false}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ describe('CertificateForm', () => {
expect(
shallowWithRouter(
<IndicesForm
loading={false}
onChange={jest.fn()}
formFields={{
heartbeatIndices: 'heartbeat-8*',
certificatesThresholds: { errorState: 7, warningState: 36 },
certThresholds: { expiration: 7, age: 36 },
}}
fieldErrors={{}}
fieldErrors={null}
isDisabled={false}
/>
)
Expand Down
Loading