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

[Ingest] cleanup names and files/paths to confirm to a standard format #41773

Merged
merged 53 commits into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
77f50ef
[Maps] Rename modules for clarity (#41608)
thomasneirynck Jul 22, 2019
82dfb8d
[Docs] Add simple phrase highlighting to Logs UI (#41610)
Zacqary Jul 22, 2019
f5350f0
[DOCS] Timelion cleanup (#41381)
KOTungseth Jul 22, 2019
a90ba21
[Canvas] Removes doc links from backticks. (#41601)
cqliu1 Jul 22, 2019
dd63e73
Upgrade EUI to 12.4.0 (#41577)
thompsongl Jul 22, 2019
a177b86
Move CSP config default values to csp module (#41676)
epixa Jul 22, 2019
6419c23
Remove notifications plugin (#41674)
epixa Jul 22, 2019
47d9756
[Logs UI] Make column configurations reorderable (#41035)
Zacqary Jul 22, 2019
b2f8eac
[Maps] populate _id in tooltip (#41684)
nreese Jul 22, 2019
f41290b
[ML] Data Frames - search bar on list page (#41415)
alvarezmelissa87 Jul 22, 2019
94a9b91
[DOCS] Changed Visual Builder to TSVB (#39539)
KOTungseth Jul 22, 2019
099f434
[DOCS] Adds missing Timelion link (#41709)
KOTungseth Jul 22, 2019
75694c4
[Infra UI] Fix section mapping bug in node detail page (#41641)
simianhacker Jul 22, 2019
bbd8980
[Infra UI] Add UI to customize Metrics Explorer chart style (#41022)
simianhacker Jul 22, 2019
b8f0196
Bump backport to 4.6.1 (#41720)
sorenlouv Jul 22, 2019
4b8913c
hide top nav menu in full screen mode of maps and dashboard (#41672)
Jul 23, 2019
4fa253a
improve typing (#41563)
flash1293 Jul 23, 2019
a4cd545
[Code] test colorize before load a file (#41645)
Jul 23, 2019
2e1b4ef
[Code] handle status when repo is not exists (#41643)
Jul 23, 2019
4566254
[Code] implement filtree api by using isogit (#41558)
Jul 23, 2019
d80dc5a
remove obsolete http secutiry settings (#41569)
mshustov Jul 23, 2019
3467c45
core doesn't use Record<string, unknown> for public API (#41448)
mshustov Jul 23, 2019
4e73b18
Narrow type of PluginDeps to an object (#40846)
mshustov Jul 23, 2019
6999312
[APM] Fix "Show trace logs" link (#41570)
dgieselaar Jul 23, 2019
6ce30ff
Comment out flakey test steps (#41743)
weltenwort Jul 23, 2019
2eb25c2
[ML] Fixes model memory limit for metricbeat system module jobs (#41747)
peteharverson Jul 23, 2019
131e4c2
[i18n] fix i18nrc parsing (#41741)
Bamieh Jul 23, 2019
6848a98
Add ownership of new platform security plugin to security team. (#41748)
azasypkin Jul 23, 2019
623b70d
Clean up top nav \ search bar \ query bar directives (#41636)
Jul 23, 2019
f766eca
[ML] Use NavigationMenu without angularjs wrapper. (#41343)
walterra Jul 23, 2019
9d7cf53
[telemetry] Analytics Package (#41113)
Bamieh Jul 23, 2019
f80ff8f
replace all occurences of placeholder in drilldown url template (#41673)
flash1293 Jul 23, 2019
d445fba
cleanup names and files/paths to confirm to a standard format
mattapperson Jul 23, 2019
4c4a09b
tack down WIP code
mattapperson Jul 23, 2019
8b6320f
remove things not or not yet needed
mattapperson Jul 23, 2019
ac141ea
Added Flexmonster Pivot Table to known plugins list (#41655)
Jul 23, 2019
c43f90f
Fix typo (#41705)
thomasneirynck Jul 23, 2019
a6fd0c3
turn on filtering tests (#41202)
stacey-gammon Jul 23, 2019
e1bc154
GoodBye Notifier (#41663)
Jul 23, 2019
9f516d6
Revert "lock es snapshot to avoid failing CI" (#41539)
Jul 23, 2019
a8d5111
fix more types, define SO
mattapperson Jul 23, 2019
1721b41
[SIEM] - Fix Jest test errors and warnings (#41712)
stephmilovic Jul 23, 2019
526494a
Fixes #41787 (#41791)
jasonrhodes Jul 23, 2019
1ba93c0
[DOCS] Puts Spaces content on single page (#41536)
gchaps Jul 23, 2019
2a86036
[SIEM] - Hosts and Network Tables from LoadMore to Paginated (#41532)
stephmilovic Jul 23, 2019
751f2ee
[DOCS] Updates Console doc (#41371)
gchaps Jul 23, 2019
db5fc8f
Fixed unused variables. Added a few methods to the SO adapter
mattapperson Jul 23, 2019
997490f
Merge branch 'master' of github.com:elastic/kibana into feature-fleet
mattapperson Jul 23, 2019
4ae69eb
fix type
mattapperson Jul 24, 2019
a7efaf2
Revert "Merge branch 'master' of github.com:elastic/kibana into featu…
mattapperson Jul 24, 2019
98276b1
removed blank test file
mattapperson Jul 24, 2019
f55e5ba
Fix file path
mattapperson Jul 24, 2019
e2ef0d1
add i18n
mattapperson Jul 24, 2019
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
2 changes: 2 additions & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
"xpack.crossClusterReplication": "legacy/plugins/cross_cluster_replication",
"xpack.dashboardMode": "legacy/plugins/dashboard_mode",
"xpack.fileUpload": "legacy/plugins/file_upload",
"xpack.fleet": "legacy/plugins/fleet",
"xpack.graph": "legacy/plugins/graph",
"xpack.grokDebugger": "legacy/plugins/grokdebugger",
"xpack.idxMgmt": "legacy/plugins/index_management",
"xpack.indexLifecycleMgmt": "legacy/plugins/index_lifecycle_management",
"xpack.infra": "legacy/plugins/infra",
"xpack.ingest": "legacy/plugins/ingest",
"xpack.kueryAutocomplete": "legacy/plugins/kuery_autocomplete",
"xpack.licenseMgmt": "legacy/plugins/license_management",
"xpack.maps": "legacy/plugins/maps",
Expand Down
2 changes: 2 additions & 0 deletions x-pack/legacy/plugins/fleet/common/types/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
*/

export type FlatObject<T> = { [Key in keyof T]: string };
export type RendererResult = React.ReactElement<any> | null;
export type RendererFunction<RenderArgs, Result = RendererResult> = (args: RenderArgs) => Result;
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/fleet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import * as Joi from 'joi';
import { resolve } from 'path';
import { i18n } from '@kbn/i18n/src';
import { i18n } from '@kbn/i18n';
import { PLUGIN } from './common/constants';
import { CONFIG_PREFIX } from './common/constants/plugin';
import { initServerWithKibana } from './server/kibana.index';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import { AutocompleteSuggestion } from 'ui/autocomplete_providers';

import { FrontendLibs } from '../lib/types';
import { RendererFunction } from '../utils/typed_react';
import { RendererFunction } from '../../common/types/helpers';

interface WithKueryAutocompletionLifecycleProps {
libs: FrontendLibs;
Expand Down
3 changes: 1 addition & 2 deletions x-pack/legacy/plugins/fleet/public/hooks/with_url_state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import { parse, stringify } from 'querystring';
import React from 'react';
import { withRouter } from 'react-router-dom';
import { FlatObject } from '../frontend_types';
import { RendererFunction } from '../utils/typed_react';
import { FlatObject, RendererFunction } from '../../common/types/helpers';

type StateCallback<T> = (previousState: T) => T;

Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/fleet/public/lib/elasticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class ElasticsearchLib {
});
}

return hiddenFieldsCheck.reduce((isvalid, field) => {
return hiddenFieldsCheck.reduce((isvalid: boolean, field) => {
if (!isvalid) {
return false;
}
Expand Down
16 changes: 1 addition & 15 deletions x-pack/legacy/plugins/fleet/public/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { get } from 'lodash';
import React, { Component } from 'react';
import { Redirect, Route, Switch } from 'react-router-dom';
import { REQUIRED_ROLES } from '../common/constants/security';
import { Loading } from './components/loading';
import { ChildRoutes } from './components/navigation/child_routes';
import { URLStateProps, WithURLState } from './hooks/with_url_state';
Expand Down Expand Up @@ -59,19 +58,6 @@ export class AppRoutes extends Component<RouterProps, RouterState> {
/>
)}

{/* Make sure the user has correct permissions */}
{!this.props.libs.framework.currentUserHasOneOfRoles(
REQUIRED_ROLES.concat(this.props.libs.framework.info.settings.defaultUserRoles)
) && (
<Route
render={props =>
!props.location.pathname.includes('/error') ? (
<Redirect to="/error/no_access" />
) : null
}
/>
)}

{/* This app does not make use of a homepage. The mainpage is overview/enrolled_agents */}
<Route path="/" exact={true} render={() => <Redirect to="/overview/enrolled_agents" />} />
</Switch>
Expand All @@ -80,7 +66,7 @@ export class AppRoutes extends Component<RouterProps, RouterState> {
<WithURLState>
{(URLProps: URLStateProps) => (
<ChildRoutes
routes={routeMap}
routes={[]}
{...URLProps}
{...{
libs: this.props.libs,
Expand Down
11 changes: 4 additions & 7 deletions x-pack/legacy/plugins/ingest/server/kibana.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { compose } from './libs/compose/kibana';

export const initServerWithKibana = (hapiServer: any) => {
hapiServer.route({
method: 'GET',
path: '/api/fleet/load',
handler: (request: any, h: any) => {
return 'Hello World!';
},
});
const libs = compose(hapiServer);
libs.framework.log('Ingest is composed -- debug message');
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import * as t from 'io-ts';
import { DateFromString } from '../../../../common/types/io_ts';

export const RuntimeDatasourceInput = t.interface(
{
Expand Down Expand Up @@ -48,13 +47,14 @@ export const NewRuntimeBackupConfigurationFile = t.interface(
'BackupConfigurationFile'
);

const ExistingDocument = t.partial({
const ExistingDocument = t.interface({
id: t.string,
shared_id: t.string,
version: t.number,
updated_at: DateFromString,
active: t.boolean,
updated_at: t.string,
created_by: t.union([t.undefined, t.string]),
updated_on: DateFromString,
updated_on: t.string,
updated_by: t.union([t.undefined, t.string]),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,98 @@
* you may not use this file except in compliance with the Elastic License.
*/

import {
ConfigurationFile,
NewConfigurationFile,
DatasourceInput,
BackupConfigurationFile,
} from './adapter_types';

export class DefaultConfigAdapter {
import { SODatabaseAdapter } from '../so_database/default';
import { RuntimeConfigurationFile, NewConfigurationFile } from './adapter_types';

import { ConfigurationFile, DatasourceInput, BackupConfigurationFile } from './adapter_types';

export class ConfigAdapter {
constructor(private readonly so: SODatabaseAdapter) {}

public async create(
configuration: NewConfigurationFile
): Promise<{ id: string; shared_id: string; version: number }> {
const newSo = await this.so.create<ConfigurationFile>(
'configurations',
(configuration as any) as ConfigurationFile
);

return {
id: 'fsdfsdf',
shared_id: 'wjkhefkjhfkjs',
version: 0,
id: newSo.id,
shared_id: newSo.attributes.shared_id,
version: newSo.attributes.version,
};
}

public async get(sharedID: string, version?: number): Promise<ConfigurationFile> {
return {} as ConfigurationFile;
public async get(id: string): Promise<ConfigurationFile> {
const config = await this.so.get<any>('configurations', id);

if (config.error) {
throw new Error(config.error.message);
}

if (!config.attributes) {
throw new Error(`No configuration found with ID of ${id}`);
}
if (RuntimeConfigurationFile.decode(config.attributes).isRight()) {
return config.attributes as ConfigurationFile;
} else {
throw new Error(`Invalid ConfigurationFile data. == ${config.attributes}`);
}
}

public async list(): Promise<ConfigurationFile[]> {
const configs = await this.so.find<any>({
type: 'configurations',
search: '*',
searchFields: ['shared_id'],
});
const uniqConfigurationFile = configs.saved_objects
.map<ConfigurationFile>(config => {
if (RuntimeConfigurationFile.decode(config.attributes).isRight()) {
return config.attributes;
} else {
throw new Error(`Invalid ConfigurationFile data. == ${config.attributes}`);
}
})
.reduce((acc, config: ConfigurationFile) => {
if (!acc.has(config.shared_id)) {
acc.set(config.shared_id, config);
}
const prevConfig = acc.get(config.shared_id);
if (prevConfig && prevConfig.version < config.version) {
acc.set(config.shared_id, config);
}

return acc;
}, new Map<string, ConfigurationFile>());

return [...uniqConfigurationFile.values()];
}

public async list(sharedID: string, version?: number): Promise<ConfigurationFile[]> {
return [{} as ConfigurationFile];
public async listVersions(sharedID: string, activeOnly = true): Promise<ConfigurationFile[]> {
const configs = (await this.so.find<any>({
type: 'configurations',
search: sharedID,
searchFields: ['shared_id'],
})).saved_objects;

if (!activeOnly) {
const backupConfigs = await this.so.find<any>({
type: 'backup_configurations',
search: sharedID,
searchFields: ['shared_id'],
});
configs.concat(backupConfigs.saved_objects);
}

return configs.map<ConfigurationFile>(config => {
if (RuntimeConfigurationFile.decode(config.attributes).isRight()) {
return config.attributes;
} else {
throw new Error(`Invalid ConfigurationFile data. == ${config.attributes}`);
}
});
}

public async update(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { FrameworkRequest, FrameworkUser } from '../framework/adapter_types';

export interface DatabaseAdapter {
get<Source>(
user: FrameworkUser,
params: DatabaseGetParams
): Promise<DatabaseGetDocumentResponse<Source>>;
create(
user: FrameworkUser,
params: DatabaseCreateDocumentParams
): Promise<DatabaseCreateDocumentResponse>;
index<T>(
user: FrameworkUser,
params: DatabaseIndexDocumentParams<T>
): Promise<DatabaseIndexDocumentResponse>;
delete(
user: FrameworkUser,
params: DatabaseDeleteDocumentParams
): Promise<DatabaseDeleteDocumentResponse>;
deleteByQuery(
user: FrameworkUser,
params: DatabaseSearchParams
): Promise<DatabaseDeleteDocumentResponse>;
mget<T>(user: FrameworkUser, params: DatabaseMGetParams): Promise<DatabaseMGetResponse<T>>;
bulk(
user: FrameworkUser,
params: DatabaseBulkIndexDocumentsParams
): Promise<DatabaseBulkResponse>;
search<T>(user: FrameworkUser, params: DatabaseSearchParams): Promise<DatabaseSearchResponse<T>>;
searchAll<T>(
user: FrameworkUser,
params: DatabaseSearchParams
): Promise<DatabaseSearchResponse<T>>;
putTemplate(name: string, template: any): Promise<any>;
}
import { FrameworkRequest } from '../framework/adapter_types';

export interface DatabaseKbnESCluster {
callWithInternalUser(esMethod: string, options: {}): Promise<any>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { FrameworkUser } from '../framework/adapter_types';
import { internalAuthData } from '../framework/adapter_types';
import {
DatabaseAdapter,
DatabaseBulkIndexDocumentsParams,
DatabaseCreateDocumentParams,
DatabaseCreateDocumentResponse,
Expand All @@ -23,7 +22,7 @@ import {
DatabaseSearchResponse,
} from './adapter_types';

export class KibanaDatabaseAdapter implements DatabaseAdapter {
export class ESDatabaseAdapter {
private es: DatabaseKbnESCluster;

constructor(kbnElasticSearch: DatabaseKbnESPlugin) {
Expand Down
Loading