aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/headers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding/headers.rs')
-rw-r--r--src/encoding/headers.rs31
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!()
+ }
+}