1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-23 15:51:06 +01:00

Implement From<Basic> for BasicAuth (#327)

* implement `From<Basic>` for `BasicAuth`

* update changelog

---------

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Max Karou 2023-09-16 02:27:50 +02:00 committed by GitHub
parent c029287801
commit 55ace79d64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,7 @@
## Unreleased
- Implement `From<Basic>` for `BasicAuth`.
- Minimum supported Rust version (MSRV) is now 1.68.
## 0.8.0

View File

@ -89,6 +89,12 @@ impl BasicAuth {
}
}
impl From<Basic> for BasicAuth {
fn from(basic: Basic) -> Self {
Self(basic)
}
}
impl FromRequest for BasicAuth {
type Future = Ready<Result<Self, Self::Error>>;
type Error = AuthenticationError<Challenge>;