From 471ee7d86784d037785a89858203e3a7998f2d9c Mon Sep 17 00:00:00 2001 From: jaymode Date: Tue, 19 Jan 2016 12:26:42 -0500 Subject: [PATCH] shield: add rest API spec for authenticate api Original commit: elastic/x-pack-elasticsearch@3dcfd5549bac8ac5998f9d7851c8162340ae7ba9 --- .../rest-api-spec/api/shield.authenticate.json | 13 +++++++++++++ .../rest-api-spec/test/authenticate/10_basic.yaml | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/api/shield.authenticate.json create mode 100644 elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/test/authenticate/10_basic.yaml diff --git a/elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/api/shield.authenticate.json b/elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/api/shield.authenticate.json new file mode 100644 index 00000000000..8c470760f97 --- /dev/null +++ b/elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/api/shield.authenticate.json @@ -0,0 +1,13 @@ +{ + "shield.authenticate": { + "documentation": "Retrieve details about the currently authenticated user", + "methods": [ "GET" ], + "url": { + "path": "/_shield/authenticate", + "paths": [ "/_shield/authenticate" ], + "parts": {}, + "params": {} + }, + "body": null + } +} diff --git a/elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/test/authenticate/10_basic.yaml b/elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/test/authenticate/10_basic.yaml new file mode 100644 index 00000000000..d990ae5f56c --- /dev/null +++ b/elasticsearch/x-pack/shield/src/test/resources/rest-api-spec/test/authenticate/10_basic.yaml @@ -0,0 +1,11 @@ +--- +"Test authenticate api": + + - do: + cluster.health: + wait_for_status: yellow + - do: + shield.authenticate: {} + + - match: { username: "test_user" } + - match: { roles.0: "admin" }