Documentation
¶
Overview ¶
Package middleware contains the Fiber request orchestration and context installation used by the API packages.
Index ¶
- func AuthFailureStatus(ctx context.Context) int
- func ClassifyError(ctx context.Context, err error) errorapi.APIError
- func FiberErrorHandler(c fiber.Ctx, err error) error
- func HandleError(c fiber.Ctx, err error) error
- func LogError(c fiber.Ctx, err error, payload errorapi.APIError)
- func MissingGen3AuthHeader(ctx context.Context) bool
- func NewAPIError(ctx context.Context, code errorapi.ErrorCode, status int, msg string) errorapi.APIError
- func Reject(c fiber.Ctx, status int, msg string) error
- type AuthzMiddleware
- type Options
- type RequestIDMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthFailureStatus ¶
func ClassifyError ¶ added in v0.4.1
ClassifyError converts an application error into the public API error envelope. The original error remains available to the boundary logger and is never used as a response message for server failures.
func FiberErrorHandler ¶ added in v0.4.1
FiberErrorHandler converts errors returned through Fiber into the same API error contract used by explicit handler rejections.
func LogError ¶ added in v0.4.1
LogError records the original cause separately from its public API value.
func MissingGen3AuthHeader ¶
Types ¶
type AuthzMiddleware ¶
type AuthzMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthzMiddleware ¶
func NewAuthzMiddleware(logger *slog.Logger, options Options) *AuthzMiddleware
func (*AuthzMiddleware) FiberMiddleware ¶
func (m *AuthzMiddleware) FiberMiddleware() fiber.Handler
FiberMiddleware returns the request-wiring handler for access context and decisions.
type RequestIDMiddleware ¶
type RequestIDMiddleware struct {
// contains filtered or unexported fields
}
func NewRequestIDMiddleware ¶
func NewRequestIDMiddleware(logger *slog.Logger) *RequestIDMiddleware
func (*RequestIDMiddleware) FiberMiddleware ¶
func (m *RequestIDMiddleware) FiberMiddleware() fiber.Handler
Click to show internal directories.
Click to hide internal directories.