authz

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(config AuthZConfig, logger *slog.Logger) (authzcore.PAP, authzcore.PDP, error)

Initialize creates and returns PAP and PDP implementations based on configuration. When authorization is disabled, it returns a passthrough implementation that allows all operations.

Types

type AuthZConfig

type AuthZConfig struct {
	Enabled                  bool   // Enable or disable authorization
	DatabasePath             string // Path to database
	DefaultAuthzDataFilePath string // Path to default authz data YAML file containing roles and mappings (optional)
	EnableCache              bool   // Enable authz caching
}

AuthZConfig holds configuration for authorization initialization

type DisabledAuthorizer

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

func NewDisabledAuthorizer

func NewDisabledAuthorizer(logger *slog.Logger) *DisabledAuthorizer

NewDisabledAuthorizer creates a new disabled authorization implementation

func (*DisabledAuthorizer) AddRole

func (da *DisabledAuthorizer) AddRole(ctx context.Context, role *authz.Role) error

AddRole fails with error

func (*DisabledAuthorizer) AddRoleEntitlementMapping

func (da *DisabledAuthorizer) AddRoleEntitlementMapping(ctx context.Context, mapping *authz.RoleEntitlementMapping) error

AddRoleEntitlementMapping fails with error

func (*DisabledAuthorizer) BatchEvaluate

BatchEvaluate always returns decisions allowing access for all requests

func (*DisabledAuthorizer) Evaluate

func (da *DisabledAuthorizer) Evaluate(ctx context.Context, request *authz.EvaluateRequest) (*authz.Decision, error)

Evaluate always returns a decision allowing access

func (*DisabledAuthorizer) ForceRemoveRole added in v0.9.0

func (da *DisabledAuthorizer) ForceRemoveRole(ctx context.Context, roleName string) error

ForceRemoveRole fails with error

func (*DisabledAuthorizer) GetRole

func (da *DisabledAuthorizer) GetRole(ctx context.Context, roleName string) (*authz.Role, error)

GetRole fails with error

func (*DisabledAuthorizer) GetSubjectProfile

func (da *DisabledAuthorizer) GetSubjectProfile(ctx context.Context, request *authz.ProfileRequest) (*authz.UserCapabilitiesResponse, error)

GetSubjectProfile returns a profile with all actions allowed

func (*DisabledAuthorizer) ListActions

func (da *DisabledAuthorizer) ListActions(ctx context.Context) ([]string, error)

ListActions fails with error

func (*DisabledAuthorizer) ListRoleEntitlementMappings

func (da *DisabledAuthorizer) ListRoleEntitlementMappings(ctx context.Context, filter *authz.RoleEntitlementMappingFilter) ([]*authz.RoleEntitlementMapping, error)

ListRoleEntitlementMappings fails with error

func (*DisabledAuthorizer) ListRoles

func (da *DisabledAuthorizer) ListRoles(ctx context.Context) ([]*authz.Role, error)

ListRoles fails with error

func (*DisabledAuthorizer) RemoveRole

func (da *DisabledAuthorizer) RemoveRole(ctx context.Context, roleName string) error

RemoveRole fails with error

func (*DisabledAuthorizer) RemoveRoleEntitlementMapping

func (da *DisabledAuthorizer) RemoveRoleEntitlementMapping(ctx context.Context, mappingID uint) error

RemoveRoleEntitlementMapping fails with error

func (*DisabledAuthorizer) UpdateRole added in v0.9.0

func (da *DisabledAuthorizer) UpdateRole(ctx context.Context, role *authz.Role) error

UpdateRole fails with error

func (*DisabledAuthorizer) UpdateRoleEntitlementMapping added in v0.9.0

func (da *DisabledAuthorizer) UpdateRoleEntitlementMapping(ctx context.Context, mapping *authz.RoleEntitlementMapping) error

UpdateRoleEntitlementMapping fails with error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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