Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding new specs for security endpoints without _xpack prefix (#27057) (
#27391) * adding new specs for security endpoints without _xpack prefix * adding overrides * fixing issues with autocomplete and missing docs
- Loading branch information
1 parent
d7a0283
commit 319cc41
Showing
34 changed files
with
491 additions
and
1 deletion.
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
43 changes: 43 additions & 0 deletions
43
...ore_plugins/console/public/src/autocomplete/components/username_autocomplete_component.js
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import _ from 'lodash'; | ||
import mappings from '../../mappings'; | ||
import { ListComponent } from './list_component'; | ||
function nonValidUsernameType(token) { | ||
return token[0] === '_'; | ||
} | ||
export class UsernameAutocompleteComponent extends ListComponent { | ||
constructor(name, parent, multiValued) { | ||
super(name, mappings.getIndices, parent, multiValued); | ||
} | ||
validateTokens(tokens) { | ||
if (!this.multiValued && tokens.length > 1) { | ||
return false; | ||
} | ||
return !_.find(tokens, nonValidUsernameType); | ||
} | ||
|
||
getDefaultTermMeta() { | ||
return 'username'; | ||
} | ||
|
||
getContextKey() { | ||
return 'username'; | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/console_extensions/spec/generated/security.authenticate.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"security.authenticate": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_security/_authenticate" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html" | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
x-pack/plugins/console_extensions/spec/generated/security.change_password.json
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"security.change_password": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"PUT", | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/user/{username}/_password", | ||
"_security/user/_password" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/console_extensions/spec/generated/security.clear_cached_realms.json
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"security.clear_cached_realms": { | ||
"url_params": { | ||
"usernames": [] | ||
}, | ||
"methods": [ | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/realm/{realms}/_clear_cache" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/console_extensions/spec/generated/security.clear_cached_roles.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"security.clear_cached_roles": { | ||
"methods": [ | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/role/{name}/_clear_cache" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/console_extensions/spec/generated/security.delete_privileges.json
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"security.delete_privileges": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"DELETE" | ||
], | ||
"patterns": [ | ||
"_security/privilege/{application}/{name}" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-delete-privilege.html" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/console_extensions/spec/generated/security.delete_role.json
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"security.delete_role": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"DELETE" | ||
], | ||
"patterns": [ | ||
"_security/role/{name}" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/console_extensions/spec/generated/security.delete_role_mapping.json
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"security.delete_role_mapping": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"DELETE" | ||
], | ||
"patterns": [ | ||
"_security/role_mapping/{name}" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/console_extensions/spec/generated/security.delete_user.json
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"security.delete_user": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"DELETE" | ||
], | ||
"patterns": [ | ||
"_security/user/{username}" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/console_extensions/spec/generated/security.disable_user.json
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"security.disable_user": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"PUT", | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/user/{username}/_disable" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/console_extensions/spec/generated/security.enable_user.json
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"security.enable_user": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"PUT", | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/user/{username}/_enable" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/console_extensions/spec/generated/security.get_privileges.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"security.get_privileges": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_security/privilege/{application}/{name}" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-get-privileges.html" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/console_extensions/spec/generated/security.get_role.json
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"security.get_role": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_security/role/{name}", | ||
"_security/role" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/console_extensions/spec/generated/security.get_role_mapping.json
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"security.get_role_mapping": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_security/role_mapping/{name}", | ||
"_security/role_mapping" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/console_extensions/spec/generated/security.get_token.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"security.get_token": { | ||
"methods": [ | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/oauth2/token" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/console_extensions/spec/generated/security.get_user.json
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"security.get_user": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_security/user/{username}", | ||
"_security/user" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
x-pack/plugins/console_extensions/spec/generated/security.get_user_privileges.json
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"security.get_user_privileges": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_security/user/_privileges" | ||
] | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
x-pack/plugins/console_extensions/spec/generated/security.has_privileges.json
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"security.has_privileges": { | ||
"methods": [ | ||
"GET", | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/user/_has_privileges", | ||
"_security/user/{user}/_has_privileges" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/console_extensions/spec/generated/security.invalidate_token.json
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"security.invalidate_token": { | ||
"methods": [ | ||
"DELETE" | ||
], | ||
"patterns": [ | ||
"_security/oauth2/token" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/console_extensions/spec/generated/security.put_privileges.json
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"security.put_privileges": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"PUT", | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/privilege/" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-put-privileges.html" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/console_extensions/spec/generated/security.put_role.json
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"security.put_role": { | ||
"url_params": { | ||
"refresh": [ | ||
"true", | ||
"false", | ||
"wait_for" | ||
] | ||
}, | ||
"methods": [ | ||
"PUT", | ||
"POST" | ||
], | ||
"patterns": [ | ||
"_security/role/{name}" | ||
], | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html" | ||
} | ||
} |
Oops, something went wrong.