salvo-middleware

Implement reusable authentication, logging, and CORS middleware for Salvo routers.

1|Updated Mar 16, 2024
One-click install
npx skills add https://github.com/tdcare/genies --skill salvo-middleware-tdcare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-middleware
Source: https://github.com/tdcare/genies/tree/main/.qoder/skills/salvo-middleware
Command: npx skills add https://github.com/tdcare/genies --skill salvo-middleware-tdcare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implement reusable middleware components for authentication, logging, CORS, and request processing to centrally handle cross-cutting concerns in Salvo applications.

Core Features & Use Cases

  • Authentication middleware for protecting routes and extracting user context
  • Request logging, timing, and observability across API endpoints
  • CORS handling and cross-origin request configuration
  • Request/response modification and flow control using FlowCtrl
  • Use Case: apply to a router to consistently enforce security, observability, and cross-origin rules across all API paths

Quick Start

Attach the middleware to your Salvo router using hoop() to apply authentication, logging, and CORS across API routes.

Frequently Asked Questions about salvo-middleware

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add authentication and CORS middleware to a Salvo web API?

To add authentication and CORS middleware to a Salvo web API, attach reusable middleware components to your router using the hoop() function. This consistently enforces cross-cutting concerns like security and cross-origin rules across all API paths.

What is FlowCtrl used for when processing requests in Rust Salvo applications?

FlowCtrl in Rust Salvo applications is used for request and response modification along with flow control. It manages how middleware components intercept and process incoming HTTP requests to ensure uniform cross-cutting behavior.

Can I apply logging and timing observability across specific routes in Salvo?

Yes, you can apply logging and timing observability across specific routes in Salvo. By composing route-wide middleware via hoop(), you uniformly track request processing times and log API endpoint activity.

Does Salvo middleware support uniform cross-cutting behavior for microservices?

Yes, Salvo middleware supports uniform cross-cutting behavior for microservices. It provides reusable components integrating with standard Salvo handlers to enforce authentication, logging, and CORS consistently across distributed web APIs.

What's the best way to centrally handle cross-cutting concerns in a Salvo app?

The best way to centrally handle cross-cutting concerns in a Salvo app is using reusable middleware components for authentication, logging, and CORS. Attach them to routers via hoop() to modify requests and responses globally.