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

Revert "Adding TLS authentication" #1072

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@

cargo-timing*.html

#ignore test data
testfiles
ci/valgrind-check/*.log
113 changes: 0 additions & 113 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions commons/zenoh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ pub struct DownsamplingItemConf {
#[derive(Serialize, Debug, Deserialize, Clone)]
pub struct AclConfigRules {
pub interfaces: Option<Vec<String>>,
pub cert_common_names: Option<Vec<String>>,
pub usernames: Option<Vec<String>>,
pub key_exprs: Vec<String>,
pub actions: Vec<Action>,
pub flows: Option<Vec<InterceptorFlow>>,
Expand All @@ -126,8 +124,6 @@ pub struct PolicyRule {
#[serde(rename_all = "snake_case")]
pub enum Subject {
Interface(String),
CertCommonName(String),
Username(String),
}

#[derive(Clone, Copy, Debug, Serialize, Deserialize, Eq, Hash, PartialEq)]
Expand Down
3 changes: 0 additions & 3 deletions io/zenoh-link-commons/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub struct Link {
pub is_reliable: bool,
pub is_streamed: bool,
pub interfaces: Vec<String>,
pub auth_identifier: LinkAuthId,
}

#[async_trait]
Expand Down Expand Up @@ -79,7 +78,6 @@ impl From<&LinkUnicast> for Link {
is_reliable: link.is_reliable(),
is_streamed: link.is_streamed(),
interfaces: link.get_interface_names(),
auth_identifier: link.get_auth_identifier(),
}
}
}
Expand All @@ -100,7 +98,6 @@ impl From<&LinkMulticast> for Link {
is_reliable: link.is_reliable(),
is_streamed: false,
interfaces: vec![],
auth_identifier: LinkAuthId::default(),
}
}
}
Expand Down
68 changes: 0 additions & 68 deletions io/zenoh-link-commons/src/unicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use core::{
use std::net::SocketAddr;

use async_trait::async_trait;
use serde::Serialize;
use zenoh_protocol::{
core::{EndPoint, Locator},
transport::BatchSize,
Expand Down Expand Up @@ -52,7 +51,6 @@ pub trait LinkUnicastTrait: Send + Sync {
fn is_reliable(&self) -> bool;
fn is_streamed(&self) -> bool;
fn get_interface_names(&self) -> Vec<String>;
fn get_auth_identifier(&self) -> LinkAuthId;
async fn write(&self, buffer: &[u8]) -> ZResult<usize>;
async fn write_all(&self, buffer: &[u8]) -> ZResult<()>;
async fn read(&self, buffer: &mut [u8]) -> ZResult<usize>;
Expand Down Expand Up @@ -120,69 +118,3 @@ pub fn get_ip_interface_names(addr: &SocketAddr) -> Vec<String> {
}
}
}
#[derive(Clone, Debug, Serialize, Hash, PartialEq, Eq)]

pub enum LinkAuthType {
Tls,
Quic,
None,
}
#[derive(Clone, Debug, Serialize, Hash, PartialEq, Eq)]

pub struct LinkAuthId {
auth_type: LinkAuthType,
auth_value: Option<String>,
}

impl LinkAuthId {
pub fn get_type(&self) -> &LinkAuthType {
&self.auth_type
}
pub fn get_value(&self) -> &Option<String> {
&self.auth_value
}
}
impl Default for LinkAuthId {
fn default() -> Self {
LinkAuthId {
auth_type: LinkAuthType::None,
auth_value: None,
}
}
}

#[derive(Debug)]
pub struct LinkAuthIdBuilder {
pub auth_type: LinkAuthType, //HAS to be provided when building
pub auth_value: Option<String>, //actual value added to the above type; is None for None type
}
impl Default for LinkAuthIdBuilder {
fn default() -> Self {
Self::new()
}
}

impl LinkAuthIdBuilder {
pub fn new() -> LinkAuthIdBuilder {
LinkAuthIdBuilder {
auth_type: LinkAuthType::None,
auth_value: None,
}
}

pub fn auth_type(&mut self, auth_type: LinkAuthType) -> &mut Self {
self.auth_type = auth_type;
self
}
pub fn auth_value(&mut self, auth_value: Option<String>) -> &mut Self {
self.auth_value = auth_value;
self
}

pub fn build(&self) -> LinkAuthId {
LinkAuthId {
auth_type: self.auth_type.clone(),
auth_value: self.auth_value.clone(),
}
}
}
7 changes: 2 additions & 5 deletions io/zenoh-links/zenoh-link-quic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ base64 = { workspace = true }
futures = { workspace = true }
quinn = { workspace = true }
rustls-native-certs = { workspace = true }
rustls-pki-types = { workspace = true }
rustls-pki-types = { workspace = true }
rustls-webpki = { workspace = true }

secrecy = { workspace = true }
tokio = { workspace = true, features = [
"fs",
"io-util",
"net",
"fs",
"sync",
"time",
] }
Expand All @@ -57,5 +56,3 @@ zenoh-util = { workspace = true }
rustls = { version = "0.21", features = ["dangerous_configuration", "quic"] }
tokio-rustls = "0.24.1"
rustls-pemfile = { version = "1" }

x509-parser = "0.16.0"
Loading