mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-27 09:12:57 +01:00
update httpauth readme
This commit is contained in:
parent
d14e188246
commit
33dfea8997
@ -1133,6 +1133,7 @@ mod tests {
|
||||
resp.headers().get(header::VARY).unwrap().as_bytes()
|
||||
);
|
||||
|
||||
#[allow(clippy::needless_collect)]
|
||||
{
|
||||
let headers = resp
|
||||
.headers()
|
||||
@ -1145,7 +1146,6 @@ mod tests {
|
||||
.collect::<Vec<&str>>();
|
||||
|
||||
for h in exposed_headers {
|
||||
#[allow(clippy::needless_collect)]
|
||||
assert!(headers.contains(&h.as_str()));
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,29 @@
|
||||
# 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)
|
||||
[![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)
|
||||
[![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:
|
||||
* typed [Authorization] and [WWW-Authenticate] headers
|
||||
* [extractors] for an [Authorization] header
|
||||
* [middleware] for easier authorization checking
|
||||
## Features
|
||||
- Typed [Authorization] and [WWW-Authenticate] headers
|
||||
- [Extractors] for authorization headers
|
||||
- [Middleware] for easier authorization checking
|
||||
|
||||
All supported schemas are actix [Extractors](https://docs.rs/actix-web/2.0.0/actix_web/trait.FromRequest.html),
|
||||
and can be used both in the middlewares and request handlers.
|
||||
All supported schemas can be used in both middleware 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
|
||||
|
@ -96,7 +96,7 @@ impl fmt::Display for Basic {
|
||||
let bytes = self.to_bytes();
|
||||
let repr = str::from_utf8(&bytes)
|
||||
// Should not happen since challenges are crafted manually
|
||||
// from `&'static str`'s and Strings
|
||||
// from a `&'static str` or `String`
|
||||
.map_err(|_| fmt::Error)?;
|
||||
|
||||
f.write_str(repr)
|
||||
|
@ -1,21 +1,21 @@
|
||||
//! HTTP Authorization support for [actix-web](https://actix.rs) framework.
|
||||
//! HTTP authentication schemes for [actix-web](https://actix.rs).
|
||||
//!
|
||||
//! Provides:
|
||||
//! * typed [Authorization] and [WWW-Authenticate] headers
|
||||
//! * [extractors] for an [Authorization] header
|
||||
//! * [middleware] for easier authorization checking
|
||||
//! - Typed [Authorization] and [WWW-Authenticate] headers
|
||||
//! - [Extractors] for an [Authorization] header
|
||||
//! - [Middleware] for easier authorization checking
|
||||
//!
|
||||
//! ## Supported schemes
|
||||
//!
|
||||
//! * `Basic`, as defined in [RFC7617](https://tools.ietf.org/html/rfc7617)
|
||||
//! * `Bearer`, as defined in [RFC6750](https://tools.ietf.org/html/rfc6750)
|
||||
//! - `Basic`, as defined in [RFC7617](https://tools.ietf.org/html/rfc7617)
|
||||
//! - `Bearer`, as defined in [RFC6750](https://tools.ietf.org/html/rfc6750)
|
||||
//!
|
||||
//! [Authorization]: `crate::headers::authorization::Authorization`
|
||||
//! [WWW-Authenticate]: `crate::headers::www_authenticate::WwwAuthenticate`
|
||||
//! [extractors]: https://actix.rs/docs/extractors/
|
||||
//! [middleware]: ./middleware/
|
||||
//! [Extractors]: https://actix.rs/docs/extractors/
|
||||
//! [Middleware]: ./middleware
|
||||
|
||||
#![deny(bare_trait_objects, missing_docs, nonstandard_style, rust_2018_idioms)]
|
||||
#![deny(missing_docs, nonstandard_style, rust_2018_idioms)]
|
||||
#![deny(clippy::all)]
|
||||
|
||||
pub mod extractors;
|
||||
|
Loading…
Reference in New Issue
Block a user