Skip to content

Commit

Permalink
Implement From<Basic> for BasicAuth (#327)
Browse files Browse the repository at this point in the history
* implement `From<Basic>` for `BasicAuth`

* update changelog

---------

Co-authored-by: Rob Ede <robjtede@icloud.com>
  • Loading branch information
52 and robjtede committed Sep 16, 2023
1 parent c029287 commit 55ace79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions actix-web-httpauth/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Implement `From<Basic>` for `BasicAuth`.
- Minimum supported Rust version (MSRV) is now 1.68.

## 0.8.0
Expand Down
6 changes: 6 additions & 0 deletions actix-web-httpauth/src/extractors/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down

0 comments on commit 55ace79

Please sign in to comment.