authz

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package authz defines the authorization interface.

The framework provides only the interface and a function adapter. Concrete implementations (Casbin, OPA, custom logic) are provided by the application or optional sub-packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	// Authorize checks whether subject may perform action on object.
	Authorize(ctx context.Context, subject, object, action string) (bool, error)
}

Authorizer makes authorization decisions.

type AuthorizerFunc

type AuthorizerFunc func(ctx context.Context, subject, object, action string) (bool, error)

AuthorizerFunc adapts a plain function into an Authorizer.

func (AuthorizerFunc) Authorize

func (f AuthorizerFunc) Authorize(ctx context.Context, sub, obj, act string) (bool, error)

Authorize implements the Authorizer interface.

Jump to

Keyboard shortcuts

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