ctxutils

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientMetaData

func ClientMetaData(ctx *fiber.Ctx) *api.ClientMetaData

ClientMetaData returns the model.ClientMetaData for a given fiber.Ctx

func GetAuthHeaderToken

func GetAuthHeaderToken(ctx *fiber.Ctx) (token string)

GetAuthHeaderToken returns the Bearer token from the http authorization header

func GetGrantType

func GetGrantType(ctx *fiber.Ctx) (model.GrantType, error)

GetGrantType returns the model.GrantType for a fiber.Ctx by checking the query as well as the request body (json)

func GetGrantTypeStr

func GetGrantTypeStr(ctx *fiber.Ctx) (string, error)

GetGrantTypeStr returns the grant type string for a fiber.Ctx by checking the query as well as the request body (json)

func GetID added in v0.10.0

func GetID(ctx *fiber.Ctx) (uuid.UUID, error)

GetID returns the id for a fiber.Ctx by checking the url param, query as well as the request body (json)

func GetMytoken

func GetMytoken(ctx *fiber.Ctx) (*universalmytoken.UniversalMytoken, bool)

GetMytoken checks a fiber.Ctx for a mytoken and returns a token object

func GetMytokenStr

func GetMytokenStr(ctx *fiber.Ctx) string

GetMytokenStr checks a fiber.Ctx for a mytoken and returns the token string as passed to the request

func GetOIDCFlow

func GetOIDCFlow(ctx *fiber.Ctx) (model.OIDCFlow, error)

GetOIDCFlow returns the model.OIDCFlow for a fiber.Ctx by checking the query as well as the request body (json)

func GetOIDCFlowStr

func GetOIDCFlowStr(ctx *fiber.Ctx) (string, error)

GetOIDCFlowStr returns the oidc flow string for a fiber.Ctx by checking the query as well as the request body (json)

func Params added in v0.10.0

func Params(ctx *fiber.Ctx, key string, defaultValue ...string) string

Params is a wrapper around ctx.Params that also url decodes the value

func RenderErrorPage added in v0.10.0

func RenderErrorPage(ctx *fiber.Ctx, status int, errorMsg string, optionalErrorHeading ...string) error

RenderErrorPage renders an error page

func RenderExtendedErrorPage added in v0.10.0

func RenderExtendedErrorPage(
	ctx *fiber.Ctx, status int, errorMsg,
	optionalErrorHeading, additionalHTML string,
) error

RenderExtendedErrorPage renders an error page with additional html content

func RenderInternalServerErrorPage added in v0.10.0

func RenderInternalServerErrorPage(ctx *fiber.Ctx, err error) error

RenderInternalServerErrorPage renders an error page for a passed error as an internal server error

Types

This section is empty.

Jump to

Keyboard shortcuts

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