Skip to content

Commit add8689

Browse files
Merge branch 'master' into pipeline-library-testing
2 parents f966ff9 + d91c954 commit add8689

File tree

682 files changed

+15346
-8463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

682 files changed

+15346
-8463
lines changed

.eslintrc.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,12 @@ module.exports = {
197197
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
198198
},
199199
{
200-
target: ['(src|x-pack)/plugins/*/public/**/*'],
201-
from: ['(src|x-pack)/plugins/*/server/**/*'],
202-
errorMessage: `Public code can not import from server, use a common directory.`,
200+
target: [
201+
'(src|x-pack)/plugins/*/server/**/*',
202+
'!x-pack/plugins/apm/**/*', // https://github.com/elastic/kibana/issues/67210
203+
],
204+
from: ['(src|x-pack)/plugins/*/public/**/*'],
205+
errorMessage: `Server code can not import from public, use a common directory.`,
203206
},
204207
{
205208
target: ['(src|x-pack)/plugins/*/common/**/*'],
@@ -589,8 +592,11 @@ module.exports = {
589592
* Security Solution overrides
590593
*/
591594
{
592-
// front end typescript and javascript files only
593-
files: ['x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}'],
595+
// front end and common typescript and javascript files only
596+
files: [
597+
'x-pack/plugins/security_solution/public/**/*.{js,ts,tsx}',
598+
'x-pack/plugins/security_solution/common/**/*.{js,ts,tsx}',
599+
],
594600
rules: {
595601
'import/no-nodejs-modules': 'error',
596602
'no-restricted-imports': [
@@ -766,6 +772,23 @@ module.exports = {
766772
/**
767773
* Lists overrides
768774
*/
775+
{
776+
// front end and common typescript and javascript files only
777+
files: [
778+
'x-pack/plugins/lists/public/**/*.{js,ts,tsx}',
779+
'x-pack/plugins/lists/common/**/*.{js,ts,tsx}',
780+
],
781+
rules: {
782+
'import/no-nodejs-modules': 'error',
783+
'no-restricted-imports': [
784+
'error',
785+
{
786+
// prevents UI code from importing server side code and then webpack including it when doing builds
787+
patterns: ['**/server/*'],
788+
},
789+
],
790+
},
791+
},
769792
{
770793
// typescript and javascript for front and back end
771794
files: ['x-pack/plugins/lists/**/*.{js,ts,tsx}'],

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@
222222
/x-pack/plugins/endpoint/ @elastic/endpoint-app-team @elastic/siem
223223
/x-pack/test/api_integration/apis/endpoint/ @elastic/endpoint-app-team @elastic/siem
224224
/x-pack/test/endpoint_api_integration_no_ingest/ @elastic/endpoint-app-team @elastic/siem
225-
/x-pack/test/functional_endpoint/ @elastic/endpoint-app-team @elastic/siem
226-
/x-pack/test/functional_endpoint_ingest_failure/ @elastic/endpoint-app-team @elastic/siem
225+
/x-pack/test/security_solution_endpoint/ @elastic/endpoint-app-team @elastic/siem
227226
/x-pack/test/functional/es_archives/endpoint/ @elastic/endpoint-app-team @elastic/siem
228227
/x-pack/test/plugin_functional/plugins/resolver_test/ @elastic/endpoint-app-team @elastic/siem
229228
/x-pack/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team @elastic/siem

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/.es
55
.DS_Store
66
.node_binaries
7+
.native_modules
78
node_modules
89
!/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules
910
!/src/dev/notice/__fixtures__/node_modules

docs/apm/api.asciidoc

Lines changed: 70 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,39 @@ Some APM app features are provided via a REST API:
1515
[[apm-api-example]]
1616
=== Using the APIs
1717

18-
Users interacting with APM APIs must have <<apm-app-api-user,sufficient privileges>>.
19-
In addition, there are request headers to be aware of, like `kbn-xsrf: true`, and `Content-Type: applicaton/json`.
18+
// The following content is reused throughout the API docs
19+
// tag::using-the-APIs[]
20+
Interact with APM APIs using cURL or another API tool.
21+
All APM APIs are Kibana APIs, not Elasticsearch APIs;
22+
because of this, the Kibana dev tools console cannot be used to interact with APM APIs.
23+
24+
For all APM APIs, you must use a request header.
25+
Supported headers are `Authorization`, `kbn-xsrf`, and `Content-Type`.
26+
27+
`Authorization: ApiKey {credentials}`::
28+
Kibana supports token-based authentication with the Elasticsearch API key service.
29+
The API key returned by the {ref}/security-api-create-api-key.html[Elasticsearch create API key API]
30+
can be used by sending a request with an `Authorization` header that has a value of `ApiKey` followed by the `{credentials}`,
31+
where `{credentials}` is the base64 encoding of `id` and `api_key` joined by a colon.
32+
+
33+
Alternatively, you can create a user and use their username and password to authenticate API access: `-u $USER:$PASSWORD`.
34+
+
35+
Whether using `Authorization: ApiKey {credentials}`, or `-u $USER:$PASSWORD`,
36+
users interacting with APM APIs must have <<apm-app-api-user,sufficient privileges>>.
37+
38+
`kbn-xsrf: true`::
39+
By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios:
40+
41+
* The API endpoint uses the `GET` or `HEAD` operations
42+
* The path is whitelisted using the <<settings, `server.xsrf.whitelist`>> setting
43+
* XSRF protections are disabled using the `server.xsrf.disableProtection` setting
44+
45+
`Content-Type: application/json`::
46+
Applicable only when you send a payload in the API request.
47+
{kib} API requests and responses use JSON.
48+
Typically, if you include the `kbn-xsrf` header, you must also include the `Content-Type` header.
49+
// end::using-the-APIs[]
50+
2051
Here's an example CURL request that adds an annotation to the APM app:
2152

2253
[source,curl]
@@ -38,9 +69,6 @@ curl -X POST \
3869
}'
3970
----
4071

41-
The Kibana <<api,REST API reference>> provides additional information on how to use Kibana APIs,
42-
required request headers, and token-based authentication options.
43-
4472
////
4573
*******************************************************
4674
////
@@ -59,7 +87,15 @@ The following Agent configuration APIs are available:
5987
* <<apm-list-config>> to list all Agent configurations.
6088
* <<apm-search-config>> to search for an Agent configuration.
6189

62-
See <<apm-app-api-config-manager>> for information on the privileges required to use this API endpoint.
90+
[float]
91+
[[use-agent-config-api]]
92+
==== How to use APM APIs
93+
94+
.Expand for required headers, privileges, and usage details
95+
[%collapsible%closed]
96+
======
97+
include::api.asciidoc[tag=using-the-APIs]
98+
======
6399

64100
////
65101
*******************************************************
@@ -100,7 +136,7 @@ See <<apm-app-api-config-manager>> for information on the privileges required to
100136
[[apm-update-config-example]]
101137
===== Example
102138

103-
[source,console]
139+
[source,curl]
104140
--------------------------------------------------
105141
PUT /api/apm/settings/agent-configuration
106142
{
@@ -150,7 +186,7 @@ PUT /api/apm/settings/agent-configuration
150186
[[apm-delete-config-example]]
151187
===== Example
152188

153-
[source,console]
189+
[source,curl]
154190
--------------------------------------------------
155191
DELETE /api/apm/settings/agent-configuration
156192
{
@@ -228,7 +264,7 @@ DELETE /api/apm/settings/agent-configuration
228264
[[apm-list-config-example]]
229265
===== Example
230266

231-
[source,console]
267+
[source,curl]
232268
--------------------------------------------------
233269
GET /api/apm/settings/agent-configuration
234270
--------------------------------------------------
@@ -293,7 +329,7 @@ GET /api/apm/settings/agent-configuration
293329
[[apm-search-config-example]]
294330
===== Example
295331

296-
[source,console]
332+
[source,curl]
297333
--------------------------------------------------
298334
POST /api/apm/settings/agent-configuration/search
299335
{
@@ -317,17 +353,25 @@ POST /api/apm/settings/agent-configuration/search
317353
The Annotation API allows you to annotate visualizations in the APM app with significant events, like deployments,
318354
allowing you to easily see how these events are impacting the performance of your existing applications.
319355

356+
By default, annotations are stored in a newly created `observability-annotations` index.
357+
The name of this index can be changed in your `config.yml` by editing `xpack.observability.annotations.index`.
358+
320359
The following APIs are available:
321360

322361
* <<apm-annotation-create>> to create an annotation for APM.
323362
// * <<obs-annotation-create>> POST /api/observability/annotation
324363
// * <<obs-annotation-get>> GET /api/observability/annotation/:id
325364
// * <<obs-annotation-delete>> DELETE /api/observability/annotation/:id
326365

327-
By default, annotations are stored in a newly created `observability-annotations` index.
328-
The name of this index can be changed in your `config.yml` by editing `xpack.observability.annotations.index`.
366+
[float]
367+
[[use-annotation-api]]
368+
==== How to use APM APIs
329369

330-
See <<apm-app-api-annotation-manager>> for information on the privileges required to use this API endpoint.
370+
.Expand for required headers, privileges, and usage details
371+
[%collapsible%closed]
372+
======
373+
include::api.asciidoc[tag=using-the-APIs]
374+
======
331375

332376
////
333377
*******************************************************
@@ -374,19 +418,20 @@ While you can add additional tags, you cannot remove the `apm` tag.
374418

375419
The following example creates an annotation for a service named `opbeans-java`.
376420

377-
[source,console]
421+
[source,curl]
378422
--------------------------------------------------
379-
POST /api/apm/services/opbeans-java/annotation
380-
{
381-
"@timestamp": "2020-05-08T10:31:30.452Z",
382-
"service": {
383-
"version": "1.2"
384-
},
385-
"message": "Deployment 1.2",
386-
"tags": [
387-
"elastic.co", "customer"
388-
]
389-
}
423+
curl -X POST \
424+
http://localhost:5601/api/apm/services/opbeans-java/annotation \
425+
-H 'Content-Type: application/json' \
426+
-H 'kbn-xsrf: true' \
427+
-H 'Authorization: Basic YhUlubWZhM0FDbnlQeE6WRtaW49FQmSGZ4RUWXdX' \
428+
-d '{
429+
"@timestamp": "2020-05-08T10:31:30.452Z",
430+
"service": {
431+
"version": "1.2"
432+
},
433+
"message": "Deployment 1.2"
434+
}'
390435
--------------------------------------------------
391436

392437
[[apm-annotation-config-body]]

docs/apm/deployment-annotations.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Alternatively, you can explicitly create deployment annotations with our annotat
1818
The API can integrate into your CI/CD pipeline,
1919
so that each time you deploy, a POST request is sent to the annotation API endpoint:
2020

21-
[source,console]
21+
[source,curl]
2222
----
2323
curl -X POST \
2424
http://localhost:5601/api/apm/services/${SERVICE_NAME}/annotation \ <1>

docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkcreate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Creates multiple documents at once
99
<b>Signature:</b>
1010

1111
```typescript
12-
bulkCreate: (objects?: SavedObjectsBulkCreateObject<unknown>[], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>>;
12+
bulkCreate: (objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) => Promise<SavedObjectsBatchResponse<unknown>>;
1313
```

docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.bulkget.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Returns an array of objects by id
99
<b>Signature:</b>
1010

1111
```typescript
12-
bulkGet: (objects?: {
12+
bulkGet: (objects?: Array<{
1313
id: string;
1414
type: string;
15-
}[]) => Promise<SavedObjectsBatchResponse<unknown>>;
15+
}>) => Promise<SavedObjectsBatchResponse<unknown>>;
1616
```
1717

1818
## Example

docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.delete.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Deletes an object
99
<b>Signature:</b>
1010

1111
```typescript
12-
delete: (type: string, id: string) => Promise<{}>;
12+
delete: (type: string, id: string) => ReturnType<SavedObjectsApi['delete']>;
1313
```

docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.find.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Search for objects
99
<b>Signature:</b>
1010

1111
```typescript
12-
find: <T = unknown>(options: Pick<SavedObjectFindOptionsServer, "search" | "filter" | "type" | "page" | "perPage" | "sortField" | "fields" | "searchFields" | "hasReference" | "defaultSearchOperator">) => Promise<SavedObjectsFindResponsePublic<T>>;
12+
find: <T = unknown>(options: SavedObjectsFindOptions) => Promise<SavedObjectsFindResponsePublic<T>>;
1313
```

docs/development/core/public/kibana-plugin-core-public.savedobjectsclient.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ The constructor for this class is marked as internal. Third-party code should no
2020

2121
| Property | Modifiers | Type | Description |
2222
| --- | --- | --- | --- |
23-
| [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md) | | <code>(objects?: SavedObjectsBulkCreateObject&lt;unknown&gt;[], options?: SavedObjectsBulkCreateOptions) =&gt; Promise&lt;SavedObjectsBatchResponse&lt;unknown&gt;&gt;</code> | Creates multiple documents at once |
24-
| [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md) | | <code>(objects?: {</code><br/><code> id: string;</code><br/><code> type: string;</code><br/><code> }[]) =&gt; Promise&lt;SavedObjectsBatchResponse&lt;unknown&gt;&gt;</code> | Returns an array of objects by id |
23+
| [bulkCreate](./kibana-plugin-core-public.savedobjectsclient.bulkcreate.md) | | <code>(objects?: SavedObjectsBulkCreateObject[], options?: SavedObjectsBulkCreateOptions) =&gt; Promise&lt;SavedObjectsBatchResponse&lt;unknown&gt;&gt;</code> | Creates multiple documents at once |
24+
| [bulkGet](./kibana-plugin-core-public.savedobjectsclient.bulkget.md) | | <code>(objects?: Array&lt;{</code><br/><code> id: string;</code><br/><code> type: string;</code><br/><code> }&gt;) =&gt; Promise&lt;SavedObjectsBatchResponse&lt;unknown&gt;&gt;</code> | Returns an array of objects by id |
2525
| [create](./kibana-plugin-core-public.savedobjectsclient.create.md) | | <code>&lt;T = unknown&gt;(type: string, attributes: T, options?: SavedObjectsCreateOptions) =&gt; Promise&lt;SimpleSavedObject&lt;T&gt;&gt;</code> | Persists an object |
26-
| [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md) | | <code>(type: string, id: string) =&gt; Promise&lt;{}&gt;</code> | Deletes an object |
27-
| [find](./kibana-plugin-core-public.savedobjectsclient.find.md) | | <code>&lt;T = unknown&gt;(options: Pick&lt;SavedObjectFindOptionsServer, &quot;search&quot; &#124; &quot;filter&quot; &#124; &quot;type&quot; &#124; &quot;page&quot; &#124; &quot;perPage&quot; &#124; &quot;sortField&quot; &#124; &quot;fields&quot; &#124; &quot;searchFields&quot; &#124; &quot;hasReference&quot; &#124; &quot;defaultSearchOperator&quot;&gt;) =&gt; Promise&lt;SavedObjectsFindResponsePublic&lt;T&gt;&gt;</code> | Search for objects |
26+
| [delete](./kibana-plugin-core-public.savedobjectsclient.delete.md) | | <code>(type: string, id: string) =&gt; ReturnType&lt;SavedObjectsApi['delete']&gt;</code> | Deletes an object |
27+
| [find](./kibana-plugin-core-public.savedobjectsclient.find.md) | | <code>&lt;T = unknown&gt;(options: SavedObjectsFindOptions) =&gt; Promise&lt;SavedObjectsFindResponsePublic&lt;T&gt;&gt;</code> | Search for objects |
2828
| [get](./kibana-plugin-core-public.savedobjectsclient.get.md) | | <code>&lt;T = unknown&gt;(type: string, id: string) =&gt; Promise&lt;SimpleSavedObject&lt;T&gt;&gt;</code> | Fetches a single object |
2929

3030
## Methods

0 commit comments

Comments
 (0)