authz_loader

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoadAuthzAllowList = errors.New("failed to load authz allow list for tenantID")
	ErrTenantNotExist     = errors.New("tenantID does not exist")
	ErrEmptyTenantID      = errors.New("tenantID cannot be empty")
)

Functions

This section is empty.

Types

type AuthzLoader

type AuthzLoader[TResourceTypeName, TAction comparable] struct {
	AuthzHandler *authz.Handler[TResourceTypeName, TAction]

	Auditor *auditor.Auditor
	// contains filtered or unexported fields
}

func NewAPIAuthzLoader

func NewAPIAuthzLoader(
	ctx context.Context,
	repo repo.Repo,
	config *config.Config,
) *AuthzLoader[authz.APIResourceTypeName, authz.APIAction]

func NewAuthzLoader

func NewAuthzLoader[TResourceTypeName, TAction comparable](
	ctx context.Context,
	repo repo.Repo,
	config *config.Config,
	rolePolicies map[constants.Role][]authz.BasePolicy[TResourceTypeName, TAction],
	resourceTypeActions map[TResourceTypeName][]TAction,
) *AuthzLoader[TResourceTypeName, TAction]

func (*AuthzLoader[TResourceTypeName, TAction]) LoadAllowList

func (am *AuthzLoader[TResourceTypeName, TAction]) LoadAllowList(
	ctx context.Context, tenantID string) error

func (*AuthzLoader[TResourceTypeName, TAction]) ReloadAllowList

func (am *AuthzLoader[TResourceTypeName, TAction]) ReloadAllowList(
	ctx context.Context) error

func (*AuthzLoader[TResourceTypeName, TAction]) StartAuthzDataRefresh

func (am *AuthzLoader[TResourceTypeName, TAction]) StartAuthzDataRefresh(
	ctx context.Context, interval time.Duration)

StartAuthzDataRefresh starts a background goroutine that refreshes the authorization data periodically

Jump to

Keyboard shortcuts

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