hasprivilegesuserprofile

package
v9.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type HasPrivilegesUserProfile

type HasPrivilegesUserProfile struct {
	// contains filtered or unexported fields
}

func New

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.

https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-has-privileges-user-profile

func (HasPrivilegesUserProfile) Do

func (r HasPrivilegesUserProfile) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a hasprivilegesuserprofile.Response

func (*HasPrivilegesUserProfile) ErrorTrace

func (r *HasPrivilegesUserProfile) ErrorTrace(errortrace bool) *HasPrivilegesUserProfile

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*HasPrivilegesUserProfile) FilterPath

func (r *HasPrivilegesUserProfile) FilterPath(filterpaths ...string) *HasPrivilegesUserProfile

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*HasPrivilegesUserProfile) Header

Header set a key, value pair in the HasPrivilegesUserProfile headers map.

func (*HasPrivilegesUserProfile) HttpRequest

func (r *HasPrivilegesUserProfile) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*HasPrivilegesUserProfile) Human

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (HasPrivilegesUserProfile) Perform

func (r HasPrivilegesUserProfile) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*HasPrivilegesUserProfile) Pretty

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*HasPrivilegesUserProfile) Privileges

An object containing all the privileges to be checked. API name: privileges

func (*HasPrivilegesUserProfile) Raw

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*HasPrivilegesUserProfile) Request

Request allows to set the request property with the appropriate payload.

func (*HasPrivilegesUserProfile) Uids

A list of profile IDs. The privileges are checked for associated users of the profiles. API name: uids

type NewHasPrivilegesUserProfile

type NewHasPrivilegesUserProfile func() *HasPrivilegesUserProfile

NewHasPrivilegesUserProfile type alias for index.

func NewHasPrivilegesUserProfileFunc

func NewHasPrivilegesUserProfileFunc(tp elastictransport.Interface) NewHasPrivilegesUserProfile

NewHasPrivilegesUserProfileFunc returns a new instance of HasPrivilegesUserProfile with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Request

type Request struct {

	// Privileges An object containing all the privileges to be checked.
	Privileges types.PrivilegesCheck `json:"privileges"`
	// Uids A list of profile IDs. The privileges are checked for associated users of the
	// profiles.
	Uids []string `json:"uids"`
}

Request holds the request body struct for the package hasprivilegesuserprofile

https://github.com/elastic/elasticsearch-specification/blob/52c473efb1fb5320a5bac12572d0b285882862fb/specification/security/has_privileges_user_profile/Request.ts#L24-L55

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response

type Response struct {

	// Errors The subset of the requested profile IDs for which an error
	// was encountered. It does not include the missing profile IDs
	// or the profile IDs of the users that do not have all the
	// requested privileges. This field is absent if empty.
	Errors *types.HasPrivilegesUserProfileErrors `json:"errors,omitempty"`
	// HasPrivilegeUids The subset of the requested profile IDs of the users that
	// have all the requested privileges.
	HasPrivilegeUids []string `json:"has_privilege_uids"`
}

Response holds the response body struct for the package hasprivilegesuserprofile

https://github.com/elastic/elasticsearch-specification/blob/52c473efb1fb5320a5bac12572d0b285882862fb/specification/security/has_privileges_user_profile/Response.ts#L23-L38

func NewResponse

func NewResponse() *Response

NewResponse returns a Response