auth

package
v0.0.0-...-43b2f59 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticatingInterceptor

func AuthenticatingInterceptor(a Authenticator) grpc_auth.AuthFunc

func WithUser

WithUser adds authenticated user into to ctx.

Types

type AuthenticatedUser

type AuthenticatedUser interface {
	DBKey() string
	DisplayName() string
	ProfileURL() string
}

func AuthInfoFromContext

func AuthInfoFromContext(ctx context.Context) AuthenticatedUser

AuthInfoFromContext extracts authenticated user info from the ctx.

type Authenticator

type Authenticator interface {
	Authenticate(rpcCtx context.Context) (AuthenticatedUser, error)
}

type MockAuthenticator

type MockAuthenticator struct {
	F func(context.Context) (AuthenticatedUser, error)
}

func (MockAuthenticator) Authenticate

func (m MockAuthenticator) Authenticate(ctx context.Context) (AuthenticatedUser, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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