a4638b8d2f
* use x25519 noise key for ktt instead of deriving one from ed25519 * removed client's IpAddr from RegistrationClient constructor * Adjusted the gateway probe to inject correct lp data * remove redundant argument from nym-lp-client * consistent naming for HashFunction variants * use workspace dep import for nym-kkt-ciphersuite * struct renaming
50 lines
1.9 KiB
Rust
50 lines
1.9 KiB
Rust
// Copyright 2025 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use nym_authenticator_client::{AuthClientMixnetListenerHandle, AuthenticatorClient};
|
|
use nym_bandwidth_controller::BandwidthTicketProvider;
|
|
use nym_registration_common::{AssignedAddresses, WireguardConfiguration};
|
|
use nym_sdk::mixnet::{EventReceiver, MixnetClient};
|
|
|
|
pub enum RegistrationResult {
|
|
Mixnet(Box<MixnetRegistrationResult>),
|
|
Wireguard(Box<WireguardRegistrationResult>),
|
|
Lp(Box<LpRegistrationResult>),
|
|
}
|
|
|
|
pub struct MixnetRegistrationResult {
|
|
pub assigned_addresses: AssignedAddresses,
|
|
pub mixnet_client: MixnetClient,
|
|
pub event_rx: EventReceiver,
|
|
}
|
|
|
|
pub struct WireguardRegistrationResult {
|
|
pub entry_gateway_client: AuthenticatorClient,
|
|
pub exit_gateway_client: AuthenticatorClient,
|
|
pub entry_gateway_data: WireguardConfiguration,
|
|
pub exit_gateway_data: WireguardConfiguration,
|
|
pub authenticator_listener_handle: AuthClientMixnetListenerHandle,
|
|
pub bw_controller: Box<dyn BandwidthTicketProvider>,
|
|
}
|
|
|
|
/// Result of LP (Lewes Protocol) registration with entry and exit gateways.
|
|
///
|
|
/// LP is used only for registration. After successful registration, all data flows
|
|
/// through WireGuard tunnels established using the returned gateway configuration.
|
|
/// The LP connections are automatically closed after registration completes.
|
|
///
|
|
/// # Fields
|
|
/// * `entry_gateway_data` - WireGuard configuration from entry gateway
|
|
/// * `exit_gateway_data` - WireGuard configuration from exit gateway
|
|
/// * `bw_controller` - Bandwidth ticket provider for credential management
|
|
pub struct LpRegistrationResult {
|
|
/// Gateway configuration data from entry gateway
|
|
pub entry_gateway_data: WireguardConfiguration,
|
|
|
|
/// Gateway configuration data from exit gateway
|
|
pub exit_gateway_data: WireguardConfiguration,
|
|
|
|
/// Bandwidth controller for credential management
|
|
pub bw_controller: Box<dyn BandwidthTicketProvider>,
|
|
}
|