Skip to content

Commit

Permalink
client: Reduce the verbosity of the TlsConfig
Browse files Browse the repository at this point in the history
It was spewing out pages of raw binary data every time, which was
drowning my shell. Reducing the build of the credentials to its type,
and logging the raw credentials onces but at a lower severity sounds
like a good idea.
  • Loading branch information
cdecker committed May 9, 2024
1 parent 86c4364 commit 5dc32eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions libs/gl-client-py/src/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,28 +83,28 @@ impl Credentials {
#[new]
pub fn new() -> Self {
let inner = UnifiedCredentials::Nobody(gl_client::credentials::Nobody::default());
log::debug!("Created NOBODY credentials {:?}", inner.tls_config().client_tls_config());
log::debug!("Created NOBODY credentials");
Self { inner }
}

#[staticmethod]
pub fn nobody_with(cert: &[u8], key: &[u8], ca: &[u8]) -> Self {
let inner = UnifiedCredentials::Nobody(gl_client::credentials::Nobody::with(cert, key, ca));
log::debug!("Created NOBODY credentials {:?}", inner.tls_config());
log::debug!("Created NOBODY credentials");
Self { inner }
}

#[staticmethod]
pub fn from_path(path: &str) -> Self {
let inner = UnifiedCredentials::Device(gl_client::credentials::Device::from_path(path));
log::debug!("Created device credentials {:?}", inner.tls_config());
log::debug!("Created device credentials");
Self { inner }
}

#[staticmethod]
pub fn from_bytes(data: &[u8]) -> Self {
let inner = UnifiedCredentials::Device(gl_client::credentials::Device::from_bytes(data));
log::debug!("Created device credentials {:?}", inner.tls_config());
log::debug!("Created device credentials");
Self { inner }
}

Expand Down Expand Up @@ -164,4 +164,4 @@ impl From<ErrorWrapper> for pyo3::PyErr {
fn from(value: ErrorWrapper) -> Self {
PyErr::new::<PyValueError, _>(value.to_string())
}
}
}
2 changes: 1 addition & 1 deletion libs/gl-client/src/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl Device {
/// credentials data blob. It defaults to the nobody credentials set.
pub fn from_bytes(data: impl AsRef<[u8]>) -> Self {
let mut creds = Self::default();
debug!("Build authenticated credentials from: {:?}", data.as_ref());
log::trace!("Build authenticated credentials from: {:?}", data.as_ref());
if let Ok(data) = model::Data::try_from(data.as_ref()) {
creds.version = data.version;
if let Some(cert) = data.cert {
Expand Down

0 comments on commit 5dc32eb

Please sign in to comment.