auth

package
v0.0.0-...-36a2cef Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: BSD-2-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// if we expect that the user of the function may be interested with concrete error,
	// it's a good idea to provide variable with this error
	NoUserInContextError = commonerrors.NewAuthorizationError("no user in context", "no-user-found")
)

Functions

func HttpMockMiddleware

func HttpMockMiddleware(next http.Handler) http.Handler

HttpMockMiddleware is used in the local environment (which doesn't depend on Firebase)

Types

type FirebaseHttpMiddleware

type FirebaseHttpMiddleware struct {
	AuthClient *auth.Client
}

func (FirebaseHttpMiddleware) Middleware

func (a FirebaseHttpMiddleware) Middleware(next http.Handler) http.Handler

type User

type User struct {
	UUID  string
	Email string
	Role  string

	DisplayName string
}

func UserFromCtx

func UserFromCtx(ctx context.Context) (User, error)

Jump to

Keyboard shortcuts

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