core-usage

Standardize HTTP responses, error handling, and Keycloak JWT validation in Rust handlers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

genies_core provides a cohesive toolkit for building reliable HTTP handlers by standardizing response shapes, error handling, and authentication flow in Genies-based services.

Core Features & Use Cases

  • RespVO<T> and ResultDTO<T> offer complementary response models for different consumer needs.
  • Salvo integration allows handler results to be returned directly as typed responses.
  • JWT authentication utilities (get_keycloak_keys, verify_with_keycloak) simplify token validation against Keycloak.
  • Centralized error handling with a shared Error type and Result alias to streamline failure paths.
  • Condition evaluation utilities enable runtime decision logic and policy enforcement.

Quick Start

Integrate genies_core into your Rust HTTP handlers to standardize responses, error handling, and JWT authentication.

Frequently Asked Questions about core-usage

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

FAQPage Schema
How do I standardize HTTP response shapes across Rust microservices?▼

Standardizing HTTP response shapes across Rust microservices is achieved by using unified RespVO<T> and ResultDTO<T> models to ensure consistent JSON structures for all service consumers.

How do I validate Keycloak JWT tokens in Rust HTTP handlers?▼

Validating Keycloak JWT tokens in Rust HTTP handlers is done using get_keycloak_keys and verify_with_keycloak utilities, which require proper configuration of JWT keys to authenticate requests.

What is the best way to centralize error handling in Rust HTTP services?▼

Centralizing error handling in Rust HTTP services is best handled by using a shared Error type and Result alias to streamline failure paths and simplify error workflows across microservices.

Can I return typed HTTP responses directly using Salvo in Rust?▼

Returning typed HTTP responses directly using Salvo in Rust is supported through Salvo integration, allowing handler results to be returned directly as typed responses without manual serialization.

Do I need to manually fetch Keycloak keys for JWT authentication in Rust?▼

Fetching Keycloak keys for JWT authentication in Rust does not need to be manual, as the get_keycloak_keys utility automatically retrieves and configures the keys required for token validation.

How do I evaluate JSON conditions for runtime policy enforcement in Rust?▼

Evaluating JSON conditions for runtime policy enforcement in Rust is handled by condition evaluation utilities that enable runtime decision logic and policy enforcement within HTTP handlers.