client-api: Don't include token in Debug-format of login::Token

This commit is contained in:
Jonas Platte 2022-10-17 15:14:36 +02:00
parent 70b0d249a8
commit fe2d0c93e2
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C

View File

@ -264,8 +264,9 @@ pub mod v3 {
} }
/// A token to supply as authentication. /// A token to supply as authentication.
#[derive(Clone, Debug, Incoming, Serialize)] #[derive(Clone, Incoming, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[incoming_derive(!Debug)]
#[serde(tag = "type", rename = "m.login.token")] #[serde(tag = "type", rename = "m.login.token")]
pub struct Token<'a> { pub struct Token<'a> {
/// The token. /// The token.
@ -286,6 +287,18 @@ pub mod v3 {
} }
} }
impl<'a> fmt::Debug for Token<'a> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Token").finish_non_exhaustive()
}
}
impl fmt::Debug for IncomingToken {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("IncomingToken").finish_non_exhaustive()
}
}
/// An identifier to supply for Application Service authentication. /// An identifier to supply for Application Service authentication.
#[derive(Clone, Debug, Incoming, Serialize)] #[derive(Clone, Debug, Incoming, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]