Skip to content

Commit

Permalink
Merge branch 'master' into update-react-router-dom-to-v5
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Oct 1, 2019
2 parents 87f087e + a325611 commit db3fb4b
Show file tree
Hide file tree
Showing 486 changed files with 12,387 additions and 5,325 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.js
Expand Up @@ -510,6 +510,10 @@ module.exports = {
// typescript and javascript for front and back end
files: ['x-pack/legacy/plugins/siem/**/*.{js,ts,tsx}'],
plugins: ['eslint-plugin-node', 'react'],
env: {
mocha: true,
jest: true,
},
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'error',
Expand Down Expand Up @@ -564,8 +568,7 @@ module.exports = {
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
// This will be turned on after bug fixes are mostly complete
// 'no-undef': 'warn',
'no-undef': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-useless-call': 'error',
Expand Down
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -13,6 +13,8 @@

# APM
/x-pack/legacy/plugins/apm/ @elastic/apm-ui
/x-pack/test/functional/apps/apm/ @elastic/apm-ui
/src/legacy/core_plugins/apm_oss/ @elastic/apm-ui

# Beats
/x-pack/legacy/plugins/beats_management/ @elastic/beats
Expand Down
2 changes: 1 addition & 1 deletion docs/code/code-import-first-repo.asciidoc
Expand Up @@ -29,7 +29,7 @@ xpack.code.ui.enabled: true
https://github.com/Microsoft/TypeScript-Node-Starter
----

`https` is recommend for cloning git repositories.
`https` is recommend for cloning most git repositories. To clone a private repository, <<code-repo-management, use SSH>>.

. Click *Import*.
+
Expand Down
40 changes: 31 additions & 9 deletions docs/code/code-repo-management.asciidoc
Expand Up @@ -6,20 +6,40 @@ Code starts with an overview of your repositories. You can then use the UI to a
image::images/code-repo-management.png[]

[float]
[[add-delete-a-repo]]
==== Add and delete a repo
The <<code-import-first-repo, Import your first repository>> page provides step-by-step instructions for adding a GitHub repo to *Code*. You can fine tune the hostname of the git clone URL in your `kibana.yml` file.
The <<code-import-first-repo, Import your first repository>> page provides step-by-step instructions for adding a GitHub repo to *Code*. You can fine-tune the hostname of the git clone URL in your `kibana.yml` file.

For security reasons, Code allows only a few trusted hostnames, such as github.com, by default. You can add an SSH key to {kib} to clone private repos.
For security reasons, Code allows only a few <<clone-url-management,trusted hostnames>>, such as github.com. To clone private repositories see <<clone-private-repo,add an SSH key>>.

Deleting a repo removes it from local storage and the Elasticsearch index.
To delete a repository, go to the **Repositories** tab, find the name of the repo, and click *Delete*.

[float]
==== Reindex a repo
*Code* automatically reindexes an imported repo at set intervals, but in some cases you might need to manually refresh the index. For example, you might refresh an index after a new language server is installed. Or, you might want to immediately update the index to the HEAD revision. Click *Reindex* to initiate a reindex.
[[clone-private-repo]]
==== Clone private repo with an SSH key
Clones of private repos require an SSH key for authentication. The username associated with your host must have write access to the repository you want to clone.

The following section provides links for generating your ssh key through GitHub. If you already have an SSH key added through your host, skip to step 4.

1. https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key[Generate an ssh key].

2. https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent[Add the ssh key to your ssh-agent.]

3. https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account[Add the ssh key to your host].

4. Copy the ssh key into `data/code/credentials/` under the {kib} folder.

In some cases you might need to manually refresh the index besides automatic indexing. For example, you might refresh an index after a new language server is installed. Or, you might want to immediately update the index to the HEAD revision. Click *Reindex* to initiate a reindex.
You can now copy private Git repositories into Code.

To delete a repository, find the go to the **Repositories** tab, find the name of the repo and click *Delete*.

[float]
[[reindex-a-repo]]
==== Reindex a repo
*Code* automatically reindexes an imported repo at set intervals, but in some cases, you might need to refresh the index manually. For example, you might refresh an index after a new language server installs. Or, you might want to update the index to the HEAD revision immediately. Click *Reindex* to initiate a reindex.

[float]
[[clone-url-management]]
==== Clone URL management
For security reasons, *Code* only allows the following hostnames in the git clone URL by default:

Expand All @@ -46,9 +66,11 @@ xpack.code.security.gitProtocolWhitelist: [ "https" ]
----

[float]
==== Clone repo with SSH key
If your repo clone requires an SSH key for authentication, put the SSH key in `data/code/credentials/` under the {kib} folder.

[[repo-limitations]]
==== Limitations
Consider the following limitations before cloning repositories:

- Only Git is supported. Other version control systems, such as Mercurial and SVN, are not supported.
- Your disk might not have enough space to clone repositories due to {kib} watermark settings. To update your watermark settings, contact your system administrator and request additional disk space.

include::code-install-lang-server.asciidoc[]
13 changes: 13 additions & 0 deletions docs/development/core/server/kibana-plugin-server.basepath.get.md
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [get](./kibana-plugin-server.basepath.get.md)

## BasePath.get property

returns `basePath` value, specific for an incoming request.

<b>Signature:</b>

```typescript
get: (request: KibanaRequest<unknown, unknown, unknown> | LegacyRequest) => string;
```
28 changes: 28 additions & 0 deletions docs/development/core/server/kibana-plugin-server.basepath.md
@@ -0,0 +1,28 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md)

## BasePath class

Access or manipulate the Kibana base path

<b>Signature:</b>

```typescript
export declare class BasePath
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [get](./kibana-plugin-server.basepath.get.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown&gt; &#124; LegacyRequest) =&gt; string</code> | returns <code>basePath</code> value, specific for an incoming request. |
| [prepend](./kibana-plugin-server.basepath.prepend.md) | | <code>(path: string) =&gt; string</code> | returns a new <code>basePath</code> value, prefixed with passed <code>url</code>. |
| [remove](./kibana-plugin-server.basepath.remove.md) | | <code>(path: string) =&gt; string</code> | returns a new <code>basePath</code> value, cleaned up from passed <code>url</code>. |
| [serverBasePath](./kibana-plugin-server.basepath.serverbasepath.md) | | <code>string</code> | returns the server's basePath<!-- -->See [BasePath.get](./kibana-plugin-server.basepath.get.md) for getting the basePath value for a specific request |
| [set](./kibana-plugin-server.basepath.set.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown&gt; &#124; LegacyRequest, requestSpecificBasePath: string) =&gt; void</code> | sets <code>basePath</code> value, specific for an incoming request. |

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `BasePath` class.

@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [prepend](./kibana-plugin-server.basepath.prepend.md)

## BasePath.prepend property

returns a new `basePath` value, prefixed with passed `url`<!-- -->.

<b>Signature:</b>

```typescript
prepend: (path: string) => string;
```
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [remove](./kibana-plugin-server.basepath.remove.md)

## BasePath.remove property

returns a new `basePath` value, cleaned up from passed `url`<!-- -->.

<b>Signature:</b>

```typescript
remove: (path: string) => string;
```
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [serverBasePath](./kibana-plugin-server.basepath.serverbasepath.md)

## BasePath.serverBasePath property

returns the server's basePath

See [BasePath.get](./kibana-plugin-server.basepath.get.md) for getting the basePath value for a specific request

<b>Signature:</b>

```typescript
readonly serverBasePath: string;
```
13 changes: 13 additions & 0 deletions docs/development/core/server/kibana-plugin-server.basepath.set.md
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [set](./kibana-plugin-server.basepath.set.md)

## BasePath.set property

sets `basePath` value, specific for an incoming request.

<b>Signature:</b>

```typescript
set: (request: KibanaRequest<unknown, unknown, unknown> | LegacyRequest, requestSpecificBasePath: string) => void;
```
Expand Up @@ -4,13 +4,10 @@

## HttpServerSetup.basePath property

[BasePath](./kibana-plugin-server.basepath.md)

<b>Signature:</b>

```typescript
basePath: {
get: (request: KibanaRequest | LegacyRequest) => string;
set: (request: KibanaRequest | LegacyRequest, basePath: string) => void;
prepend: (url: string) => string;
remove: (url: string) => string;
};
basePath: IBasePath;
```
Expand Up @@ -17,7 +17,7 @@ export interface HttpServerSetup
| Property | Type | Description |
| --- | --- | --- |
| [auth](./kibana-plugin-server.httpserversetup.auth.md) | <code>{</code><br/><code> get: GetAuthState;</code><br/><code> isAuthenticated: IsAuthenticated;</code><br/><code> getAuthHeaders: GetAuthHeaders;</code><br/><code> }</code> | |
| [basePath](./kibana-plugin-server.httpserversetup.basepath.md) | <code>{</code><br/><code> get: (request: KibanaRequest &#124; LegacyRequest) =&gt; string;</code><br/><code> set: (request: KibanaRequest &#124; LegacyRequest, basePath: string) =&gt; void;</code><br/><code> prepend: (url: string) =&gt; string;</code><br/><code> remove: (url: string) =&gt; string;</code><br/><code> }</code> | |
| [basePath](./kibana-plugin-server.httpserversetup.basepath.md) | <code>IBasePath</code> | [BasePath](./kibana-plugin-server.basepath.md) |
| [createCookieSessionStorageFactory](./kibana-plugin-server.httpserversetup.createcookiesessionstoragefactory.md) | <code>&lt;T&gt;(cookieOptions: SessionStorageCookieOptions&lt;T&gt;) =&gt; Promise&lt;SessionStorageFactory&lt;T&gt;&gt;</code> | Creates cookie based session storage factory [SessionStorageFactory](./kibana-plugin-server.sessionstoragefactory.md) |
| [isTlsEnabled](./kibana-plugin-server.httpserversetup.istlsenabled.md) | <code>boolean</code> | Flag showing whether a server was configured to use TLS connection. |
| [registerAuth](./kibana-plugin-server.httpserversetup.registerauth.md) | <code>(handler: AuthenticationHandler) =&gt; void</code> | To define custom authentication and/or authorization mechanism for incoming requests. A handler should return a state to associate with the incoming request. The state can be retrieved later via http.auth.get(..) Only one AuthenticationHandler can be registered. |
Expand Down
15 changes: 15 additions & 0 deletions docs/development/core/server/kibana-plugin-server.ibasepath.md
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [IBasePath](./kibana-plugin-server.ibasepath.md)

## IBasePath type

Access or manipulate the Kibana base path

[BasePath](./kibana-plugin-server.basepath.md)

<b>Signature:</b>

```typescript
export declare type IBasePath = Pick<BasePath, keyof BasePath>;
```

This file was deleted.

6 changes: 2 additions & 4 deletions docs/development/core/server/kibana-plugin-server.md
Expand Up @@ -16,12 +16,11 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->

| Class | Description |
| --- | --- |
| [BasePath](./kibana-plugin-server.basepath.md) | Access or manipulate the Kibana base path |
| [ClusterClient](./kibana-plugin-server.clusterclient.md) | Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via <code>asScoped(...)</code>). |
| [ElasticsearchErrorHelpers](./kibana-plugin-server.elasticsearcherrorhelpers.md) | Helpers for working with errors returned from the Elasticsearch service.Since the internal data of errors are subject to change, consumers of the Elasticsearch service should always use these helpers to classify errors instead of checking error internals such as <code>body.error.header[WWW-Authenticate]</code> |
| [KibanaRequest](./kibana-plugin-server.kibanarequest.md) | Kibana specific abstraction for an incoming request. |
| [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) | |
| [SavedObjectsSchema](./kibana-plugin-server.savedobjectsschema.md) | |
| [SavedObjectsSerializer](./kibana-plugin-server.savedobjectsserializer.md) | |
| [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md) | Serves the same purpose as "normal" <code>ClusterClient</code> but exposes additional <code>callAsCurrentUser</code> method that doesn't use credentials of the Kibana internal user (as <code>callAsInternalUser</code> does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API |

## Enumerations
Expand Down Expand Up @@ -51,7 +50,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [HttpServiceStart](./kibana-plugin-server.httpservicestart.md) | |
| [IContextContainer](./kibana-plugin-server.icontextcontainer.md) | An object that handles registration of context providers and configuring handlers with context. |
| [IKibanaSocket](./kibana-plugin-server.ikibanasocket.md) | A tiny abstraction for TCP socket. |
| [InternalCoreStart](./kibana-plugin-server.internalcorestart.md) | |
| [IRouter](./kibana-plugin-server.irouter.md) | Registers route handlers for specified resource path and method. |
| [KibanaRequestRoute](./kibana-plugin-server.kibanarequestroute.md) | Request specific route information exposed to a handler. |
| [LegacyRequest](./kibana-plugin-server.legacyrequest.md) | |
Expand Down Expand Up @@ -95,7 +93,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SavedObjectsMigrationVersion](./kibana-plugin-server.savedobjectsmigrationversion.md) | Information about the migrations that have been applied to this SavedObject. When Kibana starts up, KibanaMigrator detects outdated documents and migrates them based on this value. For each migration that has been applied, the plugin's name is used as a key and the latest migration version as the value. |
| [SavedObjectsRawDoc](./kibana-plugin-server.savedobjectsrawdoc.md) | A raw document as represented directly in the saved object index. |
| [SavedObjectsResolveImportErrorsOptions](./kibana-plugin-server.savedobjectsresolveimporterrorsoptions.md) | Options to control the "resolve import" operation. |
| [SavedObjectsService](./kibana-plugin-server.savedobjectsservice.md) | |
| [SavedObjectsUpdateOptions](./kibana-plugin-server.savedobjectsupdateoptions.md) | |
| [SavedObjectsUpdateResponse](./kibana-plugin-server.savedobjectsupdateresponse.md) | |
| [SessionStorage](./kibana-plugin-server.sessionstorage.md) | Provides an interface to store and retrieve data across requests. |
Expand All @@ -122,6 +119,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [Headers](./kibana-plugin-server.headers.md) | Http request headers to read. |
| [HttpResponsePayload](./kibana-plugin-server.httpresponsepayload.md) | Data send to the client as a response payload. |
| [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | |
| [IBasePath](./kibana-plugin-server.ibasepath.md) | Access or manipulate the Kibana base path[BasePath](./kibana-plugin-server.basepath.md) |
| [IContextHandler](./kibana-plugin-server.icontexthandler.md) | A function registered by a plugin to perform some action. |
| [IContextProvider](./kibana-plugin-server.icontextprovider.md) | A function that returns a context value for a specific key of given context type. |
| [IsAuthenticated](./kibana-plugin-server.isauthenticated.md) | Return authentication status for a request. |
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit db3fb4b

Please sign in to comment.