use crate::kafka::protocol_aware::KafkaEncryptedContent;
use minicbor::{CborLen, Decode, Encode};
use ockam_core::{async_trait, Address};
use ockam_multiaddr::MultiAddr;
use ockam_node::Context;
pub(crate) mod controller;
mod secure_channels;
#[derive(Debug, Clone, Encode, Decode, CborLen)]
#[rustfmt::skip]
#[cbor(map)]
pub enum ConsumerResolution {
#[n(1)] None,
#[n(2)] SingleNode(#[n(1)] MultiAddr),
#[n(3)] ViaRelay(#[n(1)] MultiAddr),
}
#[derive(Debug, Clone, Encode, Decode, CborLen)]
#[rustfmt::skip]
#[cbor(map)]
pub enum ConsumerPublishing {
#[n(1)] None,
#[n(2)] Relay(#[n(1)] MultiAddr),
}
type TopicPartition = (String, i32);
#[async_trait]
pub(crate) trait KafkaKeyExchangeController: Send + Sync + 'static {
async fn encrypt_content(
&self,
context: &mut Context,
topic_name: &str,
partition_index: i32,
content: Vec<u8>,
) -> ockam_core::Result<KafkaEncryptedContent>;
async fn decrypt_content(
&self,
context: &mut Context,
consumer_decryptor_address: &Address,
encrypted_content: Vec<u8>,
) -> ockam_core::Result<Vec<u8>>;
async fn publish_consumer(
&self,
context: &mut Context,
topic_name: &str,
partitions: Vec<i32>,
) -> ockam_core::Result<()>;
}