authz

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package authz maps external groups, and the Rauthy clients of calling applications, to application-defined roles and permissions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

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

Actor is a permission snapshot. Its zero value grants nothing.

func (Actor) Can

func (actor Actor) Can(permission string) bool

func (Actor) Permissions

func (actor Actor) Permissions() []string

func (Actor) Roles

func (actor Actor) Roles() []string

type Policy

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

Policy is immutable after construction and safe for concurrent use.

func New

func New(roles, groups, clients map[string][]string) (*Policy, error)

New validates and copies the application's role definitions, the external groups that grant them to people, and the Rauthy client IDs that grant them to calling applications. An application nobody calls passes nil clients.

func (*Policy) Resolve

func (policy *Policy) Resolve(groups []string, localRoles ...string) Actor

Resolve ignores unmapped groups. Identity.Roles are deliberately not trusted as application roles. Additional local role assignments must come from trusted code.

func (*Policy) ResolveClient added in v0.5.0

func (policy *Policy) ResolveClient(clientID string) Actor

ResolveClient returns what a calling application, named by its Rauthy client ID, may do. An unlisted client gets nothing.

Jump to

Keyboard shortcuts

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