authorization

package
v0.2.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanCapturedCompletionAuthority

func CanCapturedCompletionAuthority(ctx context.Context, snapshot model.CompletionAuthoritySnapshot) (bool, error)

CanCapturedCompletionAuthority evaluates database-captured permission facts with the same policy as Can. Callers must never supply request-owned facts.

Types

type Input

type Input struct {
	UserSlug          slug.Slug    // The user performing the action
	APIKeySlug        slug.Slug    // Optional API key service principal
	APIKeyRoleSlug    slug.Slug    // Optional API key role in the organization
	OrgSlug           *slug.Slug   // Optional: for organization-scoped authorization
	Action            model.Action // The action being performed
	Resource          fmt.Stringer // The typed resource, including consumer-owned resources
	ResourceOwnerSlug *slug.Slug   // Optional: for ownership checks
}

type Service

type Service interface {
	Can(ctx context.Context, input Input) (bool, error)
}

func New

func New(usersService userssvc.UsersService, rolesService rolessvc.Service) (Service, error)

func NewServiceWithLogging

func NewServiceWithLogging(base Service, logger *slog.Logger) Service

NewServiceWithLogging wraps base with method completion logging.

type ServiceWithLogging

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

ServiceWithLogging implements Service with method completion logging.

func (ServiceWithLogging) Can

func (_d ServiceWithLogging) Can(ctx context.Context, input Input) (b1 bool, err error)

Can implements Service.

Jump to

Keyboard shortcuts

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