Documentation ¶
Overview ¶
Package mid provides app level middleware support.
Index ¶
- Variables
- func Authenticate(client *authclient.Client) web.MidFunc
- func Authorize(client *authclient.Client, rule string) web.MidFunc
- func AuthorizeScrum(client *authclient.Client, scrumBus *scrumbus.Business) web.MidFunc
- func AuthorizeUser(client *authclient.Client, userBus *userbus.Business, rule string) web.MidFunc
- func Basic(ath *auth.Auth, userBus *userbus.Business) web.MidFunc
- func Bearer(ath *auth.Auth) web.MidFunc
- func BeginCommitRollback(log *logger.Logger, bgn sqldb.Beginner) web.MidFunc
- func Errors(log *logger.Logger) web.MidFunc
- func GetClaims(ctx context.Context) auth.Claims
- func GetScrum(ctx context.Context) (scrumbus.Scrum, error)
- func GetTran(ctx context.Context) (sqldb.CommitRollbacker, error)
- func GetUser(ctx context.Context) (userbus.User, error)
- func GetUserID(ctx context.Context) (uuid.UUID, error)
- func Logger(log *logger.Logger) web.MidFunc
- func Metrics() web.MidFunc
- func Otel(tracer trace.Tracer) web.MidFunc
- func Panics() web.MidFunc
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidID = errors.New("ID is not in its proper form")
ErrInvalidID represents a condition where the id is not a uuid.
Functions ¶
func Authenticate ¶
func Authenticate(client *authclient.Client) web.MidFunc
func Authorize ¶
func Authorize(client *authclient.Client, rule string) web.MidFunc
Authorize validates authorization via the auth service.
func AuthorizeScrum ¶
AuthorizeScrum executes the specified role and extracts the specified scrum from the DB if a scrum 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 scrum.
func AuthorizeUser ¶
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 BeginCommitRollback ¶
BeginCommitRollback starts a transaction for the domain call.
func GetTran ¶
func GetTran(ctx context.Context) (sqldb.CommitRollbacker, error)
GetTran retrieves the value that can manage a transaction.
Types ¶
This section is empty.