Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Security
module Actions
# Activate a user profile.
# Create or update a user profile on behalf of another user.
# NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
# Individual users and external applications should not call this API directly.
# The calling application must have either an +access_token+ or a combination of +username+ and +password+ for the user that the profile document is intended for.
# Elastic reserves the right to change or remove this feature in future releases without prior notice.
# This API creates or updates a profile document for end users with information that is extracted from the user's authentication object including +username+, +full_name,+ +roles+, and the authentication realm.
# For example, in the JWT +access_token+ case, the profile user's +username+ is extracted from the JWT token claim pointed to by the +claims.principal+ setting of the JWT realm that authenticated the token.
# When updating a profile document, the API enables the document if it was disabled.
# Any updates do not change existing content for either the +labels+ or +data+ fields.
#
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-activate-user-profile
#
def activate_user_profile(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'security.activate_user_profile' }

raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = arguments.delete(:body)

method = Elasticsearch::API::HTTP_POST
path = "_security/profile/_activate"
params = {}

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# 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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Security
module Actions
# Disable a user profile.
# Disable user profiles so that they are not visible in user profile searches.
# NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
# Individual users and external applications should not call this API directly.
# Elastic reserves the right to change or remove this feature in future releases without prior notice.
# When you activate a user profile, its automatically enabled and visible in user profile searches. You can use the disable user profile API to disable a user profile so it’s not visible in these searches.
# To re-enable a disabled user profile, use the enable user profile API .
#
# @option arguments [String] :uid Unique identifier for the user profile. (*Required*)
# @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search.
# If 'wait_for', it waits for a refresh to make this operation visible to search.
# If 'false', it does nothing with refreshes. Server default: false.
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-disable-user-profile
#
def disable_user_profile(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'security.disable_user_profile' }

defined_params = [:uid].inject({}) do |set_variables, variable|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
set_variables
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_uid = arguments.delete(:uid)

method = Elasticsearch::API::HTTP_PUT
path = "_security/profile/#{Utils.__listify(_uid)}/_disable"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Security
module Actions
# Enable a user profile.
# Enable user profiles to make them visible in user profile searches.
# NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
# Individual users and external applications should not call this API directly.
# Elastic reserves the right to change or remove this feature in future releases without prior notice.
# When you activate a user profile, it's automatically enabled and visible in user profile searches.
# If you later disable the user profile, you can use the enable user profile API to make the profile visible in these searches again.
#
# @option arguments [String] :uid A unique identifier for the user profile. (*Required*)
# @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation
# visible to search.
# If 'wait_for', it waits for a refresh to make this operation visible to search.
# If 'false', nothing is done with refreshes. Server default: false.
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enable-user-profile
#
def enable_user_profile(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'security.enable_user_profile' }

defined_params = [:uid].inject({}) do |set_variables, variable|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
set_variables
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_uid = arguments.delete(:uid)

method = Elasticsearch::API::HTTP_PUT
path = "_security/profile/#{Utils.__listify(_uid)}/_enable"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Security
module Actions
# Get a user profile.
# Get a user's profile using the unique profile ID.
# NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
# Individual users and external applications should not call this API directly.
# Elastic reserves the right to change or remove this feature in future releases without prior notice.
#
# @option arguments [Userprofileid] :uid A unique identifier for the user profile. (*Required*)
# @option arguments [String] :data A comma-separated list of filters for the +data+ field of the profile document.
# To return all content use +data=*+.
# To return a subset of content use +data=<key>+ to retrieve content nested under the specified +<key>+.
# By default returns no +data+ content.
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user-profile
#
def get_user_profile(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'security.get_user_profile' }

defined_params = [:uid].inject({}) do |set_variables, variable|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
set_variables
end
request_opts[:defined_params] = defined_params unless defined_params.empty?

raise ArgumentError, "Required argument 'uid' missing" unless arguments[:uid]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = nil

_uid = arguments.delete(:uid)

method = Elasticsearch::API::HTTP_GET
path = "_security/profile/#{Utils.__listify(_uid)}"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Security
module Actions
# Check user profile privileges.
# Determine whether the users associated with the specified user profile IDs have all the requested privileges.
# NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual users and external applications should not call this API directly.
# Elastic reserves the right to change or remove this feature in future releases without prior notice.
#
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-has-privileges-user-profile
#
def has_privileges_user_profile(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'security.has_privileges_user_profile' }

raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = arguments.delete(:body)

method = Elasticsearch::API::HTTP_POST
path = "_security/profile/_has_privileges"
params = {}

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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.
#
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Security
module Actions
# Suggest a user profile.
# Get suggestions for user profiles that match specified search criteria.
# NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions.
# Individual users and external applications should not call this API directly.
# Elastic reserves the right to change or remove this feature in future releases without prior notice.
#
# @option arguments [String] :data A comma-separated list of filters for the +data+ field of the profile document.
# To return all content use +data=*+.
# To return a subset of content, use +data=<key>+ to retrieve content nested under the specified +<key>+.
# By default, the API returns no +data+ content.
# It is an error to specify +data+ as both the query parameter and the request body field.
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body request body
#
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-suggest-user-profiles
#
def suggest_user_profiles(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'security.suggest_user_profiles' }

arguments = arguments.clone
headers = arguments.delete(:headers) || {}

body = arguments.delete(:body)

method = if body
Elasticsearch::API::HTTP_POST
else
Elasticsearch::API::HTTP_GET
end

path = "_security/profile/_suggest"
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end
end
Loading