Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(connlib): upgrade domain version from 0.9 to 0.10 #5028

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ secrecy = "0.8"
hickory-resolver = { git = "https://github.com/hickory-dns/hickory-dns", rev="a3669bd80f3f7b97f0c301c15f1cba6368d97b63", features = ["tokio-runtime"] }
str0m = { version = "0.5", default-features = false }
futures-bounded = "0.2.1"
domain = { version = "0.9", features = ["serde"] }
domain = { version = "0.10", features = ["serde"] }
dns-lookup = "2.0"
tokio-tungstenite = "0.21"
rtnetlink = { version = "0.14.1", default-features = false, features = ["tokio_socket"] }
Expand Down
2 changes: 1 addition & 1 deletion rust/connlib/shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use phoenix_channel::{LoginUrl, LoginUrlError};

use rand_core::OsRng;

pub type Dname = domain::base::Dname<Vec<u8>>;
pub type Name = domain::base::Name<Vec<u8>>;
conectado marked this conversation as resolved.
Show resolved Hide resolved

/// Bundle ID / App ID that the client uses to distinguish itself from other programs on the system
///
Expand Down
8 changes: 4 additions & 4 deletions rust/connlib/shared/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mod key;

pub use key::{Key, SecretKey};

use crate::Dname;
use crate::Name;

#[derive(Hash, Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq)]
pub struct GatewayId(Uuid);
Expand Down Expand Up @@ -157,7 +157,7 @@ pub struct RequestConnection {
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
pub struct ClientPayload {
pub ice_parameters: Offer,
pub domain: Option<Dname>,
pub domain: Option<Name>,
}

/// Represent a request to reuse an existing gateway connection from a client to a given resource.
Expand All @@ -171,7 +171,7 @@ pub struct ReuseConnection {
/// Id of the gateway we want to reuse
pub gateway_id: GatewayId,
/// Payload that the gateway will receive
pub payload: Option<Dname>,
pub payload: Option<Name>,
}

// Custom implementation of partial eq to ignore client_rtc_sdp
Expand All @@ -185,7 +185,7 @@ impl Eq for RequestConnection {}

#[derive(Debug, Deserialize, Serialize, Clone, Hash, PartialEq, Eq)]
pub struct DomainResponse {
pub domain: Dname,
pub domain: Name,
pub address: Vec<IpAddr>,
}

Expand Down
16 changes: 8 additions & 8 deletions rust/connlib/tunnel/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use connlib_shared::messages::{
Answer, ClientPayload, DnsServer, DomainResponse, GatewayId, Interface as InterfaceConfig,
IpDnsServer, Key, Offer, Relay, RelayId, RequestConnection, ResourceId, ReuseConnection,
};
use connlib_shared::{callbacks, Callbacks, Dname, PublicKey, StaticSecret};
use connlib_shared::{callbacks, Callbacks, Name, PublicKey, StaticSecret};
use domain::base::Rtype;
use ip_network::{IpNetwork, Ipv4Network, Ipv6Network};
use ip_network_table::IpNetworkTable;
Expand Down Expand Up @@ -44,11 +44,11 @@ const DNS_REFRESH_INTERVAL: Duration = Duration::from_secs(300);
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct DnsResource {
pub id: ResourceId,
pub address: Dname,
pub address: Name,
}

impl DnsResource {
pub fn from_description(description: &ResourceDescriptionDns, address: Dname) -> DnsResource {
pub fn from_description(description: &ResourceDescriptionDns, address: Name) -> DnsResource {
DnsResource {
id: description.id,
address,
Expand Down Expand Up @@ -297,7 +297,7 @@ pub struct ClientState {

#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct AwaitingConnectionDetails {
pub domain: Option<Dname>,
pub domain: Option<Name>,
gateways: HashSet<GatewayId>,
pub last_intent_sent_at: Instant,
}
Expand Down Expand Up @@ -612,7 +612,7 @@ impl ClientState {
self.dns_resources_internal_ips
.insert(resource_description.clone(), addrs.clone());

send_dns_answer(self, Rtype::Aaaa, &resource_description, &addrs);
send_dns_answer(self, Rtype::AAAA, &resource_description, &addrs);
send_dns_answer(self, Rtype::A, &resource_description, &addrs);

Ok(addrs.iter().copied().map(Into::into).collect())
Expand Down Expand Up @@ -715,7 +715,7 @@ impl ClientState {
fn on_connection_intent_to_resource(
&mut self,
resource: ResourceId,
domain: Option<Dname>,
domain: Option<Name>,
now: Instant,
) {
debug_assert!(self.resource_ids.contains_key(&resource));
Expand Down Expand Up @@ -771,7 +771,7 @@ impl ClientState {
self.dns_mapping.clone()
}

fn is_connected_to(&self, resource: ResourceId, domain: &Option<Dname>) -> bool {
fn is_connected_to(&self, resource: ResourceId, domain: &Option<Name>) -> bool {
let Some(resource) = self.resource_ids.get(&resource) else {
return false;
};
Expand All @@ -783,7 +783,7 @@ impl ClientState {
fn get_resource_ip(
&self,
resource: &ResourceDescription,
domain: &Option<Dname>,
domain: &Option<Name>,
) -> Vec<IpNetwork> {
match resource {
ResourceDescription::Dns(dns_resource) => {
Expand Down
Loading
Loading