hasprivilegesuserprofile

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Determines whether the users associated with the specified profile IDs have all the requested privileges.

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

Determines whether the users associated with the specified profile IDs have all the requested privileges.

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html

func (HasPrivilegesUserProfile) Do

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

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) Perform

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

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.

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 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/1ad7fe36297b3a8e187b2259dedaf68a47bc236e/specification/security/has_privileges_user_profile/Request.ts#L24-L38

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"`
}

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL