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

update httpauth readme

This commit is contained in:
Rob Ede 2020-09-28 02:04:18 +01:00
parent d14e188246
commit 33dfea8997
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
4 changed files with 30 additions and 23 deletions

View File

@ -1133,6 +1133,7 @@ mod tests {
resp.headers().get(header::VARY).unwrap().as_bytes() resp.headers().get(header::VARY).unwrap().as_bytes()
); );
#[allow(clippy::needless_collect)]
{ {
let headers = resp let headers = resp
.headers() .headers()
@ -1145,7 +1146,6 @@ mod tests {
.collect::<Vec<&str>>(); .collect::<Vec<&str>>();
for h in exposed_headers { for h in exposed_headers {
#[allow(clippy::needless_collect)]
assert!(headers.contains(&h.as_str())); assert!(headers.contains(&h.as_str()));
} }
} }

View File

@ -1,22 +1,29 @@
# actix-web-httpauth # actix-web-httpauth
> HTTP authentication schemes for [actix-web](https://github.com/actix/actix-web).
[![crates.io](https://img.shields.io/crates/v/actix-web-httpauth)](https://crates.io/crates/actix-web-httpauth) [![crates.io](https://img.shields.io/crates/v/actix-web-httpauth)](https://crates.io/crates/actix-web-httpauth)
[![Documentation](https://docs.rs/actix-web-httpauth/badge.svg)](https://docs.rs/actix-web-httpauth) [![Documentation](https://docs.rs/actix-web-httpauth/badge.svg)](https://docs.rs/actix-web-httpauth)
[![Dependency Status](https://deps.rs/crate/actix-web-httpauth/0.4.2/status.svg)](https://deps.rs/crate/actix-web-httpauth/0.4.2) [![Dependency Status](https://deps.rs/crate/actix-web-httpauth/0.5.0/status.svg)](https://deps.rs/crate/actix-web-httpauth/0.5.0)
![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-web-httpauth) ![Apache 2.0 or MIT licensed](https://img.shields.io/crates/l/actix-web-httpauth)
[![Join the chat at https://gitter.im/actix/actix](https://badges.gitter.im/actix/actix.svg)](https://gitter.im/actix/actix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the chat at https://gitter.im/actix/actix-web](https://badges.gitter.im/actix/actix-web.svg)](https://gitter.im/actix/actix-web?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
> HTTP authentication schemes for [actix-web](https://github.com/actix/actix-web) framework.
Provides: ## Features
* typed [Authorization] and [WWW-Authenticate] headers - Typed [Authorization] and [WWW-Authenticate] headers
* [extractors] for an [Authorization] header - [Extractors] for authorization headers
* [middleware] for easier authorization checking - [Middleware] for easier authorization checking
All supported schemas are actix [Extractors](https://docs.rs/actix-web/2.0.0/actix_web/trait.FromRequest.html), All supported schemas can be used in both middleware and request handlers.
and can be used both in the middlewares and request handlers.
## Supported schemes ## Supported Schemes
- [HTTP Basic](https://tools.ietf.org/html/rfc7617)
- [OAuth Bearer](https://tools.ietf.org/html/rfc6750)
* [Basic](https://tools.ietf.org/html/rfc7617)
* [Bearer](https://tools.ietf.org/html/rfc6750) <!-- LINKS -->
[Authorization]: https://docs.rs/actix-web-httpauth/*/actix_web_httpauth/headers/authorization/index.html
[WWW-Authenticate]: https://docs.rs/actix-web-httpauth/*/actix_web_httpauth/headers/www_authenticate/index.html
[Extractors]: https://actix.rs/docs/extractors/
[Middleware]: https://docs.rs/actix-web-httpauth/*/actix_web_httpauth/middleware/index.html

View File

@ -96,7 +96,7 @@ impl fmt::Display for Basic {
let bytes = self.to_bytes(); let bytes = self.to_bytes();
let repr = str::from_utf8(&bytes) let repr = str::from_utf8(&bytes)
// Should not happen since challenges are crafted manually // Should not happen since challenges are crafted manually
// from `&'static str`'s and Strings // from a `&'static str` or `String`
.map_err(|_| fmt::Error)?; .map_err(|_| fmt::Error)?;
f.write_str(repr) f.write_str(repr)

View File

@ -1,21 +1,21 @@
//! HTTP Authorization support for [actix-web](https://actix.rs) framework. //! HTTP authentication schemes for [actix-web](https://actix.rs).
//! //!
//! Provides: //! Provides:
//! * typed [Authorization] and [WWW-Authenticate] headers //! - Typed [Authorization] and [WWW-Authenticate] headers
//! * [extractors] for an [Authorization] header //! - [Extractors] for an [Authorization] header
//! * [middleware] for easier authorization checking //! - [Middleware] for easier authorization checking
//! //!
//! ## Supported schemes //! ## Supported schemes
//! //!
//! * `Basic`, as defined in [RFC7617](https://tools.ietf.org/html/rfc7617) //! - `Basic`, as defined in [RFC7617](https://tools.ietf.org/html/rfc7617)
//! * `Bearer`, as defined in [RFC6750](https://tools.ietf.org/html/rfc6750) //! - `Bearer`, as defined in [RFC6750](https://tools.ietf.org/html/rfc6750)
//! //!
//! [Authorization]: `crate::headers::authorization::Authorization` //! [Authorization]: `crate::headers::authorization::Authorization`
//! [WWW-Authenticate]: `crate::headers::www_authenticate::WwwAuthenticate` //! [WWW-Authenticate]: `crate::headers::www_authenticate::WwwAuthenticate`
//! [extractors]: https://actix.rs/docs/extractors/ //! [Extractors]: https://actix.rs/docs/extractors/
//! [middleware]: ./middleware/ //! [Middleware]: ./middleware
#![deny(bare_trait_objects, missing_docs, nonstandard_style, rust_2018_idioms)] #![deny(missing_docs, nonstandard_style, rust_2018_idioms)]
#![deny(clippy::all)] #![deny(clippy::all)]
pub mod extractors; pub mod extractors;