-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[DOCS] Move x-pack docs to docs/reference
dir
#99209
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
82dbc8a
Move x-pack docs to `docs/reference`
jrodewig 47d723a
Update x-pack repo references
jrodewig 12fe422
Add watcher and security to gradle docs tests
jrodewig a202bf4
Update tests to use security
jrodewig a511f03
Merge remote-tracking branch 'upstream' into move-x-pack-docs
jrodewig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ ext.docsFileTree = fileTree(projectDir) { | |
exclude 'README.asciidoc' | ||
// Broken code snippet tests | ||
exclude 'reference/graph/explore.asciidoc' | ||
// These files simply don't pass yet. We should figure out how to fix them. | ||
exclude 'reference/watcher/reference/actions.asciidoc' | ||
exclude 'reference/rest-api/security/ssl.asciidoc' | ||
Comment on lines
+27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if (BuildParams.inFipsJvm) { | ||
// We don't support this component in FIPS 140 | ||
exclude 'reference/ingest/processors/attachment.asciidoc' | ||
|
@@ -48,7 +51,13 @@ tasks.named("buildRestTests").configure { | |
'reference/ml/anomaly-detection/apis/post-data.asciidoc', | ||
'reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc', | ||
'reference/ml/anomaly-detection/apis/update-snapshot.asciidoc', | ||
'reference/ml/anomaly-detection/apis/update-job.asciidoc' | ||
'reference/ml/anomaly-detection/apis/update-job.asciidoc', | ||
'reference/security/authentication/user-cache.asciidoc', | ||
'reference/security/authorization/run-as-privilege.asciidoc', | ||
'reference/security/ccs-clients-integrations/http.asciidoc', | ||
'reference/rest-api/watcher/put-watch.asciidoc', | ||
'reference/rest-api/watcher/stats.asciidoc', | ||
'reference/watcher/example-watches/watching-time-series-data.asciidoc' | ||
] | ||
} | ||
|
||
|
@@ -74,7 +83,6 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach { | |
|
||
// enable regexes in painless so our tests don't complain about example snippets that use them | ||
setting 'script.painless.regex.enabled', 'true' | ||
setting 'xpack.security.enabled', 'false' | ||
setting 'path.repo', "${buildDir}/cluster/shared/repo" | ||
Closure configFile = { | ||
extraConfigFile it, file("src/test/cluster/config/$it") | ||
|
@@ -101,6 +109,42 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach { | |
|
||
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0") | ||
|
||
extraConfigFile 'op-jwks.json', project(':x-pack:test:idp-fixture').file("oidc/op-jwks.json") | ||
extraConfigFile 'idp-docs-metadata.xml', project(':x-pack:test:idp-fixture').file("idp/shibboleth-idp/metadata/idp-docs-metadata.xml") | ||
extraConfigFile 'testClient.crt', project(':x-pack:plugin:security').file("src/test/resources/org/elasticsearch/xpack/security/action/pki_delegation/testClient.crt") | ||
setting 'xpack.security.enabled', 'true' | ||
setting 'xpack.security.authc.api_key.enabled', 'true' | ||
setting 'xpack.security.authc.token.enabled', 'true' | ||
// disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness | ||
setting 'indices.lifecycle.history_index_enabled', 'false' | ||
setting 'xpack.license.self_generated.type', 'trial' | ||
setting 'xpack.security.authc.realms.file.file.order', '0' | ||
setting 'xpack.security.authc.realms.native.native.order', '1' | ||
setting 'xpack.security.authc.realms.oidc.oidc1.order', '2' | ||
setting 'xpack.security.authc.realms.oidc.oidc1.op.issuer', 'http://127.0.0.1:8080' | ||
setting 'xpack.security.authc.realms.oidc.oidc1.op.authorization_endpoint', "http://127.0.0.1:8080/c2id-login" | ||
setting 'xpack.security.authc.realms.oidc.oidc1.op.token_endpoint', "http://127.0.0.1:8080/c2id/token" | ||
setting 'xpack.security.authc.realms.oidc.oidc1.op.jwkset_path', 'op-jwks.json' | ||
setting 'xpack.security.authc.realms.oidc.oidc1.rp.redirect_uri', 'https://my.fantastic.rp/cb' | ||
setting 'xpack.security.authc.realms.oidc.oidc1.rp.client_id', 'elasticsearch-rp' | ||
keystore 'xpack.security.authc.realms.oidc.oidc1.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2' | ||
setting 'xpack.security.authc.realms.oidc.oidc1.rp.response_type', 'id_token' | ||
setting 'xpack.security.authc.realms.oidc.oidc1.claims.principal', 'sub' | ||
setting 'xpack.security.authc.realms.pki.pki1.order', '3' | ||
setting 'xpack.security.authc.realms.pki.pki1.certificate_authorities', '[ "testClient.crt" ]' | ||
setting 'xpack.security.authc.realms.pki.pki1.delegation.enabled', 'true' | ||
setting 'xpack.security.authc.realms.saml.saml1.order', '4' | ||
setting 'xpack.security.authc.realms.saml.saml1.sp.logout', 'https://kibana.org/logout' | ||
setting 'xpack.security.authc.realms.saml.saml1.idp.entity_id', 'https://my-idp.org' | ||
setting 'xpack.security.authc.realms.saml.saml1.idp.metadata.path', 'idp-docs-metadata.xml' | ||
setting 'xpack.security.authc.realms.saml.saml1.sp.entity_id', 'https://kibana.org' | ||
setting 'xpack.security.authc.realms.saml.saml1.sp.acs', 'https://kibana.org/api/security/saml/callback' | ||
setting 'xpack.security.authc.realms.saml.saml1.attributes.principal', 'uid' | ||
setting 'xpack.security.authc.realms.saml.saml1.attributes.name', 'urn:oid:2.5.4.3' | ||
|
||
user username: 'test_admin' | ||
user username: 'test_user' | ||
|
||
// build the cluster with all plugins | ||
project.rootProject.subprojects.findAll { it.parent.path == ':plugins' }.each { subproj -> | ||
/* Skip repositories. We just aren't going to be able to test them so it | ||
|
@@ -1653,6 +1697,210 @@ setups['setup-snapshots'] = setups['setup-repository'] + ''' | |
body: | | ||
#atomic_red_data# | ||
''' | ||
|
||
setups['my_inactive_watch'] = ''' | ||
- do: | ||
watcher.put_watch: | ||
id: "my_watch" | ||
active: false | ||
body: > | ||
{ | ||
"trigger": { | ||
"schedule": { | ||
"hourly": { | ||
"minute": [ 0, 5 ] | ||
} | ||
} | ||
}, | ||
"input": { | ||
"simple": { | ||
"payload": { | ||
"send": "yes" | ||
} | ||
} | ||
}, | ||
"condition": { | ||
"always": {} | ||
}, | ||
"actions": { | ||
"test_index": { | ||
"index": { | ||
"index": "test" | ||
} | ||
} | ||
} | ||
} | ||
- match: { _id: "my_watch" } | ||
''' | ||
|
||
setups['my_active_watch'] = setups['my_inactive_watch'].replace( | ||
'active: false', 'active: true') | ||
|
||
setups['role_mapping'] = ''' | ||
- do: | ||
security.put_role_mapping: | ||
name: "mapping1" | ||
body: > | ||
{ | ||
"enabled": true, | ||
"roles": [ "user" ], | ||
"rules": { "field": { "username": "*" } } | ||
} | ||
''' | ||
|
||
setups['admin_role'] = ''' | ||
- do: | ||
security.put_role: | ||
name: "my_admin_role" | ||
body: > | ||
{ | ||
"cluster": ["all"], | ||
"indices": [ | ||
{"names": ["index1", "index2" ], "privileges": ["all"], "field_security" : {"grant" : [ "title", "body" ]}} | ||
], | ||
"run_as": [ "other_user" ], | ||
"metadata" : {"version": 1} | ||
} | ||
''' | ||
setups['jacknich_user'] = ''' | ||
- do: | ||
security.put_user: | ||
username: "jacknich" | ||
body: > | ||
{ | ||
"password" : "l0ng-r4nd0m-p@ssw0rd", | ||
"roles" : [ "admin", "other_role1" ], | ||
"full_name" : "Jack Nicholson", | ||
"email" : "[email protected]", | ||
"metadata" : { "intelligence" : 7 } | ||
} | ||
- do: | ||
security.activate_user_profile: | ||
body: > | ||
{ | ||
"grant_type": "password", | ||
"username": "jacknich", | ||
"password" : "l0ng-r4nd0m-p@ssw0rd" | ||
} | ||
''' | ||
setups['app0102_privileges'] = ''' | ||
- do: | ||
security.put_privileges: | ||
body: > | ||
{ | ||
"myapp": { | ||
"read": { | ||
"application": "myapp", | ||
"name": "read", | ||
"actions": [ | ||
"data:read/*", | ||
"action:login" ], | ||
"metadata": { | ||
"description": "Read access to myapp" | ||
} | ||
} | ||
} | ||
} | ||
''' | ||
setups['service_token42'] = ''' | ||
- do: | ||
security.create_service_token: | ||
namespace: elastic | ||
service: fleet-server | ||
name: token42 | ||
''' | ||
setups['user_profiles'] = ''' | ||
- do: | ||
security.put_user: | ||
username: "jacknich" | ||
body: > | ||
{ | ||
"password" : "l0ng-r4nd0m-p@ssw0rd", | ||
"roles" : [ "admin", "other_role1" ], | ||
"full_name" : "Jack Nicholson", | ||
"email" : "[email protected]" | ||
} | ||
- do: | ||
security.put_user: | ||
username: "jackrea" | ||
body: > | ||
{ | ||
"password" : "l0ng-r4nd0m-p@ssw0rd", | ||
"roles" : [ "admin" ], | ||
"full_name" : "Jack Reacher", | ||
"email" : "[email protected]" | ||
} | ||
- do: | ||
security.put_user: | ||
username: "jackspa" | ||
body: > | ||
{ | ||
"password" : "l0ng-r4nd0m-p@ssw0rd", | ||
"roles" : [ "user" ], | ||
"full_name" : "Jack Sparrow", | ||
"email" : "[email protected]" | ||
} | ||
- do: | ||
security.activate_user_profile: | ||
body: > | ||
{ | ||
"grant_type": "password", | ||
"username": "jacknich", | ||
"password" : "l0ng-r4nd0m-p@ssw0rd" | ||
} | ||
- do: | ||
security.activate_user_profile: | ||
body: > | ||
{ | ||
"grant_type": "password", | ||
"username": "jackrea", | ||
"password" : "l0ng-r4nd0m-p@ssw0rd" | ||
} | ||
- do: | ||
security.activate_user_profile: | ||
body: > | ||
{ | ||
"grant_type": "password", | ||
"username": "jackspa", | ||
"password" : "l0ng-r4nd0m-p@ssw0rd" | ||
} | ||
# jacknich | ||
- do: | ||
security.update_user_profile_data: | ||
uid: "u_79HkWkwmnBH5gqFKwoxggWPjEBOur1zLPXQPEl1VBW0_0" | ||
body: > | ||
{ | ||
"labels": { | ||
"direction": "north" | ||
}, | ||
"data": { | ||
"app1": { | ||
"key1": "value1" | ||
} | ||
} | ||
} | ||
# jackrea | ||
- do: | ||
security.update_user_profile_data: | ||
uid: "u_P_0BMHgaOK3p7k-PFWUCbw9dQ-UFjt01oWJ_Dp2PmPc_0" | ||
body: > | ||
{ | ||
"labels": { | ||
"direction": "west" | ||
} | ||
} | ||
# jackspa | ||
- do: | ||
security.update_user_profile_data: | ||
uid: "u_8RKO7AKfEbSiIHZkZZ2LJy2MUSDPWDr3tMI_CkIGApU_0" | ||
body: > | ||
{ | ||
"labels": { | ||
"direction": "south" | ||
} | ||
} | ||
''' | ||
|
||
// fake data used by the correlation bucket agg | ||
buildRestTests.setups['correlate_latency'] = ''' | ||
- do: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to this file are taken from https://github.com/elastic/elasticsearch/blob/main/x-pack/docs/build.gradle