server: go.chromium.org/goma/server/auth/enduser Index | Files

package enduser

import "go.chromium.org/goma/server/auth/enduser"

Package enduser manages end user information with context.

Index

Package Files

enduser.go

func NewContext Uses

func NewContext(ctx context.Context, u *EndUser) context.Context

NewContext returns a new Context that carries value u in metadata.

type EmailString Uses

type EmailString string

EmailString holds email string. It will not output empty string in format. Don't use this type in unexported field. fmt won't invoke formatting method on unexported fields. see https://golang.org/pkg/fmt/.

func (EmailString) Formatter Uses

func (e EmailString) Formatter(fmt.State, rune)

func (EmailString) GoString Uses

func (e EmailString) GoString() string

func (EmailString) String Uses

func (e EmailString) String() string

type EndUser Uses

type EndUser struct {
    Email EmailString
    Group string
    // contains filtered or unexported fields
}

EndUser represents end user of httprpc calls.

func FromContext Uses

func FromContext(ctx context.Context) (*EndUser, bool)

FromContext returns the EndUser value stored in ctx, if any.

func New Uses

func New(email, group string, token *oauth2.Token) *EndUser

New creates new EndUser from email, group and oauth2 access token.

func (*EndUser) Token Uses

func (u *EndUser) Token() *oauth2.Token

Token returns end user's access token.

Package enduser imports 5 packages (graph) and is imported by 5 packages. Updated 2019-11-19. Refresh now. Tools for package owners.