mid

package
v0.0.0-...-0d5229f Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package mid contains the set of values the middleware handlers for using the http protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(client *authclient.Client) web.MidFunc

Authenticate validates authentication via the auth service.

func Authorize

func Authorize(client *authclient.Client, rule string) web.MidFunc

Authorize validates authorization via the auth service.

func AuthorizeHome

func AuthorizeHome(client *authclient.Client, homeBus *homebus.Business) web.MidFunc

AuthorizeHome executes the specified role and extracts the specified home from the DB if a home id is specified in the call. Depending on the rule specified, the userid from the claims may be compared with the specified user id from the home.

func AuthorizeProduct

func AuthorizeProduct(client *authclient.Client, productBus *productbus.Business) web.MidFunc

AuthorizeProduct executes the specified role and extracts the specified product from the DB if a product id is specified in the call. Depending on the rule specified, the userid from the claims may be compared with the specified user id from the product.

func AuthorizeUser

func AuthorizeUser(client *authclient.Client, userBus *userbus.Business, rule string) web.MidFunc

AuthorizeUser executes the specified role and extracts the specified user from the DB if a user id is specified in the call. Depending on the rule specified, the userid from the claims may be compared with the specified user id.

func Basic

func Basic(userBus *userbus.Business, ath *auth.Auth) web.MidFunc

Basic processes basic authentication logic.

func Bearer

func Bearer(ath *auth.Auth) web.MidFunc

Bearer processes JWT authentication logic.

func BeginCommitRollback

func BeginCommitRollback(log *logger.Logger, bgn sqldb.Beginner) web.MidFunc

BeginCommitRollback executes the transaction middleware functionality.

func Errors

func Errors(log *logger.Logger) web.MidFunc

Errors executes the errors middleware functionality.

func Logger

func Logger(log *logger.Logger) web.MidFunc

Logger executes the logger middleware functionality.

func Metrics

func Metrics() web.MidFunc

Metrics updates program counters using the middleware functionality.

func Otel

func Otel(tracer trace.Tracer) web.MidFunc

Otel executes the otel middleware functionality.

func Panics

func Panics() web.MidFunc

Panics executes the panic middleware functionality.

Types

This section is empty.

Jump to

Keyboard shortcuts

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