From 0c1e85eac6ef66ffa5a184c18ffb3f01ebacaf59 Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 14 Jun 2018 11:31:00 -0700 Subject: [PATCH 1/2] [DOCS] Enabled testing in authenticate API --- x-pack/docs/build.gradle | 1 - .../en/rest-api/security/authenticate.asciidoc | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/x-pack/docs/build.gradle b/x-pack/docs/build.gradle index 5bff371d9c26a..c1a4b97f639ce 100644 --- a/x-pack/docs/build.gradle +++ b/x-pack/docs/build.gradle @@ -76,7 +76,6 @@ buildRestTests.expectedUnconvertedCandidates = [ 'en/rest-api/ml/update-snapshot.asciidoc', 'en/rest-api/ml/validate-detector.asciidoc', 'en/rest-api/ml/validate-job.asciidoc', - 'en/rest-api/security/authenticate.asciidoc', 'en/rest-api/watcher/stats.asciidoc', 'en/watcher/example-watches/watching-time-series-data.asciidoc', ] diff --git a/x-pack/docs/en/rest-api/security/authenticate.asciidoc b/x-pack/docs/en/rest-api/security/authenticate.asciidoc index ba837ddfd2c20..de5b8761ae02e 100644 --- a/x-pack/docs/en/rest-api/security/authenticate.asciidoc +++ b/x-pack/docs/en/rest-api/security/authenticate.asciidoc @@ -29,18 +29,21 @@ GET _xpack/security/_authenticate -------------------------------------------------- // CONSOLE -The following example output provides information about the "rdeniro" user: +The following example output provides information about the "elastic" user: [source,js] -------------------------------------------------- { - "username": "rdeniro", + "username": "elastic", "roles": [ - "admin", - "kibana4" + "superuser" ], - "metadata" : { - "employee_id": "8675309" - } + "full_name": null, + "email": null, + "metadata": { + "_reserved": true + }, + "enabled": true } -------------------------------------------------- +// TESTRESPONSE \ No newline at end of file From 47caeff78a7ee73ee0f0983d8720e05bec58981f Mon Sep 17 00:00:00 2001 From: lcawl Date: Thu, 14 Jun 2018 13:05:26 -0700 Subject: [PATCH 2/2] [DOCS] Adds more tests for security APIs --- x-pack/docs/build.gradle | 3 --- .../en/rest-api/security/authenticate.asciidoc | 17 ++++++++--------- x-pack/docs/en/rest-api/security/ssl.asciidoc | 1 + .../docs/en/rest-api/security/tokens.asciidoc | 1 + x-pack/docs/en/rest-api/security/users.asciidoc | 1 + 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/x-pack/docs/build.gradle b/x-pack/docs/build.gradle index c1a4b97f639ce..ed70fcd44a7f2 100644 --- a/x-pack/docs/build.gradle +++ b/x-pack/docs/build.gradle @@ -16,9 +16,6 @@ buildRestTests.expectedUnconvertedCandidates = [ 'en/ml/functions/rare.asciidoc', 'en/ml/functions/sum.asciidoc', 'en/ml/functions/time.asciidoc', - 'en/rest-api/security/ssl.asciidoc', - 'en/rest-api/security/users.asciidoc', - 'en/rest-api/security/tokens.asciidoc', 'en/rest-api/watcher/put-watch.asciidoc', 'en/security/authentication/user-cache.asciidoc', 'en/security/authorization/field-and-document-access-control.asciidoc', diff --git a/x-pack/docs/en/rest-api/security/authenticate.asciidoc b/x-pack/docs/en/rest-api/security/authenticate.asciidoc index de5b8761ae02e..ab259762332f9 100644 --- a/x-pack/docs/en/rest-api/security/authenticate.asciidoc +++ b/x-pack/docs/en/rest-api/security/authenticate.asciidoc @@ -29,21 +29,20 @@ GET _xpack/security/_authenticate -------------------------------------------------- // CONSOLE -The following example output provides information about the "elastic" user: +The following example output provides information about the "rdeniro" user: [source,js] -------------------------------------------------- { - "username": "elastic", - "roles": [ - "superuser" + "username": "rdeniro", + "roles": [ + "admin" ], "full_name": null, - "email": null, - "metadata": { - "_reserved": true - }, + "email": null, + "metadata": { }, "enabled": true } -------------------------------------------------- -// TESTRESPONSE \ No newline at end of file +// TESTRESPONSE[s/"rdeniro"/"$body.username"/] +// TESTRESPONSE[s/"admin"/"superuser"/] \ No newline at end of file diff --git a/x-pack/docs/en/rest-api/security/ssl.asciidoc b/x-pack/docs/en/rest-api/security/ssl.asciidoc index f7a40c6d87607..6462699570fb0 100644 --- a/x-pack/docs/en/rest-api/security/ssl.asciidoc +++ b/x-pack/docs/en/rest-api/security/ssl.asciidoc @@ -109,3 +109,4 @@ The API returns the following results: } ] ---- +// NOTCONSOLE \ No newline at end of file diff --git a/x-pack/docs/en/rest-api/security/tokens.asciidoc b/x-pack/docs/en/rest-api/security/tokens.asciidoc index 70f255ead37c0..f991a5c0cb836 100644 --- a/x-pack/docs/en/rest-api/security/tokens.asciidoc +++ b/x-pack/docs/en/rest-api/security/tokens.asciidoc @@ -98,6 +98,7 @@ by the value of the `access_token`. -------------------------------------------------- curl -H "Authorization: Bearer dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==" http://localhost:9200/_cluster/health -------------------------------------------------- +// NOTCONSOLE [[security-api-refresh-token]] To extend the life of an existing token, the token api may be called again with the refresh diff --git a/x-pack/docs/en/rest-api/security/users.asciidoc b/x-pack/docs/en/rest-api/security/users.asciidoc index 926193481afbc..c84da5c7d75ff 100644 --- a/x-pack/docs/en/rest-api/security/users.asciidoc +++ b/x-pack/docs/en/rest-api/security/users.asciidoc @@ -115,6 +115,7 @@ authenticated. For example: -------------------------------------------------- curl -u jacknich:j@rV1s http://localhost:9200/_cluster/health -------------------------------------------------- +// NOTCONSOLE [[security-api-get-user]] To retrieve a native user, submit a GET request to the `/_xpack/security/user/`