Skip to content

Commit 27bce80

Browse files
authored
[8.10] [DOCS] Move x-pack docs to docs/reference dir (#99209) (#99495)
1 parent 5eb5eae commit 27bce80

File tree

256 files changed

+370
-42
lines changed

Some content is hidden

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

256 files changed

+370
-42
lines changed

docs/build.gradle

Lines changed: 250 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ ext.docsFileTree = fileTree(projectDir) {
2424
exclude 'README.asciidoc'
2525
// Broken code snippet tests
2626
exclude 'reference/graph/explore.asciidoc'
27+
// These files simply don't pass yet. We should figure out how to fix them.
28+
exclude 'reference/watcher/reference/actions.asciidoc'
29+
exclude 'reference/rest-api/security/ssl.asciidoc'
2730
if (BuildParams.inFipsJvm) {
2831
// We don't support this component in FIPS 140
2932
exclude 'reference/ingest/processors/attachment.asciidoc'
@@ -48,7 +51,13 @@ tasks.named("buildRestTests").configure {
4851
'reference/ml/anomaly-detection/apis/post-data.asciidoc',
4952
'reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc',
5053
'reference/ml/anomaly-detection/apis/update-snapshot.asciidoc',
51-
'reference/ml/anomaly-detection/apis/update-job.asciidoc'
54+
'reference/ml/anomaly-detection/apis/update-job.asciidoc',
55+
'reference/security/authentication/user-cache.asciidoc',
56+
'reference/security/authorization/run-as-privilege.asciidoc',
57+
'reference/security/ccs-clients-integrations/http.asciidoc',
58+
'reference/rest-api/watcher/put-watch.asciidoc',
59+
'reference/rest-api/watcher/stats.asciidoc',
60+
'reference/watcher/example-watches/watching-time-series-data.asciidoc'
5261
]
5362
}
5463

@@ -74,7 +83,6 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
7483

7584
// enable regexes in painless so our tests don't complain about example snippets that use them
7685
setting 'script.painless.regex.enabled', 'true'
77-
setting 'xpack.security.enabled', 'false'
7886
setting 'path.repo', "${buildDir}/cluster/shared/repo"
7987
Closure configFile = {
8088
extraConfigFile it, file("src/test/cluster/config/$it")
@@ -102,6 +110,42 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
102110
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
103111
requiresFeature 'es.dlm_feature_flag_enabled', Version.fromString("8.8.0")
104112

113+
extraConfigFile 'op-jwks.json', project(':x-pack:test:idp-fixture').file("oidc/op-jwks.json")
114+
extraConfigFile 'idp-docs-metadata.xml', project(':x-pack:test:idp-fixture').file("idp/shibboleth-idp/metadata/idp-docs-metadata.xml")
115+
extraConfigFile 'testClient.crt', project(':x-pack:plugin:security').file("src/test/resources/org/elasticsearch/xpack/security/action/pki_delegation/testClient.crt")
116+
setting 'xpack.security.enabled', 'true'
117+
setting 'xpack.security.authc.api_key.enabled', 'true'
118+
setting 'xpack.security.authc.token.enabled', 'true'
119+
// disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
120+
setting 'indices.lifecycle.history_index_enabled', 'false'
121+
setting 'xpack.license.self_generated.type', 'trial'
122+
setting 'xpack.security.authc.realms.file.file.order', '0'
123+
setting 'xpack.security.authc.realms.native.native.order', '1'
124+
setting 'xpack.security.authc.realms.oidc.oidc1.order', '2'
125+
setting 'xpack.security.authc.realms.oidc.oidc1.op.issuer', 'http://127.0.0.1:8080'
126+
setting 'xpack.security.authc.realms.oidc.oidc1.op.authorization_endpoint', "http://127.0.0.1:8080/c2id-login"
127+
setting 'xpack.security.authc.realms.oidc.oidc1.op.token_endpoint', "http://127.0.0.1:8080/c2id/token"
128+
setting 'xpack.security.authc.realms.oidc.oidc1.op.jwkset_path', 'op-jwks.json'
129+
setting 'xpack.security.authc.realms.oidc.oidc1.rp.redirect_uri', 'https://my.fantastic.rp/cb'
130+
setting 'xpack.security.authc.realms.oidc.oidc1.rp.client_id', 'elasticsearch-rp'
131+
keystore 'xpack.security.authc.realms.oidc.oidc1.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2'
132+
setting 'xpack.security.authc.realms.oidc.oidc1.rp.response_type', 'id_token'
133+
setting 'xpack.security.authc.realms.oidc.oidc1.claims.principal', 'sub'
134+
setting 'xpack.security.authc.realms.pki.pki1.order', '3'
135+
setting 'xpack.security.authc.realms.pki.pki1.certificate_authorities', '[ "testClient.crt" ]'
136+
setting 'xpack.security.authc.realms.pki.pki1.delegation.enabled', 'true'
137+
setting 'xpack.security.authc.realms.saml.saml1.order', '4'
138+
setting 'xpack.security.authc.realms.saml.saml1.sp.logout', 'https://kibana.org/logout'
139+
setting 'xpack.security.authc.realms.saml.saml1.idp.entity_id', 'https://my-idp.org'
140+
setting 'xpack.security.authc.realms.saml.saml1.idp.metadata.path', 'idp-docs-metadata.xml'
141+
setting 'xpack.security.authc.realms.saml.saml1.sp.entity_id', 'https://kibana.org'
142+
setting 'xpack.security.authc.realms.saml.saml1.sp.acs', 'https://kibana.org/api/security/saml/callback'
143+
setting 'xpack.security.authc.realms.saml.saml1.attributes.principal', 'uid'
144+
setting 'xpack.security.authc.realms.saml.saml1.attributes.name', 'urn:oid:2.5.4.3'
145+
146+
user username: 'test_admin'
147+
user username: 'test_user'
148+
105149
// build the cluster with all plugins
106150
project.rootProject.subprojects.findAll { it.parent.path == ':plugins' }.each { subproj ->
107151
/* Skip repositories. We just aren't going to be able to test them so it
@@ -1657,6 +1701,210 @@ setups['setup-snapshots'] = setups['setup-repository'] + '''
16571701
body: |
16581702
#atomic_red_data#
16591703
'''
1704+
1705+
setups['my_inactive_watch'] = '''
1706+
- do:
1707+
watcher.put_watch:
1708+
id: "my_watch"
1709+
active: false
1710+
body: >
1711+
{
1712+
"trigger": {
1713+
"schedule": {
1714+
"hourly": {
1715+
"minute": [ 0, 5 ]
1716+
}
1717+
}
1718+
},
1719+
"input": {
1720+
"simple": {
1721+
"payload": {
1722+
"send": "yes"
1723+
}
1724+
}
1725+
},
1726+
"condition": {
1727+
"always": {}
1728+
},
1729+
"actions": {
1730+
"test_index": {
1731+
"index": {
1732+
"index": "test"
1733+
}
1734+
}
1735+
}
1736+
}
1737+
- match: { _id: "my_watch" }
1738+
'''
1739+
1740+
setups['my_active_watch'] = setups['my_inactive_watch'].replace(
1741+
'active: false', 'active: true')
1742+
1743+
setups['role_mapping'] = '''
1744+
- do:
1745+
security.put_role_mapping:
1746+
name: "mapping1"
1747+
body: >
1748+
{
1749+
"enabled": true,
1750+
"roles": [ "user" ],
1751+
"rules": { "field": { "username": "*" } }
1752+
}
1753+
'''
1754+
1755+
setups['admin_role'] = '''
1756+
- do:
1757+
security.put_role:
1758+
name: "my_admin_role"
1759+
body: >
1760+
{
1761+
"cluster": ["all"],
1762+
"indices": [
1763+
{"names": ["index1", "index2" ], "privileges": ["all"], "field_security" : {"grant" : [ "title", "body" ]}}
1764+
],
1765+
"run_as": [ "other_user" ],
1766+
"metadata" : {"version": 1}
1767+
}
1768+
'''
1769+
setups['jacknich_user'] = '''
1770+
- do:
1771+
security.put_user:
1772+
username: "jacknich"
1773+
body: >
1774+
{
1775+
"password" : "l0ng-r4nd0m-p@ssw0rd",
1776+
"roles" : [ "admin", "other_role1" ],
1777+
"full_name" : "Jack Nicholson",
1778+
"email" : "[email protected]",
1779+
"metadata" : { "intelligence" : 7 }
1780+
}
1781+
- do:
1782+
security.activate_user_profile:
1783+
body: >
1784+
{
1785+
"grant_type": "password",
1786+
"username": "jacknich",
1787+
"password" : "l0ng-r4nd0m-p@ssw0rd"
1788+
}
1789+
'''
1790+
setups['app0102_privileges'] = '''
1791+
- do:
1792+
security.put_privileges:
1793+
body: >
1794+
{
1795+
"myapp": {
1796+
"read": {
1797+
"application": "myapp",
1798+
"name": "read",
1799+
"actions": [
1800+
"data:read/*",
1801+
"action:login" ],
1802+
"metadata": {
1803+
"description": "Read access to myapp"
1804+
}
1805+
}
1806+
}
1807+
}
1808+
'''
1809+
setups['service_token42'] = '''
1810+
- do:
1811+
security.create_service_token:
1812+
namespace: elastic
1813+
service: fleet-server
1814+
name: token42
1815+
'''
1816+
setups['user_profiles'] = '''
1817+
- do:
1818+
security.put_user:
1819+
username: "jacknich"
1820+
body: >
1821+
{
1822+
"password" : "l0ng-r4nd0m-p@ssw0rd",
1823+
"roles" : [ "admin", "other_role1" ],
1824+
"full_name" : "Jack Nicholson",
1825+
"email" : "[email protected]"
1826+
}
1827+
- do:
1828+
security.put_user:
1829+
username: "jackrea"
1830+
body: >
1831+
{
1832+
"password" : "l0ng-r4nd0m-p@ssw0rd",
1833+
"roles" : [ "admin" ],
1834+
"full_name" : "Jack Reacher",
1835+
"email" : "[email protected]"
1836+
}
1837+
- do:
1838+
security.put_user:
1839+
username: "jackspa"
1840+
body: >
1841+
{
1842+
"password" : "l0ng-r4nd0m-p@ssw0rd",
1843+
"roles" : [ "user" ],
1844+
"full_name" : "Jack Sparrow",
1845+
"email" : "[email protected]"
1846+
}
1847+
- do:
1848+
security.activate_user_profile:
1849+
body: >
1850+
{
1851+
"grant_type": "password",
1852+
"username": "jacknich",
1853+
"password" : "l0ng-r4nd0m-p@ssw0rd"
1854+
}
1855+
- do:
1856+
security.activate_user_profile:
1857+
body: >
1858+
{
1859+
"grant_type": "password",
1860+
"username": "jackrea",
1861+
"password" : "l0ng-r4nd0m-p@ssw0rd"
1862+
}
1863+
- do:
1864+
security.activate_user_profile:
1865+
body: >
1866+
{
1867+
"grant_type": "password",
1868+
"username": "jackspa",
1869+
"password" : "l0ng-r4nd0m-p@ssw0rd"
1870+
}
1871+
# jacknich
1872+
- do:
1873+
security.update_user_profile_data:
1874+
uid: "u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0"
1875+
body: >
1876+
{
1877+
"labels": {
1878+
"direction": "north"
1879+
},
1880+
"data": {
1881+
"app1": {
1882+
"key1": "value1"
1883+
}
1884+
}
1885+
}
1886+
# jackrea
1887+
- do:
1888+
security.update_user_profile_data:
1889+
uid: "u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0"
1890+
body: >
1891+
{
1892+
"labels": {
1893+
"direction": "west"
1894+
}
1895+
}
1896+
# jackspa
1897+
- do:
1898+
security.update_user_profile_data:
1899+
uid: "u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0"
1900+
body: >
1901+
{
1902+
"labels": {
1903+
"direction": "south"
1904+
}
1905+
}
1906+
'''
1907+
16601908
// fake data used by the correlation bucket agg
16611909
buildRestTests.setups['correlate_latency'] = '''
16621910
- do:

docs/reference/ccr/getting-started.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ cluster with cluster alias `leader`.
159159
connected to.
160160
====
161161

162-
include::../../../x-pack/docs/en/security/authentication/remote-clusters-privileges-cert.asciidoc[tag=configure-ccr-privileges]
162+
include::{es-repo-dir}/security/authentication/remote-clusters-privileges-cert.asciidoc[tag=configure-ccr-privileges]
163163

164164
[[ccr-getting-started-follower-index]]
165165
==== Create a follower index to replicate a specific index

docs/reference/data-streams/set-up-a-data-stream.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ PUT _data_stream/my-data-stream
261261
[[secure-data-stream]]
262262
=== Secure the data stream
263263

264-
include::{xes-repo-dir}/security/authorization/alias-privileges.asciidoc[tag=data-stream-security]
264+
include::{es-repo-dir}/security/authorization/alias-privileges.asciidoc[tag=data-stream-security]
265265

266266
For an example, see <<data-stream-privileges>>.
267267

docs/reference/docs/reindex.asciidoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -984,9 +984,9 @@ POST _reindex
984984
--------------------------------------------------
985985
// TEST[setup:host]
986986
// TEST[s/^/PUT my-index-000001\n/]
987-
// TEST[s/otherhost:9200",/\${host}"/]
988-
// TEST[s/"username": "user",//]
989-
// TEST[s/"password": "pass"//]
987+
// TEST[s/otherhost:9200",/\${host}",/]
988+
// TEST[s/"username": "user",/"username": "test_admin",/]
989+
// TEST[s/"password": "pass"/"password": "x-pack-test-password"/]
990990

991991
The `host` parameter must contain a scheme, host, port (e.g.
992992
`https://otherhost:9200`), and optional path (e.g. `https://otherhost:9200/proxy`).
@@ -1025,7 +1025,7 @@ POST _reindex
10251025
// TEST[setup:host]
10261026
// TEST[s/^/PUT my-index-000001\n/]
10271027
// TEST[s/otherhost:9200",/\${host}",/]
1028-
// TEST[s/API_KEY_VALUE" /\93116930-2ecb-4161-aa5e-4f3586c87ac6"/]
1028+
// TEST[s/"headers": \{[^}]*\}/"username": "test_admin", "password": "x-pack-test-password"/]
10291029

10301030
Remote hosts have to be explicitly allowed in `elasticsearch.yml` using the
10311031
`reindex.remote.whitelist` property. It can be set to a comma delimited list
@@ -1064,7 +1064,8 @@ POST _reindex
10641064
{
10651065
"source": {
10661066
"remote": {
1067-
"host": "http://otherhost:9200"
1067+
"host": "http://otherhost:9200",
1068+
...
10681069
},
10691070
"index": "source",
10701071
"size": 10,
@@ -1082,6 +1083,7 @@ POST _reindex
10821083
// TEST[setup:host]
10831084
// TEST[s/^/PUT source\n/]
10841085
// TEST[s/otherhost:9200/\${host}/]
1086+
// TEST[s/\.\.\./"username": "test_admin", "password": "x-pack-test-password"/]
10851087

10861088
It is also possible to set the socket read timeout on the remote connection
10871089
with the `socket_timeout` field and the connection timeout with the
@@ -1096,6 +1098,7 @@ POST _reindex
10961098
"source": {
10971099
"remote": {
10981100
"host": "http://otherhost:9200",
1101+
...,
10991102
"socket_timeout": "1m",
11001103
"connect_timeout": "10s"
11011104
},
@@ -1114,6 +1117,7 @@ POST _reindex
11141117
// TEST[setup:host]
11151118
// TEST[s/^/PUT source\n/]
11161119
// TEST[s/otherhost:9200/\${host}/]
1120+
// TEST[s/\.\.\.,/"username": "test_admin", "password": "x-pack-test-password",/]
11171121

11181122
[[reindex-ssl]]
11191123
===== Configuring SSL parameters

docs/reference/index.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ include::high-availability.asciidoc[]
6161

6262
include::snapshot-restore/index.asciidoc[]
6363

64-
include::{xes-repo-dir}/security/index.asciidoc[]
64+
include::security/index.asciidoc[]
6565

66-
include::{xes-repo-dir}/watcher/index.asciidoc[]
66+
include::watcher/index.asciidoc[]
6767

6868
include::commands/index.asciidoc[]
6969

docs/reference/indices/shard-stores.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ The API returns the following response:
192192
// TESTRESPONSE[s/"attributes": \{[^}]*\}/"attributes": $body.$_path/]
193193
// TESTRESPONSE[s/"roles": \[[^]]*\]/"roles": $body.$_path/]
194194
// TESTRESPONSE[s/"8.10.0"/\$node_version/]
195-
// TESTRESPONSE[s/"7000099"/"\d+"/]
196-
// TESTRESPONSE[s/"8100099"/"\d+"/]
195+
// TESTRESPONSE[s/"min_index_version": 7000099/"min_index_version": $body.$_path/]
196+
// TESTRESPONSE[s/"max_index_version": 8100099/"max_index_version": $body.$_path/]
197197

198198

199199

docs/reference/ml/anomaly-detection/apis/put-job.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,4 +536,4 @@ The API returns the following results:
536536
----
537537
// TESTRESPONSE[s/"job_version" : "8.4.0"/"job_version" : $body.job_version/]
538538
// TESTRESPONSE[s/1656087283340/$body.$_path/]
539-
// TESTRESPONSE[s/"authorization" : \{[^}]*\},//]
539+
// TESTRESPONSE[s/"superuser"/"_es_test_root"/]

0 commit comments

Comments
 (0)