wardenerr

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package wardenerr holds shared sentinel errors used across warden subpackages. It exists as a leaf package so that low-level packages (e.g. store/memory) can return typed errors without importing the root warden package, which would create an import cycle in tests.

The root warden package re-exports these as aliases (warden.ErrXX), so callers should prefer the warden.* names. Subpackages that implement store interfaces import wardenerr directly.

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExists = errors.New("warden: already exists")

ErrAlreadyExists is the common base error for entity-uniqueness violations. Use errors.Is(err, ErrAlreadyExists) to match any of the specialized ErrDuplicate* errors below.

View Source
var ErrAssignmentNotFound = fmt.Errorf("warden: assignment not found: %w", ErrNotFound)

ErrAssignmentNotFound is returned when an assignment cannot be found in the tenant.

View Source
var ErrCheckLogNotFound = fmt.Errorf("warden: check log not found: %w", ErrNotFound)

ErrCheckLogNotFound is returned when a check log entry cannot be found in the tenant.

View Source
var ErrCyclicRoleInheritance = errors.New("warden: cyclic role inheritance detected")

ErrCyclicRoleInheritance is returned when a role's parent would make the role its own ancestor.

View Source
var ErrDuplicateAssignment = fmt.Errorf("warden: role already assigned to subject: %w", ErrAlreadyExists)

ErrDuplicateAssignment is returned when a role is already assigned to a subject within the same scope. Wraps ErrAlreadyExists.

View Source
var ErrDuplicatePermission = fmt.Errorf("warden: permission already exists in this scope: %w", ErrAlreadyExists)

ErrDuplicatePermission is returned when a permission would violate the (tenant_id, namespace_path, name) uniqueness constraint.

View Source
var ErrDuplicatePolicy = fmt.Errorf("warden: policy already exists in this scope: %w", ErrAlreadyExists)

ErrDuplicatePolicy is returned when a policy would violate the (tenant_id, namespace_path, name) uniqueness constraint.

View Source
var ErrDuplicateRelation = fmt.Errorf("warden: relation tuple already exists: %w", ErrAlreadyExists)

ErrDuplicateRelation is returned when a relation tuple already exists. Wraps ErrAlreadyExists.

View Source
var ErrDuplicateResourceType = fmt.Errorf("warden: resource type already exists in this scope: %w", ErrAlreadyExists)

ErrDuplicateResourceType is returned when a resource type would violate the (tenant_id, namespace_path, name) uniqueness constraint.

View Source
var ErrDuplicateRole = fmt.Errorf("warden: role already exists in this scope: %w", ErrAlreadyExists)

ErrDuplicateRole is returned when a role would violate the (tenant_id, namespace_path, slug) uniqueness constraint.

View Source
var ErrNotFound = errors.New("warden: not found")

ErrNotFound is the common base for the missing-entity errors below. A by-ID lookup that carries the wrong tenant returns the same sentinel a genuinely missing row returns: a distinct "forbidden" error would confirm that the ID exists in some other tenant.

View Source
var ErrPermissionNotFound = fmt.Errorf("warden: permission not found: %w", ErrNotFound)

ErrPermissionNotFound is returned when a permission cannot be found in the tenant.

View Source
var ErrPolicyNotFound = fmt.Errorf("warden: policy not found: %w", ErrNotFound)

ErrPolicyNotFound is returned when a policy cannot be found in the tenant.

View Source
var ErrPolicyVersionConflict = fmt.Errorf("warden: policy changed since it was read: %w", ErrStaleWrite)

ErrPolicyVersionConflict is returned by UpdatePolicyIfVersion when the stored policy's version is not the one the caller expected.

View Source
var ErrRelationNotFound = fmt.Errorf("warden: relation not found: %w", ErrNotFound)

ErrRelationNotFound is returned when a relation tuple cannot be found in the tenant.

View Source
var ErrResourceTypeNotFound = fmt.Errorf("warden: resource type not found: %w", ErrNotFound)

ErrResourceTypeNotFound is returned when a resource type cannot be found in the tenant.

View Source
var ErrRoleNotFound = fmt.Errorf("warden: role not found: %w", ErrNotFound)

ErrRoleNotFound is returned when a role cannot be found in the tenant.

View Source
var ErrStaleWrite = errors.New("warden: changed since it was read")

ErrStaleWrite is returned when a conditional write finds the record changed since the caller read it.

View Source
var ErrSystemPermissionImmutable = errors.New("warden: system permission cannot be modified")

ErrSystemPermissionImmutable is returned when a write would change or delete a system permission.

View Source
var ErrSystemRoleImmutable = errors.New("warden: system role cannot be modified")

ErrSystemRoleImmutable is returned when a write would change or delete a system role.

View Source
var ErrTenantRequired = errors.New("warden: tenant is required")

ErrTenantRequired is returned when an operation needs a tenant ID and was given none. Check returns it when the resolved scope has no tenant and Config.RequireTenant is true; the tenant-scoped maintenance purges return it for an empty tenant rather than treating empty as every tenant.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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