acl

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	ActionAny        Action = "*"
	ActionProduce    Action = "produce"
	ActionFetch      Action = "fetch"
	ActionGroupRead  Action = "group_read"
	ActionGroupWrite Action = "group_write"
	ActionGroupAdmin Action = "group_admin"
	ActionAdmin      Action = "admin"
)

type Authorizer

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

func NewAuthorizer

func NewAuthorizer(cfg Config) *Authorizer

func (*Authorizer) Allows

func (a *Authorizer) Allows(principal string, action Action, resource Resource, name string) bool

func (*Authorizer) Enabled

func (a *Authorizer) Enabled() bool

type Config

type Config struct {
	Enabled       bool             `json:"enabled"`
	DefaultPolicy string           `json:"default_policy"`
	Principals    []PrincipalRules `json:"principals"`
}

type PrincipalRules

type PrincipalRules struct {
	Name  string `json:"name"`
	Allow []Rule `json:"allow"`
	Deny  []Rule `json:"deny"`
}

type Resource

type Resource string
const (
	ResourceAny     Resource = "*"
	ResourceTopic   Resource = "topic"
	ResourceGroup   Resource = "group"
	ResourceCluster Resource = "cluster"
)

type Rule

type Rule struct {
	Action   Action   `json:"action"`
	Resource Resource `json:"resource"`
	Name     string   `json:"name"`
}

Jump to

Keyboard shortcuts

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