user

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const AuthenticatedGroup = "mesh-system:authenticated"

Variables

View Source
var Admin = User{
	Name:   "mesh-system:admin",
	Groups: []string{"mesh-system:admin"},
}

Admin is a static user that can be used when authn mechanism does not authenticate to specific user, but authenticate to admin without giving credential (ex. authenticate as localhost, authenticate via legacy client certs).

View Source
var Anonymous = User{
	Name:   "mesh-system:anonymous",
	Groups: []string{"mesh-system:unauthenticated"},
}

Functions

func Ctx

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

Types

type User

type User struct {
	Name   string
	Groups []string
}

func FromCtx

func FromCtx(ctx context.Context) User

func (User) Authenticated

func (u User) Authenticated() User

func (User) String

func (u User) String() string

Jump to

Keyboard shortcuts

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