crates/nornir-service/Cargo.toml
[package]
name = "nornir-service"
# 0.1.8: `pub use tonic;` (edda f012089) — nornir's wire-client speaks this
# crate's tonic, and the published 0.1.7 does not re-export it, so nornir's
# floor could not be raised to anything that exists. Release cascade 2026-08-23.
version = "0.1.14"
edition = "2021"
description = "Shared tonic gRPC service scaffold for the nordisk servers — the one bearer-auth interceptor (constant-time token compare) that nornir-server / dwarves-server / korp-server consume instead of hand-rolling three near-identical copies."
license = "MIT OR Apache-2.0"
repository = "https://git.gunnar.rs/nordisk/edda"
keywords = ["tonic", "grpc", "auth", "interceptor", "server"]
categories = ["development-tools", "network-programming"]
exclude = ["/.nornir/"]
[features]
default = []
# `tls` enables `serve_with_tls` (holger-server terminates TLS/mTLS on the tonic
# builder). Gated so the plaintext consumers (nornir/korp/dwarves) never link
# tonic's TLS stack.
tls = ["tonic/tls-ring"]
# `auth-provider` exposes the object-safe [`provider::AuthProvider`] trait +
# [`provider::Principal`] — the ONE shared seam the pluggable per-method auth
# sub-crates (nornir-auth-{bearer,oidc} in edda) implement so a server dispatches
# a bearer credential to whichever provider(s) its build pinned. Object-safe by
# design (async via `tonic::async_trait`) so a future wasmtime-loaded provider
# can slot in behind `dyn AuthProvider` without a server rebuild. Gated so the
# plaintext bearer-only consumers never pull the trait machinery.
auth-provider = []
# `grpc-web` enables `serve_with_tls_web` — the same TLS-aware tail with the
# gRPC-web protocol translation (tonic-web's `GrpcWebLayer`) and HTTP/1.1
# accept, so a browser console can call the gRPC services on the same port.
# Server-side middleware only (no HTTP client). Implies `tls` because its one
# consumer (holger-server) always terminates TLS on this builder.
grpc-web = ["tls", "dep:tonic-web"]
[dependencies]
tonic = { version = "0.14", default-features = false, features = ["router", "transport", "codegen"] }
tonic-web = { version = "0.14", optional = true }
constant_time_eq = "0.4"
[dev-dependencies]
# The `auth-provider` dispatch tests are async (the trait is async via
# `tonic::async_trait`); a minimal current-thread tokio drives them. Dev-only —
# the shipped crate carries no runtime.
tokio = { version = "1", features = ["macros", "rt"] }