guard

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLogger added in v0.8.4

type AuditLogger interface {
	ladon.AuditLogger
}

func NewAuditLogger added in v0.8.4

func NewAuditLogger(config cfg.Config, logger log.Logger) AuditLogger

type Guard

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

type LadonGuard

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

func NewGuard

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

func NewGuardWithInterfaces

func NewGuardWithInterfaces(manager Manager, logger AuditLogger) *LadonGuard

func (LadonGuard) CreatePolicy

func (g LadonGuard) CreatePolicy(ctx context.Context, pol ladon.Policy) error

func (LadonGuard) DeletePolicy

func (g LadonGuard) DeletePolicy(ctx context.Context, pol ladon.Policy) error

func (LadonGuard) GetPolicies

func (g LadonGuard) GetPolicies(ctx context.Context) (ladon.Policies, error)

func (LadonGuard) GetPoliciesBySubject

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

func (LadonGuard) GetPolicy

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

func (LadonGuard) IsAllowed

func (g LadonGuard) IsAllowed(ctx context.Context, request *ladon.Request) error

func (LadonGuard) UpdatePolicy

func (g LadonGuard) UpdatePolicy(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, pol ladon.Policy) error

func (SqlManager) Delete

func (m SqlManager) Delete(ctx context.Context, id string) error

func (SqlManager) FindPoliciesForResource

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

func (SqlManager) FindPoliciesForSubject

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

func (SqlManager) FindRequestCandidates

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

func (SqlManager) Get

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

func (SqlManager) GetAll

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

func (SqlManager) Update

func (m SqlManager) Update(ctx context.Context, 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