guard

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guard

type Guard interface {
	CreatePolicy(pol ladon.Policy) error
	DeletePolicy(pol ladon.Policy) error
	GetPolicy(id string) (ladon.Policy, error)
	GetPolicies() (ladon.Policies, error)
	GetPoliciesBySubject(subject string) (ladon.Policies, error)
	IsAllowed(request *ladon.Request) error
	UpdatePolicy(pol ladon.Policy) error
}

type LadonGuard

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

func NewGuard

func NewGuard(config cfg.Config, logger log.Logger) (*LadonGuard, error)

func NewGuardWithInterfaces

func NewGuardWithInterfaces(manager Manager) *LadonGuard

func (LadonGuard) CreatePolicy

func (g LadonGuard) CreatePolicy(pol ladon.Policy) error

func (LadonGuard) DeletePolicy

func (g LadonGuard) DeletePolicy(pol ladon.Policy) error

func (LadonGuard) GetPolicies

func (g LadonGuard) GetPolicies() (ladon.Policies, error)

func (LadonGuard) GetPoliciesBySubject

func (g LadonGuard) GetPoliciesBySubject(subject string) (ladon.Policies, error)

func (LadonGuard) GetPolicy

func (g LadonGuard) GetPolicy(id string) (ladon.Policy, error)

func (LadonGuard) IsAllowed

func (g LadonGuard) IsAllowed(request *ladon.Request) error

func (LadonGuard) UpdatePolicy

func (g LadonGuard) UpdatePolicy(pol ladon.Policy) error

type Manager

type Manager interface {
	ladon.Manager
}

type SqlManager

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

func NewSqlManager

func NewSqlManager(config cfg.Config, logger log.Logger) (*SqlManager, error)

func NewSqlManagerWithInterfaces

func NewSqlManagerWithInterfaces(logger log.Logger, dbClient db.Client) *SqlManager

func (SqlManager) Create

func (m SqlManager) Create(pol ladon.Policy) error

func (SqlManager) Delete

func (m SqlManager) Delete(id string) error

func (SqlManager) FindPoliciesForResource

func (m SqlManager) FindPoliciesForResource(resource string) (ladon.Policies, error)

func (SqlManager) FindPoliciesForSubject

func (m SqlManager) FindPoliciesForSubject(subject string) (ladon.Policies, error)

func (SqlManager) FindRequestCandidates

func (m SqlManager) FindRequestCandidates(r *ladon.Request) (ladon.Policies, error)

func (SqlManager) Get

func (m SqlManager) Get(id string) (ladon.Policy, error)

func (SqlManager) GetAll

func (m SqlManager) GetAll(limit, offset int64) (ladon.Policies, error)

func (SqlManager) Update

func (m SqlManager) Update(pol ladon.Policy) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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