Compare commits

...

5 Commits

Author SHA1 Message Date
Jonas Platte 266e59b567 Release matrix-sdk 0.6.2 2022-10-24 12:55:00 +02:00
Jonas Platte 51c7294fce fix(sdk): Remove token field from SyncSettings Debug output 2022-10-24 12:53:25 +02:00
Jonas Platte 2ee5f73d48 Release matrix-sdk-base 0.6.1 and matrix-sdk 0.6.1 2022-10-24 12:26:47 +02:00
Jonas Platte 85ec213db8 fix(base): Don't leak access and refresh tokens in Debug output 2022-10-24 12:25:33 +02:00
Jonas Platte 6fd906dd6f fix(sdk): Don't log the access token in HttpClient::send 2022-10-24 12:07:20 +02:00
7 changed files with 29 additions and 11 deletions
Generated
+2 -2
View File
@@ -2298,7 +2298,7 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "matrix-sdk"
version = "0.6.0"
version = "0.6.2"
dependencies = [
"anyhow",
"anymap2",
@@ -2372,7 +2372,7 @@ dependencies = [
[[package]]
name = "matrix-sdk-base"
version = "0.6.0"
version = "0.6.1"
dependencies = [
"assign",
"async-stream",
+1 -1
View File
@@ -9,7 +9,7 @@ name = "matrix-sdk-base"
readme = "README.md"
repository = "https://github.com/matrix-org/matrix-rust-sdk"
rust-version = "1.60"
version = "0.6.0"
version = "0.6.1"
[package.metadata.docs.rs]
all-features = true
+1 -2
View File
@@ -96,9 +96,8 @@ impl fmt::Debug for BaseClient {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Client")
.field("session_meta", &self.store.session_meta())
.field("session_tokens", &self.store.session_tokens)
.field("sync_token", &self.store.sync_token)
.finish()
.finish_non_exhaustive()
}
}
+19 -2
View File
@@ -15,6 +15,8 @@
//! User sessions.
use std::fmt;
use ruma::{api::client::session::refresh_token, OwnedDeviceId, OwnedUserId};
use serde::{Deserialize, Serialize};
@@ -36,7 +38,7 @@ use serde::{Deserialize, Serialize};
///
/// assert_eq!(session.device_id.as_str(), "MYDEVICEID");
/// ```
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Session {
/// The access token used for this session.
pub access_token: String,
@@ -66,6 +68,15 @@ impl Session {
}
}
impl fmt::Debug for Session {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Session")
.field("user_id", &self.user_id)
.field("device_id", &self.device_id)
.finish_non_exhaustive()
}
}
impl From<ruma::api::client::session::login::v3::Response> for Session {
fn from(response: ruma::api::client::session::login::v3::Response) -> Self {
Self {
@@ -88,7 +99,7 @@ pub struct SessionMeta {
/// The mutable parts of the session: the access token and optional refresh
/// token.
#[derive(Clone, Debug)]
#[derive(Clone)]
pub struct SessionTokens {
/// The access token used for this session.
pub access_token: String,
@@ -107,3 +118,9 @@ impl SessionTokens {
}
}
}
impl fmt::Debug for SessionTokens {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("SessionTokens").finish_non_exhaustive()
}
}
+2 -2
View File
@@ -9,7 +9,7 @@ name = "matrix-sdk"
readme = "README.md"
repository = "https://github.com/matrix-org/matrix-rust-sdk"
rust-version = "1.60"
version = "0.6.0"
version = "0.6.2"
[package.metadata.docs.rs]
features = ["docsrs"]
@@ -110,7 +110,7 @@ features = [
optional = true
[dependencies.matrix-sdk-base]
version = "0.6.0"
version = "0.6.1"
path = "../matrix-sdk-base"
default_features = false
-1
View File
@@ -47,7 +47,6 @@ impl<'a> fmt::Debug for SyncSettings<'a> {
opt_field!(filter);
opt_field!(timeout);
opt_field!(token);
s.field("full_state", &self.full_state).finish()
}
+4 -1
View File
@@ -105,7 +105,10 @@ impl HttpClient {
HttpClient { inner, request_config }
}
#[tracing::instrument(skip(self, request), fields(request_type = type_name::<Request>()))]
#[tracing::instrument(
skip(self, request, access_token),
fields(request_type = type_name::<Request>()),
)]
pub async fn send<Request>(
&self,
request: Request,