ranger

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRangerClientConfigIsRequired         = errors.New("ranger client_config is required")
	ErrRangerParserConfigIsRequired         = errors.New("ranger parser_config is required")
	ErrRangerParserTypeIsRequired           = errors.New("ranger parser_config.type is required")
	ErrRangerParserDefaultCatalogIsRequired = errors.New("ranger parser_config.default_catalog is required")
	ErrRangerUnsupportedParserType          = errors.New("unsupported ranger parser_config.type. supported types: trino")
)

Functions

func New

func New() rbac.RBAC

Types

type Access

type Access struct {
	Type string `json:"type"`
}

type Client

type Client interface {
	GetUsers() (map[string]*User, error)
	GetPolicies(serviceName string) ([]*Policy, error)
}

func NewClient

func NewClient(url, username, password string) Client

type ControlledActions

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

type Group

type Group struct {
	ID          int64  `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	SyncSource  string `json:"syncSource,omitempty"`
}

type Policy

type Policy struct {
	ID                  int         `json:"id"`
	GUID                string      `json:"guid"`
	IsEnabled           bool        `json:"isEnabled"`
	Version             int         `json:"version"`
	Service             string      `json:"service"`
	Name                string      `json:"name"`
	PolicyType          int         `json:"policyType"`
	PolicyPriority      int         `json:"policyPriority"`
	Description         string      `json:"description"`
	IsAuditEnabled      bool        `json:"isAuditEnabled"`
	Resources           *Resource   `json:"resources"`
	AdditionalResources []*Resource `json:"additionalResources"`
	AllResources        []*Resource
	PolicyItems         []*PolicyItem `json:"policyItems"`
	DenyPolicyItems     []*PolicyItem `json:"denyPolicyItems"`
	AllowExceptions     []*PolicyItem `json:"allowExceptions"`
	DenyExceptions      []*PolicyItem `json:"denyExceptions"`
	ServiceType         string        `json:"serviceType"`
}

type PolicyItem

type PolicyItem struct {
	Accesses []*Access `json:"accesses"`
	Users    []string  `json:"users,omitempty"`
	Groups   []string  `json:"groups,omitempty"`
	Actions  []parser.Action
}

type Ranger

type Ranger struct {
	Name                  string `yaml:"name,omitempty" json:"name,omitempty"`
	ServiceName           string `yaml:"service_name,omitempty" json:"service_name,omitempty"`
	Client                Client
	SyncIntervalInMinutes int                   `yaml:"sync_interval_in_minutes,omitempty" json:"sync_interval_in_minutes,omitempty"`
	AccessReceiver        parser.AccessReceiver `yaml:"parser,omitempty" json:"parser,omitempty"`
	// contains filtered or unexported fields
}

func (*Ranger) GetName

func (r *Ranger) GetName() string

func (*Ranger) HasAccess

func (r *Ranger) HasAccess(user string, query string) (bool, error)

func (*Ranger) Init

func (r *Ranger) Init() error

func (*Ranger) SyncState

func (r *Ranger) SyncState() error

func (*Ranger) UnmarshalYAML

func (r *Ranger) UnmarshalYAML(value *yaml.Node) error

type Resource

type Resource struct {
	Schema  *ResourceField `json:"schema,omitempty"`
	Catalog *ResourceField `json:"catalog,omitempty"`
	Table   *ResourceField `json:"table,omitempty"`
	Column  *ResourceField `json:"column,omitempty"`
}

type ResourceField

type ResourceField struct {
	RawValues  []string `json:"values"`
	IsExcludes bool     `json:"isExcludes"`
	// contains filtered or unexported fields
}

func (*ResourceField) IsPrefixFor

func (rf *ResourceField) IsPrefixFor(s string) bool

type User

type User struct {
	ID            int64    `json:"id,omitempty"`
	Name          string   `json:"name,omitempty"`
	FirstName     string   `json:"firstName,omitempty"`
	LastName      string   `json:"lastName,omitempty"`
	EmailAddress  string   `json:"emailAddress,omitempty"`
	UserRoleList  []string `json:"userRoleList,omitempty"`
	Password      string   `json:"password,omitempty"`
	SyncSource    string   `json:"syncSource,omitempty"`
	GroupNameList []string `json:"groupNameList,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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