Categorygithub.com/wisdom-oss/microservice-middlewares/v5

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

WISdoM Middlewares

microservice-middlewares v5

🚦Middlewares for microservices using Go as programming language

Breaking Changes compared to v4

  • The middlewares have been moved into their own packages

securiy

The middleware functions have been split into two separate ones. One for checking if a valid JWT is included in the request, One for checking the scope of access on a single method. If the second middleware is not used, access is granted as long as the user is authenticated in the system. This split has been done to allow unprotected routes for public access and a stricter control over other routes.

error

The error handler now uses a deferred function resulting in a lighter codebase when using the handler since the status channel is now not required anymore. Furthermore, the error handler now catches panics to allow a more in depth analysis if something goes wrong unexpectedly.

About

This repository contains middlewares that are used in many microservices to support common request flows like authentication and error handling.

Usage

Access Control

To use the access control-related middlewares, you can import the security package in the following way:

import (
 securityMiddleware "github.com/wisdom-oss/microservice-middlewares/v5/security"
)

Error Handling

To use the access control-related middlewares, you can import the errors package in the following way:

import (
 errorHandler "github.com/wisdom-oss/microservice-middlewares/v5/error"
)

Further documentation here