Crate uxum

Crate uxum 

Source
Expand description

§UXUM

crates.io build status license documentation

An opinionated backend service framework based on axum.

§Project goals

  • Minimum boilerplate code.
  • Minimal performance impact from features not in use.
  • Metrics, tracing, OpenAPI and common service support features available out of the box.
  • Ready to be deployed on a local server, VM or container, or in the cloud.

§Project non-goals

  • Performance and feature parity with bare axum. Straight-up axum without all bells and whistles provided by this framework will always be a bit faster and more flexible.
  • Database access layers and connection pools. This is out of scope for this project.

§Supported crate features

  • grpc: support nesting Tonic GRPC services inside Axum server instance.
  • hash_argon2: support PHC user password hashes using Argon2 algorithm.
  • hash_pbkdf2: support PHC user password hashes using PBKDF2 and HMAC-SHA256/512 algorithm.
  • hash_scrypt: support PHC user password hashes using SCrypt algorithm.
  • hash_all: alias for hash_argon2 + hash_pbkdf2 + hash_scrypt.
  • jwt: support athentication via HTTP Bearer using JWT.
  • kafka: support writing logs to a Kafka topic.
  • systemd: enable systemd integration for service notifications and watchdog support (Linux only).

Modules§

crypto
A set of utility functions for working with crypto providers.
prelude
Commonly imported types for use in applications.
reexport
Centralized place to re-export dependency crates
state
State extractor support for method handlers.

Structs§

ApiDocBuilder
Builder for API documentation spec and UI.
AppBuilder
Builder for application routes.
AppConfig
Top-level application configuration.
AuthConfig
Authentication provider configuration.
AuthLayer
Authentication and authorization tower layer.
BasicAuthExtractor
Authentication extractor (front-end) for HTTP Basic authentication.
ConfigAuthProvider
Authentication provider (back-end) that uses users and roles stored in app configuration.
CorsConfig
CORS configuration for a handler.
Deadline
Cutoff time after which the request must be timed out.
Handle
Handle for starting and controlling the server.
HandlerBufferConfig
Configuration for request buffering queue layer.
HandlerConfig
Configuration of a single handler.
HandlerName
Static handler name.
HandlerRateLimitConfig
Configuration for rate-limiting layer.
HandlerTimeoutConfig
Handler request timeout configuration.
HeaderAuthExtractor
Authentication extractor (front-end) that gets user and password from HTTP headers.
Http1Config
HTTP/1 protocol configuration
Http2Config
HTTP/2 protocol configuration.
Http2KeepaliveConfig
HTTP/2 keep-alive configuration.
HttpClientConfig
HTTP client configuration.
IpConfig
IP-level configuration.
JwtAuthExtractor
Authentication extractor (front-end) for HTTP Bearer authentication using signed JWT.
KafkaLogAppender
Wrapper for Kafka producer for use in writing logs from tracing_subscriber::fmt.
KafkaProducerConfig
Kafka producer configuration.
LogProducerContext
Specialized producer context to use when writing logs to Kafka topics.
LoggingConfig
Logging configuration.
MetricsBuilder
Configuration and builder for metrics subsystem.
MetricsState
Metrics state tower layer.
NoOpAuthExtractor
Authentication extractor (front-end) which does nothing.
NoOpAuthProvider
Authentication provider (back-end) which does nothing.
ProbeConfig
Configuration for service probes and management mode API.
ProbeState
Shared state for probes and maintenance mode API.
ResponseExtension
Response layer for adding an extension.
ResponseSchema
Object for documenting handler responses as OpenAPI schema.
RoleConfig
Role configuration.
RuntimeConfig
Tokio runtime configuration.
ServerBuilder
Builder for HTTP server
ServiceConfig
Root container for app configuration.
ServiceConfigBuilder
Builder for service configuration.
ServiceNotifier
Interact with service supervisor.
SignalStream
Unified listener for all handled signals.
StackedAuthExtractor
Authentication extractor (front-end) which encapsulates several different extractors at once..
TcpConfig
TCP-level configuration.
TcpKeepaliveConfig
TCP keepalive configuration.
TracingConfig
OpenTelemetry tracing configuration.
UserConfig
User configuration.
UserId
User ID.
WatchdogConfig
Configuration for runtime watchdog.

Enums§

ApiDocError
Error type used in API doc objects.
AppBuilderError
Error type used in app builder.
AuthError
Error type used in authentication and authorization layer.
AuthSetupError
Error on setting up authentication framework.
AuthToken
Autoentication tokens to verify.
ExtractorConfig
Auth extractor (front-end) configuration.
HandleError
Error type returned by uxum handle.
HttpClientError
Error type used in HTTP client subsystem.
MetricsError
Error type used in metrics subsystem.
ProviderConfig
Auth provider (back-end) configuration.
RateLimitError
Error type returned by rate-limiting layer.
RuntimeError
Error type returned when building a runtime.
ServerBuilderError
Error type returned by server builder.
ServiceConfigError
Top-level service configuration error type.
SignalError
Signal handling error.
TimeoutError
Error type returned by timeout layer.
UserPassword
Various ways of storing client password.

Statics§

CURRENT_DEADLINE
Deadline of currently executing request, if any.
CURRENT_REQUEST_ID
Request ID of currently executing request, if any.

Traits§

AuthExtractor
Authentication extractor (front-end) trait.
AuthProvider
Authentication provider (back-end) trait.
GetResponseSchemas
Trait used to generate OpenAPI schemas from handler response types.
HandlerExt
Application API method handler object trait.

Attribute Macros§

handler
Attribute macro for declaring service endpoints.