holger-cli/src/generated/holger.doors.v1.rs
// @generated by `cargo xtask gen-proto` (protox + tonic-build, no protoc).
// DO NOT EDIT BY HAND. Regenerate after changing proto/holger.proto.
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AllowFirstImportRequest {
/// The bundle's vendor (its `supplier`).
#[prost(string, tag = "1")]
pub vendor: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub product: ::prost::alloc::string::String,
/// The sequence that establishes the floor.
#[prost(uint64, tag = "3")]
pub sequence: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AllowFirstImportReply {
#[prost(string, tag = "1")]
pub vendor: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub product: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub sequence: u64,
/// Who authorized it.
#[prost(string, tag = "4")]
pub by: ::prost::alloc::string::String,
/// Unix seconds.
#[prost(int64, tag = "5")]
pub at: i64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExportBundleRequest {
#[prost(string, tag = "1")]
pub bundle_id: ::prost::alloc::string::String,
/// Monotonic per (supplier, product): the secure side's anti-rollback floor.
#[prost(uint64, tag = "2")]
pub sequence: u64,
#[prost(string, tag = "3")]
pub supplier: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub product: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub release_version: ::prost::alloc::string::String,
/// 0 is the default of 30 days.
#[prost(uint32, tag = "6")]
pub expires_days: u32,
/// Only these artifacts (file name, name or `name@version`). Empty: every AVAILABLE
/// artifact in production.
#[prost(string, repeated, tag = "7")]
pub artifacts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExportBundleChunk {
/// The member these bytes belong to (relative to the candidate directory).
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub data: ::prost::alloc::vec::Vec<u8>,
/// Set on the last chunk only.
#[prost(message, optional, tag = "3")]
pub summary: ::core::option::Option<ExportBundleSummary>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExportBundleSummary {
#[prost(string, tag = "1")]
pub bundle_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub sequence: u64,
/// Computed from the stored evidence, never typed in.
#[prost(string, tag = "3")]
pub verdict: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub candidate_sha256: ::prost::alloc::string::String,
/// One line per exported artifact, as `holger export` prints it.
#[prost(string, repeated, tag = "5")]
pub artifacts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint32, tag = "6")]
pub members: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirstKeyRequest {
/// The name the first admin is enrolled under. Empty: theirs to choose at enrolment.
#[prost(string, tag = "1")]
pub display: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FirstKeyReply {
/// The invite secret: shown ONCE, never stored (only its hash is).
#[prost(string, tag = "1")]
pub invite: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub expires: i64,
/// The groups the redeemed key holds.
#[prost(string, repeated, tag = "4")]
pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Where to redeem it, relative to the console's origin (`/login?invite=<secret>`).
#[prost(string, tag = "5")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub words: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownstreamInviteRequest {
/// The enrolled downstream's name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// A direct invite's door (`http(s)://host:port`). Empty: the server's own sync door.
#[prost(string, tag = "2")]
pub door: ::prost::alloc::string::String,
/// A WireGuard invite's front key and endpoint. Empty: the front's own, as it offered them.
#[prost(string, tag = "3")]
pub hub_key: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub endpoint: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownstreamInviteReply {
/// The signed invite (JSON): the file the downstream's RON names in `sync.upstreams\[\].invite`.
#[prost(bytes = "vec", tag = "1")]
pub invite: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag = "2")]
pub schema: ::prost::alloc::string::String,
/// The door the downstream reaches this server at.
#[prost(string, tag = "3")]
pub door: ::prost::alloc::string::String,
/// A WireGuard downstream's address on the front's interface; empty for a direct one.
#[prost(string, tag = "4")]
pub address: ::prost::alloc::string::String,
/// This server's sync name and key: what the downstream's RON trusts.
#[prost(string, tag = "5")]
pub upstream: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub key: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod bundle_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct BundleServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl BundleServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> BundleServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> BundleServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
BundleServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// The candidate's members, in order: each member's bytes in one or more chunks that
/// name its path; the LAST chunk carries the summary and no data.
pub async fn export(
&mut self,
request: impl tonic::IntoRequest<super::ExportBundleRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ExportBundleChunk>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.doors.v1.BundleService/Export",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.doors.v1.BundleService", "Export"));
self.inner.server_streaming(req, path, codec).await
}
/// The admin's authorization of a FIRST import (lanes HOL-CDS, HOL-NCSC): this vendor,
/// product and sequence may set the anti-rollback floor once. Admin only, audited, used
/// once; the same act as `holger bundle allow-first-import` and
/// `POST /-/bundle/first-import`.
pub async fn allow_first_import(
&mut self,
request: impl tonic::IntoRequest<super::AllowFirstImportRequest>,
) -> std::result::Result<
tonic::Response<super::AllowFirstImportReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.doors.v1.BundleService/AllowFirstImport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("holger.doors.v1.BundleService", "AllowFirstImport"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Generated client implementations.
pub mod first_key_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct FirstKeyServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl FirstKeyServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> FirstKeyServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> FirstKeyServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
FirstKeyServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// A single-use invite that enrols the first admin key. Refused once an admin key exists.
pub async fn invite(
&mut self,
request: impl tonic::IntoRequest<super::FirstKeyRequest>,
) -> std::result::Result<tonic::Response<super::FirstKeyReply>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.doors.v1.FirstKeyService/Invite",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.doors.v1.FirstKeyService", "Invite"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated client implementations.
pub mod downstream_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// `DownstreamService.Invite` (lane HOL-PRODUCTS-7, 2026-10-30): the signed invite a
/// downstream of this server is handed (`holger-cli downstream invite`, the console's
/// Invite button). A `via: Front` downstream gets a direct invite (schema v1: the server's
/// sync door, no tunnel); a `via: Wireguard` one gets the estate's (schema v2, the link's
/// pre-shared key inside the signed bytes, the front's interface). Signed with the server's
/// sync key, for the downstream's key; admin only, audited.
#[derive(Debug, Clone)]
pub struct DownstreamServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DownstreamServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DownstreamServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DownstreamServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DownstreamServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn invite(
&mut self,
request: impl tonic::IntoRequest<super::DownstreamInviteRequest>,
) -> std::result::Result<
tonic::Response<super::DownstreamInviteReply>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/holger.doors.v1.DownstreamService/Invite",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("holger.doors.v1.DownstreamService", "Invite"));
self.inner.unary(req, path, codec).await
}
}
}