{"repo":"teimuraz/tonic-middleware","free":true,"listed":false,"github":"https://github.com/teimuraz/tonic-middleware","clone":"git clone https://github.com/teimuraz/tonic-middleware.git","description":"Async middleware and interceptor for Tonic gRPC services","language":"Rust","stars":76,"topics":["grpc","interceptor","middleware","rust","tonic","async","authentication","auth"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"tonic-middleware Table of Contents - Introduction - Tonic versions compatability - Usage - Define request interceptor and middleware - Apply request interceptor to individual service - Apply request interceptor to all services using layer - Apply middleware to individual services - Apply middleware to all services through layer - Combine interceptor and middleware for individual services - Apply interceptor and middleware to all services through layer - Full example or check integration tests - Motivation Introduction tonic-middleware is a Rust library that extends tonic-based gRPC services, enabling asynchronous inspection and modification and potentially rejecting of incoming requests. It also enables the addition of custom logic through middleware, both before and after the actual service call. The library provides two key tools: - Request Interceptor The RequestInterceptor trait is designed to enable the interception and processing of incoming requests within your service pipeline. This trait is particularly useful for performing operations such as authentication, enriching requests with additional metadata, or rejecting requests based on certain criteria before they reach the service logic. - Middleware If your requirements extend beyond request interception, and you need to interact with both the request and response or to perform actions after the service call has been made, you should consider implementing Middleware . Both interceptors and middlewares can be applied ","default_branch":null,"files":null,"tree":[],"storefront":"/r/teimuraz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/teimuraz/tonic-middleware/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}