From 6de0a5e827b0b18f589c28f489b4ff88169f156c Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 5 Jul 2024 02:57:37 +0200 Subject: this wont work --- src/encoding/headers.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/encoding/headers.rs') 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 { + todo!() + } +} -- cgit v1.2.3-70-g09d2