values

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Embed

func Embed(ctx context.Context, user User) context.Context

Embed embeds a user into the current request context.

func RolesFromContext

func RolesFromContext(ctx context.Context) ([]string, bool)

func SubjectFromContext

func SubjectFromContext(ctx context.Context) (string, bool)

Types

type User

type User interface {
	RBACSubjectID() string
	RBACRoles() []string
}

User is an interface used to provide a subject ID and a slice of roles.

func FromContext

func FromContext(ctx context.Context) User

FromContext grabs a user from a context, if it has been set as a value.

Jump to

Keyboard shortcuts

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