authz

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRoleNotFound             = authzcore.ErrRoleNotFound
	ErrRoleAlreadyExists        = authzcore.ErrRoleAlreadyExists
	ErrRoleInUse                = authzcore.ErrRoleInUse
	ErrRoleBindingNotFound      = authzcore.ErrRoleMappingNotFound
	ErrRoleBindingAlreadyExists = authzcore.ErrRoleMappingAlreadyExists
)

Domain errors re-exported from authz core for service layer consistency.

Functions

This section is empty.

Types

type Service

type Service interface {
	// Cluster Roles
	CreateClusterRole(ctx context.Context, role *openchoreov1alpha1.ClusterAuthzRole) (*openchoreov1alpha1.ClusterAuthzRole, error)
	GetClusterRole(ctx context.Context, name string) (*openchoreov1alpha1.ClusterAuthzRole, error)
	ListClusterRoles(ctx context.Context, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.ClusterAuthzRole], error)
	UpdateClusterRole(ctx context.Context, role *openchoreov1alpha1.ClusterAuthzRole) (*openchoreov1alpha1.ClusterAuthzRole, error)
	DeleteClusterRole(ctx context.Context, name string) error

	// Namespace Roles
	CreateNamespaceRole(ctx context.Context, namespace string, role *openchoreov1alpha1.AuthzRole) (*openchoreov1alpha1.AuthzRole, error)
	GetNamespaceRole(ctx context.Context, namespace, name string) (*openchoreov1alpha1.AuthzRole, error)
	ListNamespaceRoles(ctx context.Context, namespace string, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.AuthzRole], error)
	UpdateNamespaceRole(ctx context.Context, namespace string, role *openchoreov1alpha1.AuthzRole) (*openchoreov1alpha1.AuthzRole, error)
	DeleteNamespaceRole(ctx context.Context, namespace, name string) error

	// Cluster Role Bindings
	CreateClusterRoleBinding(ctx context.Context, binding *openchoreov1alpha1.ClusterAuthzRoleBinding) (*openchoreov1alpha1.ClusterAuthzRoleBinding, error)
	GetClusterRoleBinding(ctx context.Context, name string) (*openchoreov1alpha1.ClusterAuthzRoleBinding, error)
	ListClusterRoleBindings(ctx context.Context, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.ClusterAuthzRoleBinding], error)
	UpdateClusterRoleBinding(ctx context.Context, binding *openchoreov1alpha1.ClusterAuthzRoleBinding) (*openchoreov1alpha1.ClusterAuthzRoleBinding, error)
	DeleteClusterRoleBinding(ctx context.Context, name string) error

	// Namespace Role Bindings
	CreateNamespaceRoleBinding(ctx context.Context, namespace string, binding *openchoreov1alpha1.AuthzRoleBinding) (*openchoreov1alpha1.AuthzRoleBinding, error)
	GetNamespaceRoleBinding(ctx context.Context, namespace, name string) (*openchoreov1alpha1.AuthzRoleBinding, error)
	ListNamespaceRoleBindings(ctx context.Context, namespace string, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.AuthzRoleBinding], error)
	UpdateNamespaceRoleBinding(ctx context.Context, namespace string, binding *openchoreov1alpha1.AuthzRoleBinding) (*openchoreov1alpha1.AuthzRoleBinding, error)
	DeleteNamespaceRoleBinding(ctx context.Context, namespace, name string) error

	// Evaluation & Profile
	Evaluate(ctx context.Context, requests []authzcore.EvaluateRequest) ([]authzcore.Decision, error)
	ListActions(ctx context.Context) ([]authzcore.Action, error)
	GetSubjectProfile(ctx context.Context, request *authzcore.ProfileRequest) (*authzcore.UserCapabilitiesResponse, error)
}

Service defines the authz service interface covering all 4 resource types. Both the core service (no authz) and the authz-wrapped service implement this.

func NewService

func NewService(pap authzcore.PAP, pdp authzcore.PDP, logger *slog.Logger) Service

NewService creates a new authz service without authorization checks.

func NewServiceWithAuthz

func NewServiceWithAuthz(pap authzcore.PAP, pdp authzcore.PDP, logger *slog.Logger) Service

NewServiceWithAuthz creates an authz service with authorization checks.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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