mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
adding new specs for security endpoints without _xpack prefix (#27057)
* adding new specs for security endpoints without _xpack prefix * adding overrides * fixing issues with autocomplete and missing docs
This commit is contained in:
parent
2fa3cd8bf4
commit
07f7e8d35c
34 changed files with 491 additions and 1 deletions
|
@ -32,3 +32,4 @@ export { FieldAutocompleteComponent } from './field_autocomplete_component';
|
|||
export { TypeAutocompleteComponent } from './type_autocomplete_component';
|
||||
export { IdAutocompleteComponent } from './id_autocomplete_component';
|
||||
export { TemplateAutocompleteComponent } from './template_autocomplete_component';
|
||||
export { UsernameAutocompleteComponent } from './username_autocomplete_component';
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
}
|
|
@ -22,7 +22,8 @@ import {
|
|||
IndexAutocompleteComponent,
|
||||
FieldAutocompleteComponent,
|
||||
ListComponent,
|
||||
TemplateAutocompleteComponent
|
||||
TemplateAutocompleteComponent,
|
||||
UsernameAutocompleteComponent
|
||||
} from './autocomplete/components';
|
||||
|
||||
import $ from 'jquery';
|
||||
|
@ -61,6 +62,12 @@ const parametrizedComponentFactories = {
|
|||
id: function (name, parent) {
|
||||
return idAutocompleteComponentFactory(name, parent);
|
||||
},
|
||||
username: function (name, parent) {
|
||||
return new UsernameAutocompleteComponent(name, parent);
|
||||
},
|
||||
user: function (name, parent) {
|
||||
return new UsernameAutocompleteComponent(name, parent);
|
||||
},
|
||||
template: function (name, parent) {
|
||||
return new TemplateAutocompleteComponent(name, parent);
|
||||
},
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"security.get_user_privileges": {
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"patterns": [
|
||||
"_security/user/_privileges"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"security.put_role_mapping": {
|
||||
"url_params": {
|
||||
"refresh": [
|
||||
"true",
|
||||
"false",
|
||||
"wait_for"
|
||||
]
|
||||
},
|
||||
"methods": [
|
||||
"PUT",
|
||||
"POST"
|
||||
],
|
||||
"patterns": [
|
||||
"_security/role_mapping/{name}"
|
||||
],
|
||||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"security.put_user": {
|
||||
"url_params": {
|
||||
"refresh": [
|
||||
"true",
|
||||
"false",
|
||||
"wait_for"
|
||||
]
|
||||
},
|
||||
"methods": [
|
||||
"PUT",
|
||||
"POST"
|
||||
],
|
||||
"patterns": [
|
||||
"_security/user/{username}"
|
||||
],
|
||||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"ssl.certificates": {
|
||||
"methods": [
|
||||
"GET"
|
||||
],
|
||||
"patterns": [
|
||||
"_ssl/certificates"
|
||||
],
|
||||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"security.authenticate": {
|
||||
"data_autocomplete_rules": {
|
||||
"password": ""
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"security.change_password": {
|
||||
"data_autocomplete_rules": {
|
||||
"password": ""
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"security.get_token": {
|
||||
"data_autocomplete_rules": {
|
||||
"grant_type": "",
|
||||
"password": "",
|
||||
"scope": "",
|
||||
"username": ""
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"security.has_privileges": {
|
||||
"data_autocomplete_rules": {
|
||||
"cluster": [],
|
||||
"index": {
|
||||
"__template": {
|
||||
"names": [],
|
||||
"privileges": []
|
||||
},
|
||||
"names": [],
|
||||
"privileges": []
|
||||
},
|
||||
"application": {
|
||||
"__template": {
|
||||
"application": [],
|
||||
"privileges": [],
|
||||
"resources": []
|
||||
},
|
||||
"application": [],
|
||||
"privileges": [],
|
||||
"resources": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"security.invalidate_token": {
|
||||
"data_autocomplete_rules": {
|
||||
"token": ""
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"security.put_role": {
|
||||
"data_autocomplete_rules": {
|
||||
"cluster": [],
|
||||
"indices": [
|
||||
{
|
||||
"field_security": {},
|
||||
"names": [],
|
||||
"privileges": [],
|
||||
"query": ""
|
||||
}
|
||||
],
|
||||
"run_as": [],
|
||||
"metadata": {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"security.put_role_mapping": {
|
||||
"data_autocomplete_rules": {
|
||||
"enabled": true,
|
||||
"metadata": {},
|
||||
"roles": [],
|
||||
"rules": {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"security.put_user": {
|
||||
"data_autocomplete_rules": {
|
||||
"metadata": {},
|
||||
"password": "",
|
||||
"fullname": "",
|
||||
"roles": []
|
||||
},
|
||||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue