housekeeping(server): clean too-broad visibility markers and organize imports
This commit is contained in:
@@ -1,17 +1,4 @@
|
||||
use arbiter_crypto::authn::{self, AuthChallenge, CLIENT_CONTEXT};
|
||||
use arbiter_proto::{
|
||||
ClientMetadata,
|
||||
transport::{Bi, expect_message},
|
||||
};
|
||||
use chrono::Utc;
|
||||
use diesel::{
|
||||
ExpressionMethods as _, OptionalExtension as _, QueryDsl as _, SelectableHelper as _,
|
||||
dsl::insert_into, update,
|
||||
};
|
||||
use diesel_async::RunQueryDsl as _;
|
||||
use kameo::{actor::ActorRef, error::SendError};
|
||||
use tracing::error;
|
||||
|
||||
use super::{ClientConnection, ClientCredentials, ClientProfile};
|
||||
use crate::{
|
||||
actors::{
|
||||
GlobalActors,
|
||||
@@ -25,8 +12,20 @@ use crate::{
|
||||
schema::program_client,
|
||||
},
|
||||
};
|
||||
use arbiter_crypto::authn::{self, AuthChallenge, CLIENT_CONTEXT};
|
||||
use arbiter_proto::{
|
||||
ClientMetadata,
|
||||
transport::{Bi, expect_message},
|
||||
};
|
||||
|
||||
use super::{ClientConnection, ClientCredentials, ClientProfile};
|
||||
use chrono::Utc;
|
||||
use diesel::{
|
||||
ExpressionMethods as _, OptionalExtension as _, QueryDsl as _, SelectableHelper as _,
|
||||
dsl::insert_into, update,
|
||||
};
|
||||
use diesel_async::RunQueryDsl as _;
|
||||
use kameo::{actor::ActorRef, error::SendError};
|
||||
use tracing::error;
|
||||
|
||||
#[derive(thiserror::Error, Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Error {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use arbiter_crypto::authn;
|
||||
use arbiter_macros::Hashable;
|
||||
use arbiter_proto::{ClientMetadata, transport::Bi};
|
||||
use kameo::actor::Spawn;
|
||||
use tracing::{error, info};
|
||||
|
||||
use crate::{
|
||||
actors::GlobalActors, crypto::integrity::Integrable, db, peers::client::session::ClientSession,
|
||||
};
|
||||
use arbiter_crypto::authn;
|
||||
use arbiter_macros::Hashable;
|
||||
use arbiter_proto::{ClientMetadata, transport::Bi};
|
||||
|
||||
use kameo::actor::Spawn;
|
||||
use tracing::{error, info};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ClientProfile {
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
use kameo::{Actor, messages};
|
||||
use tracing::error;
|
||||
|
||||
use alloy::{consensus::TxEip1559, primitives::Address, signers::Signature};
|
||||
|
||||
use super::ClientConnection;
|
||||
use crate::{
|
||||
actors::{
|
||||
GlobalActors,
|
||||
@@ -14,7 +10,9 @@ use crate::{
|
||||
evm::VetError,
|
||||
};
|
||||
|
||||
use super::ClientConnection;
|
||||
use alloy::{consensus::TxEip1559, primitives::Address, signers::Signature};
|
||||
use kameo::{Actor, messages};
|
||||
use tracing::error;
|
||||
|
||||
pub struct ClientSession {
|
||||
props: ClientConnection,
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
use super::{Credentials, UserAgentConnection};
|
||||
use arbiter_crypto::authn::{self, AuthChallenge};
|
||||
use arbiter_proto::transport::Bi;
|
||||
|
||||
use state::*;
|
||||
use tracing::error;
|
||||
|
||||
mod state;
|
||||
use state::*;
|
||||
|
||||
use super::Credentials;
|
||||
use super::UserAgentConnection;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Inbound {
|
||||
|
||||
@@ -1,30 +1,32 @@
|
||||
use super::super::{Credentials, UserAgentConnection};
|
||||
use arbiter_crypto::authn::{self, AuthChallenge, USERAGENT_CONTEXT};
|
||||
use arbiter_proto::transport::Bi;
|
||||
use diesel::{ExpressionMethods as _, OptionalExtension as _, QueryDsl};
|
||||
use diesel_async::RunQueryDsl;
|
||||
use tracing::error;
|
||||
|
||||
use super::Error;
|
||||
use super::{
|
||||
super::{Credentials, UserAgentConnection},
|
||||
Error,
|
||||
};
|
||||
use crate::{
|
||||
actors::bootstrap::ConsumeToken,
|
||||
db::{DatabasePool, schema::useragent_client},
|
||||
peers::user_agent::auth::Outbound,
|
||||
};
|
||||
use arbiter_crypto::authn::{self, AuthChallenge, USERAGENT_CONTEXT};
|
||||
use arbiter_proto::transport::Bi;
|
||||
|
||||
pub struct ChallengeRequest {
|
||||
pub pubkey: authn::PublicKey,
|
||||
pub bootstrap_token: Option<String>,
|
||||
use diesel::{ExpressionMethods as _, OptionalExtension as _, QueryDsl};
|
||||
use diesel_async::RunQueryDsl;
|
||||
use tracing::error;
|
||||
|
||||
pub(super) struct ChallengeRequest {
|
||||
pub(super) pubkey: authn::PublicKey,
|
||||
pub(super) bootstrap_token: Option<String>,
|
||||
}
|
||||
|
||||
pub struct ChallengeContext {
|
||||
pub challenge: AuthChallenge,
|
||||
pub pubkey: authn::PublicKey,
|
||||
pub bootstrap_token: Option<String>,
|
||||
pub(super) struct ChallengeContext {
|
||||
pub(super) challenge: AuthChallenge,
|
||||
pub(super) pubkey: authn::PublicKey,
|
||||
pub(super) bootstrap_token: Option<String>,
|
||||
}
|
||||
|
||||
pub struct ChallengeSolution {
|
||||
pub solution: Vec<u8>,
|
||||
pub(super) struct ChallengeSolution {
|
||||
pub(super) solution: Vec<u8>,
|
||||
}
|
||||
|
||||
smlang::statemachine!(
|
||||
@@ -74,13 +76,13 @@ async fn register_key(db: &DatabasePool, pubkey: &authn::PublicKey) -> Result<i3
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
pub struct AuthContext<'a, T: ?Sized> {
|
||||
pub(super) struct AuthContext<'a, T: ?Sized> {
|
||||
pub(super) conn: &'a mut UserAgentConnection,
|
||||
pub(super) transport: &'a mut T,
|
||||
}
|
||||
|
||||
impl<'a, T: ?Sized> AuthContext<'a, T> {
|
||||
pub fn new(conn: &'a mut UserAgentConnection, transport: &'a mut T) -> Self {
|
||||
pub(super) fn new(conn: &'a mut UserAgentConnection, transport: &'a mut T) -> Self {
|
||||
Self { conn, transport }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,16 @@ use crate::{
|
||||
peers::client::ClientProfile,
|
||||
};
|
||||
use arbiter_crypto::authn;
|
||||
|
||||
use arbiter_macros::Hashable;
|
||||
use arbiter_proto::transport::{Bi, Sender};
|
||||
pub use auth::authenticate;
|
||||
use vault_gate::VaultGate;
|
||||
|
||||
use kameo::actor::{ActorRef, Spawn as _};
|
||||
pub use session::UserAgentSession;
|
||||
use tokio::sync::oneshot;
|
||||
use tracing::{error, warn};
|
||||
use vault_gate::VaultGate;
|
||||
|
||||
pub use auth::authenticate;
|
||||
pub use session::UserAgentSession;
|
||||
|
||||
pub mod auth;
|
||||
pub mod session;
|
||||
@@ -179,7 +180,6 @@ where
|
||||
|
||||
Ok(UserAgentSession::spawn(UserAgentSession::new(
|
||||
props.clone(),
|
||||
creds,
|
||||
oob_sender,
|
||||
)))
|
||||
}
|
||||
|
||||
@@ -1,32 +1,21 @@
|
||||
|
||||
use alloy::{consensus::TxEip1559, primitives::Address, signers::Signature};
|
||||
use arbiter_crypto::{
|
||||
authn,
|
||||
safecell::SafeCellHandle as _,
|
||||
};
|
||||
use chacha20poly1305::aead::KeyInit;
|
||||
use diesel::{ExpressionMethods as _, QueryDsl as _, SelectableHelper};
|
||||
use diesel_async::{AsyncConnection, RunQueryDsl};
|
||||
use kameo::error::SendError;
|
||||
use kameo::messages;
|
||||
use kameo::prelude::Context;
|
||||
use tracing::error;
|
||||
|
||||
use crate::actors::flow_coordinator::client_connect_approval::ClientApprovalAnswer;
|
||||
use crate::actors::evm::{
|
||||
use super::{Error, UserAgentSession};
|
||||
use crate::{
|
||||
actors::evm::{
|
||||
ClientSignTransaction, Generate, ListWallets, SignTransactionError as EvmSignError,
|
||||
UseragentCreateGrant, UseragentListGrants,
|
||||
};
|
||||
use crate::db::models::{
|
||||
EvmWalletAccess, NewEvmWalletAccess, ProgramClient, ProgramClientMetadata,
|
||||
};
|
||||
use crate::evm::policies::{Grant, SpecificGrant};
|
||||
use crate::{
|
||||
},
|
||||
actors::flow_coordinator::client_connect_approval::ClientApprovalAnswer,
|
||||
actors::vault::VaultState,
|
||||
db::models::{EvmWalletAccess, NewEvmWalletAccess, ProgramClient, ProgramClientMetadata},
|
||||
evm::policies::{Grant, SpecificGrant},
|
||||
};
|
||||
use arbiter_crypto::authn;
|
||||
|
||||
use super::{Error, UserAgentSession};
|
||||
|
||||
use alloy::{consensus::TxEip1559, primitives::Address, signers::Signature};
|
||||
use diesel::{ExpressionMethods as _, QueryDsl as _, SelectableHelper};
|
||||
use diesel_async::{AsyncConnection, RunQueryDsl};
|
||||
use kameo::{error::SendError, messages, prelude::Context};
|
||||
use tracing::error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum SignTransactionError {
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
use arbiter_crypto::authn;
|
||||
|
||||
use std::{borrow::Cow, collections::HashMap};
|
||||
|
||||
use arbiter_proto::transport::Sender;
|
||||
use kameo::{Actor, actor::ActorRef, messages};
|
||||
use thiserror::Error;
|
||||
use tracing::error;
|
||||
|
||||
use super::{OutOfBand, UserAgentConnection};
|
||||
use crate::{
|
||||
actors::{
|
||||
flow_coordinator::client_connect_approval::ClientApprovalController,
|
||||
useragent_registry::ConnectUseragent,
|
||||
},
|
||||
peers::{client::ClientProfile, user_agent::Credentials},
|
||||
peers::client::ClientProfile,
|
||||
};
|
||||
use arbiter_crypto::authn;
|
||||
use arbiter_proto::transport::Sender;
|
||||
|
||||
use super::{OutOfBand, UserAgentConnection};
|
||||
use kameo::{Actor, actor::ActorRef, messages};
|
||||
use std::{borrow::Cow, collections::HashMap};
|
||||
use thiserror::Error;
|
||||
use tracing::error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
@@ -53,7 +50,6 @@ pub struct PendingClientApproval {
|
||||
}
|
||||
|
||||
pub struct UserAgentSession {
|
||||
creds: Credentials,
|
||||
props: UserAgentConnection,
|
||||
sender: Box<dyn Sender<OutOfBand>>,
|
||||
|
||||
@@ -63,13 +59,8 @@ pub struct UserAgentSession {
|
||||
pub mod handlers;
|
||||
|
||||
impl UserAgentSession {
|
||||
pub(crate) fn new(
|
||||
props: UserAgentConnection,
|
||||
creds: Credentials,
|
||||
sender: Box<dyn Sender<OutOfBand>>,
|
||||
) -> Self {
|
||||
pub(crate) fn new(props: UserAgentConnection, sender: Box<dyn Sender<OutOfBand>>) -> Self {
|
||||
Self {
|
||||
creds,
|
||||
props,
|
||||
sender,
|
||||
pending_client_approvals: Default::default(),
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
use arbiter_crypto::safecell::{SafeCell, SafeCellHandle as _};
|
||||
use chacha20poly1305::{AeadInPlace, KeyInit as _, XChaCha20Poly1305, XNonce};
|
||||
use kameo::{Actor, error::SendError, messages, prelude::Message};
|
||||
use kameo_actors::message_bus::Register;
|
||||
use tokio::sync::oneshot;
|
||||
use tracing::{error, info};
|
||||
use x25519_dalek::{EphemeralSecret, PublicKey, SharedSecret};
|
||||
|
||||
pub mod state;
|
||||
use state::*;
|
||||
|
||||
use super::Credentials;
|
||||
use crate::{
|
||||
actors::{
|
||||
@@ -18,6 +7,17 @@ use crate::{
|
||||
crypto::integrity::{self},
|
||||
db::DatabasePool,
|
||||
};
|
||||
use arbiter_crypto::safecell::{SafeCell, SafeCellHandle as _};
|
||||
use state::*;
|
||||
|
||||
use chacha20poly1305::{AeadInPlace, KeyInit as _, XChaCha20Poly1305, XNonce};
|
||||
use kameo::{Actor, error::SendError, messages, prelude::Message};
|
||||
use kameo_actors::message_bus::Register;
|
||||
use tokio::sync::oneshot;
|
||||
use tracing::{error, info};
|
||||
use x25519_dalek::{EphemeralSecret, PublicKey, SharedSecret};
|
||||
|
||||
pub mod state;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
|
||||
use x25519_dalek::{PublicKey, SharedSecret};
|
||||
|
||||
pub struct Handshake {
|
||||
client_pubkey: PublicKey,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum State {
|
||||
#[default]
|
||||
|
||||
Reference in New Issue
Block a user