From aac06530fbb8dc5389a5041bf5984e59b0366402 Mon Sep 17 00:00:00 2001 From: Jazz Turner-Baggs <473256+jazzz@users.noreply.github.com> Date: Mon, 20 Jul 2026 17:29:34 -0700 Subject: [PATCH] Add AuthService trait --- core/conversations/src/service_traits.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/conversations/src/service_traits.rs b/core/conversations/src/service_traits.rs index dac2516..cbd4f29 100644 --- a/core/conversations/src/service_traits.rs +++ b/core/conversations/src/service_traits.rs @@ -9,6 +9,19 @@ use std::{ use crate::{ConversationId, types::AddressedEnvelope}; +/// An AuthVerifyService is responsible for verifying that a provided Credential is valid +/// for the given signer. Implementations must return AuthResult::Valid only if the two can +/// be cryptogrpahically bound together. +pub trait AuthVerifyService: Debug { + fn validate(&self, signer: &[u8], credential: &[u8]) -> AuthResult; +} + +pub enum AuthResult { + Valid, + Mismatch, + ProcessingError(String), +} + /// A Delivery service is responsible for payload transport. /// This interface allows Conversations to send payloads on the wire as well as /// register interest in delivery_addresses. Client implementations are responsible