Thanks to visit codestin.com
Credit goes to pkg.go.dev

rolestore

package
v2.21.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDBRole

func ConvertDBRole(dbRole database.CustomRole) (rbac.Role, error)

ConvertDBRole should not be used by any human facing apis. It is used for authz purposes.

func CustomRoleCacheContext

func CustomRoleCacheContext(ctx context.Context) context.Context

CustomRoleCacheContext prevents needing to lookup custom roles within the same request lifecycle. Optimizing this to span requests should be done in the future.

func CustomRoleMW

func CustomRoleMW(next http.Handler) http.Handler

CustomRoleMW adds a custom role cache on the ctx to prevent duplicate db fetches.

func Expand

func Expand(ctx context.Context, db database.Store, names []rbac.RoleIdentifier) (rbac.Roles, error)

Expand will expand built in roles, and fetch custom roles from the database. If a custom role is defined, but does not exist, the role will be omitted on the response. This means deleted roles are silently dropped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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