xapi

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ImpersonatingUserKeyName = "ImpersonatingUser"
View Source
const UserCtxKey = "x-user"

Variables

This section is empty.

Functions

func FromApi

func FromApi(ctx echo.Context) context.Context

FromApi returns a context.Context that wraps the echo.Context. The stored values in the echo.Context are accessible via the context.Context.

func ParseParamId

func ParseParamId(c echo.Context, name string) (ids.ID, error)

func RealUserFromContext

func RealUserFromContext(c echo.Context) (xuser.User, bool)

RealUserFromContext returns the real authenticated user. If user was impersonated, it returns the impersonating user. If not, the same user in context is returned.

func UserFromContext

func UserFromContext(c echo.Context) (user xuser.User, found bool)

UserFromContext returns the authenticated user from the context. If the user does not exist, or it is an invalid struct, found will be false.

func UserFromContextOrError

func UserFromContextOrError(c echo.Context) (user xuser.User, err error)

UserFromContextOrError returns the authenticated user from the context. If the user does not exist, or it is an invalid struct, returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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