user

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Anonymous = User{
	Type: pb.AuthenticationType_ANONYMOUS,
	Name: "anonymous",
}
View Source
var BootstrapToken = User{
	Type: pb.AuthenticationType_BOOTSTRAP_TOKEN,
	Name: "bootstrapToken",
}

Functions

func NewContext

func NewContext(ctx context.Context, u User) context.Context

NewContext creates a new context with user information attached.

Types

type User

type User struct {
	Type pb.AuthenticationType
	Name string
}

User contains the information of an authenticated user to kmgm HTTPS/gRPC server.

func ClientCert

func ClientCert(commonName string) User

func FromContext

func FromContext(ctx context.Context) User

FromContext returns the user information in ctx if it exists.

func (User) IsAllowedToGetCertificate added in v0.2.1

func (u User) IsAllowedToGetCertificate() bool

func (User) IsAllowedToIssueCertificate

func (u User) IsAllowedToIssueCertificate(profileName string) bool

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