fix(server::peers::operator::auth): make ChallengeContext pub for smlang state machine

smlang generates a public state enum whose variants contain ChallengeContext,
requiring the type itself to be fully public. Also tightens the wildcard arm
in client auth to an exhaustive match.
This commit is contained in:
CleverWild
2026-06-12 19:42:37 +02:00
parent 9dbb18ae82
commit d1b96c8409
2 changed files with 10 additions and 12 deletions

View File

@@ -298,7 +298,7 @@ where
let signature = expect_message(transport, |req: Inbound| match req { let signature = expect_message(transport, |req: Inbound| match req {
Inbound::AuthChallengeSolution { signature } => Some(signature), Inbound::AuthChallengeSolution { signature } => Some(signature),
_ => None, Inbound::AuthChallengeRequest { .. } => None,
}) })
.await .await
.map_err(|e| { .map_err(|e| {

View File

@@ -14,19 +14,19 @@ use diesel::{ExpressionMethods as _, OptionalExtension as _, QueryDsl};
use diesel_async::RunQueryDsl; use diesel_async::RunQueryDsl;
use tracing::error; use tracing::error;
pub(super) struct ChallengeRequest { pub(crate) struct ChallengeRequest {
pub(super) pubkey: authn::PublicKey, pub(crate) pubkey: authn::PublicKey,
pub(super) bootstrap_token: Option<String>, pub(crate) bootstrap_token: Option<String>,
} }
pub(super) struct ChallengeContext { pub struct ChallengeContext {
pub(super) challenge: AuthChallenge, pub challenge: AuthChallenge,
pub(super) pubkey: authn::PublicKey, pub pubkey: authn::PublicKey,
pub(super) bootstrap_token: Option<String>, pub bootstrap_token: Option<String>,
} }
pub(super) struct ChallengeSolution { pub(crate) struct ChallengeSolution {
pub(super) solution: Vec<u8>, pub(crate) solution: Vec<u8>,
} }
smlang::statemachine!( smlang::statemachine!(
@@ -127,8 +127,6 @@ where
}) })
} }
#[allow(missing_docs)]
#[allow(clippy::unused_unit)]
async fn verify_solution( async fn verify_solution(
&mut self, &mut self,
ChallengeContext { ChallengeContext {