diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-05 02:57:37 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-05 02:57:37 +0200 |
commit | 6de0a5e827b0b18f589c28f489b4ff88169f156c (patch) | |
tree | cc6923484b77b5654fe1ca09bf6694fda7a894a2 /src/encoding/headers.rs | |
parent | 384ddd782b989218ceb55b7147aa8698425d1464 (diff) | |
download | sip-rs-6de0a5e827b0b18f589c28f489b4ff88169f156c.tar sip-rs-6de0a5e827b0b18f589c28f489b4ff88169f156c.tar.bz2 sip-rs-6de0a5e827b0b18f589c28f489b4ff88169f156c.tar.zst |
this wont work
Diffstat (limited to 'src/encoding/headers.rs')
-rw-r--r-- | src/encoding/headers.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/encoding/headers.rs b/src/encoding/headers.rs index 6bffc7e..e9196d1 100644 --- a/src/encoding/headers.rs +++ b/src/encoding/headers.rs @@ -103,3 +103,34 @@ impl FromStr for WWWAuthenticate { }) } } + +#[derive(Debug)] +pub struct Authorization { + pub username: String, + pub realm: String, + pub nonce: String, + pub response: String, +} +impl Header for Authorization { + const NAME: &'static str = "Authorization"; +} +impl Display for Authorization { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let Self { + username, + realm, + nonce, + response, + } = self; + write!( + f, + "Digest username={username:?} realm={realm:?}, nonce={nonce:?}, response={response:?}" + ) + } +} +impl FromStr for Authorization { + type Err = anyhow::Error; + fn from_str(_s: &str) -> Result<Self, Self::Err> { + todo!() + } +} |