security

package
v0.0.0-...-c7e1f73 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actiongroup

type Actiongroup struct {
	Name           string   `json:"name"`
	Reserved       bool     `json:"reserved"`
	Hidden         bool     `json:"hidden"`
	AllowedActions []string `json:"allowed_actions"`
	Type           string   `json:"type"`
	Description    string   `json:"description"`
	Static         bool     `json:"static"`
}

type ActiongroupServiceInterface

type ActiongroupServiceInterface interface {
	Get(ctx context.Context, name string) (*Actiongroup, error)
	List(ctx context.Context) (*[]Actiongroup, error)
	Create(ctx context.Context, name string) error
	common.Modifyable
}

type Health

type Health struct {
	Message string `json:"message"`
	Mode    string `json:"mode"`
	Status  string `json:"status"`
}

type HealthService

type HealthService common.Service

func (*HealthService) Get

func (s *HealthService) Get(ctx context.Context) (*Health, error)

type HealthServiceInterface

type HealthServiceInterface interface {
	Get(ctx context.Context) (*Health, error)
}

type IndexPermissions

type IndexPermissions struct {
	IndexPatterns  []string `json:"index_patterns,omitempty"`
	Dls            string   `json:"dls,omitempty"`
	Fls            []string `json:"fls,omitempty"`
	MaskedFields   []string `json:"masked_fields,omitempty"`
	AllowedActions []string `json:"allowed_actions,omitempty"`
}

type Role

type Role struct {
	Name        string
	IsStatic    bool   `json:"static"`
	IsReserved  bool   `json:"reserved"`
	IsHidden    bool   `json:"hidden"`
	Description string `json:"description"`
	RolePermissions
}

type RoleMapping

type RoleMapping struct {
	Name        string
	IsReserved  bool   `json:"reserved"`
	IsHidden    bool   `json:"hidden"`
	Description string `json:"description"`
	RoleMappingRelations
}

type RoleMappingRelations

type RoleMappingRelations struct {
	BackendRoles []string `json:"backend_roles,omitempty"`
	Hosts        []string `json:"hosts,omitempty"`
	Users        []string `json:"users,omitempty"`
}

type RolePermissions

type RolePermissions struct {
	ClusterPermissions []string             `json:"cluster_permissions,omitempty"`
	IndexPermissions   *[]IndexPermissions  `json:"index_permissions,omitempty"`
	TenantPermissions  *[]TenantPermissions `json:"tenant_permissions,omitempty"`
}

type RoleServiceInterface

type RoleServiceInterface interface {
	Get(ctx context.Context, name string) (*Role, error)
	List(ctx context.Context) ([]*Role, error)
	Create(ctx context.Context, name string, rolePermissions *RolePermissions) error
	common.Modifyable
}

type RolesmappingServiceInterface

type RolesmappingServiceInterface interface {
	Get(ctx context.Context, name string) (*RoleMapping, error)
	List(ctx context.Context) (*[]RoleMapping, error)
	Create(ctx context.Context, name string, roleMappingRelations *RoleMappingRelations) error
	common.Modifyable
}

type Tenant

type Tenant struct {
	Name        string `json:"name"`
	Reserved    bool   `json:"reserved"`
	Hidden      bool   `json:"hidden"`
	Description string `json:"description"`
	Static      bool   `json:"static"`
}

type TenantPermissions

type TenantPermissions struct {
	TenantPatterns []string `json:"tenant_patterns,omitempty"`
	AllowedActions []string `json:"allowed_actions,omitempty"`
}

type TenantServiceInterface

type TenantServiceInterface interface {
	Get(ctx context.Context, name string) (*Tenant, error)
	List(ctx context.Context) (*[]Tenant, error)
	Create(ctx context.Context, name string) error
	common.Modifyable
}

type User

type User struct {
	Name         string
	Hash         string            `json:"hash"`
	Reserved     bool              `json:"reserved"`
	Hidden       bool              `json:"hidden"`
	BackendRoles []string          `json:"backend_roles"`
	Attributes   map[string]string `json:"attributes"`
	Description  string            `json:"description"`
	Static       bool              `json:"static"`
}

type UserCreate

type UserCreate struct {
	Password     string            `json:"password,omitempty"`
	BackendRoles []string          `json:"backend_roles,omitempty"`
	Roles        []string          `json:"opendistro_security_roles"`
	Attributes   map[string]string `json:"attributes,omitempty"`
}

type UserService

type UserService common.Service

func (*UserService) ChangePassword

func (s *UserService) ChangePassword(ctx context.Context, name string, newPassword string) error

ChangePassword applies the new password to the user provided by name

func (*UserService) Create

func (s *UserService) Create(ctx context.Context, name string, userCreate *UserCreate) error

Create or replace the specified user. Password can be submitted in plain text (password) or hashed (hash). If a plain text password is submitted, the Security Plugin will do the hashing.

see: https://opendistro.github.io/for-elasticsearch-docs/docs/security-access-control/api/#create-user

func (*UserService) Update

func (s *UserService) Update(ctx context.Context, name string, patches *[]common.Patch) error

Update a user by name and providing an update patch

see: https://opendistro.github.io/for-elasticsearch-docs/docs/security-access-control/api/#patch-user

func (*UserService) UpdateBatch

func (s *UserService) UpdateBatch(ctx context.Context, patches *[]common.Patch) error

Update multiple users at once

see: https://opendistro.github.io/for-elasticsearch-docs/docs/security-access-control/api/#patch-users

type UserServiceInterface

type UserServiceInterface interface {
	Get(ctx context.Context, name string) (*User, error)
	List(ctx context.Context) (*[]User, error)
	Create(ctx context.Context, name string, userCreate *UserCreate) error
	ChangePassword(ctx context.Context, name string, newPassword string) error
	common.Modifyable
}

Jump to

Keyboard shortcuts

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