Crate prima_bridge

source ·
Expand description

This crate gives an high level API to execute external HTTP requests.

It is supposed to give the basics building blocks for building bridges to other services while abstracting the low level stuff like adding custom headers and request tracing.

It supports both REST and GraphQL requests.

You should start by creating a Bridge instance. This instance should live for all the application lifetime.

Do not create a new bridge on every request!

You should use something like once_cell or lazy_static, or some sort of inversion of control container to pass around.

The bridge implement a type state pattern to build the external request.

§Features

  • auth0 - enable auth0 integration, allowing bridge.rs to retrieve tokens from auth0 for authentication

  • gzip - provides response body gzip decompression.

  • redis-tls - add support for connecting to redis with tls

  • tracing-opentelemetry adds support for integration with opentelemetry. This feature is an alias for the tracing_opentelemetry_0_21 feature. tracing_opentelemetry_0_20 is also available as to support the 0.20 opentelemetry libraries.

    We are going to support at least the last 3 versions of opentelemetry. After that we mightremove support for older otel version without it being a breaking change.

Modules§

  • auth0auth0
    Stuff used to provide JWT authentication via Auth0

Structs§

Enums§

Traits§

Type Aliases§