From 34aaa9f20fc618383e1043f843eef2ed8cef1cca Mon Sep 17 00:00:00 2001 From: "David A. Ramos" Date: Sat, 7 Dec 2019 18:15:38 -0800 Subject: [PATCH] Simplify README and add ToC to module doc --- README.md | 42 +++--------------------------------------- src/lib.rs | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 98c9110b..2b6a666d 100644 --- a/README.md +++ b/README.md @@ -3,43 +3,7 @@ -A simple implementation of the OAuth2 flow in Rust. +An extensible, strongly-typed implementation of OAuth2 +([RFC 6749](https://tools.ietf.org/html/rfc6749)). -Documentation is available on [docs.rs](https://docs.rs/oauth2) or check the [examples](https://github.com/ramosbugs/oauth2-rs/tree/master/examples). - -Before upgrading make sure to check out the [changelog](https://github.com/ramosbugs/oauth2-rs/releases). - -### Contributed Examples - -- [`actix-web-oauth2`](https://github.com/pka/actix-web-oauth2) (version 2.x of this crate) - -## Development - -Build: - -``` -cargo build -``` - -using futures 0.3: -this requires at least rust 1.39.0 -``` -cargo build --no-default-features --features "futures-03" -``` - -Run tests: - -``` -cargo test -``` - -using futures 0.3: -``` -cargo test --no-default-features --features "futures-03" -``` - -Release: - -``` -cargo package && cargo publish -``` +Documentation is available on [docs.rs](https://docs.rs/oauth2). Release notes are available on [GitHub](https://github.com/ramosbugs/oauth2-rs/releases). diff --git a/src/lib.rs b/src/lib.rs index e75f65ca..71d8d07b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,18 @@ //! An extensible, strongly-typed implementation of OAuth2 //! ([RFC 6749](https://tools.ietf.org/html/rfc6749)). //! +//! # Contents +//! * [Importing `oauth2`: selecting an HTTP client interface](#importing-oauth2-selecting-an-http-client-interface) +//! * [Getting started: Authorization Code Grant w/ PKCE](#getting-started-authorization-code-grant-w-pkce) +//! * [Example: Synchronous (blocking) API](#example-synchronous-blocking-api) +//! * [Example: Asynchronous (futures 0.1-based) API](#example-asynchronous-futures-01-based-api) +//! * [Example: Async/Await API](#example-asyncawait-api) +//! * [Implicit Grant](#implicit-grant) +//! * [Resource Owner Password Credentials Grant](#resource-owner-password-credentials-grant) +//! * [Client Credentials Grant](#client-credentials-grant) +//! * [Other examples](#other-examples) +//! * [Contributed Examples](#contributed-examples) +//! //! # Importing `oauth2`: selecting an HTTP client interface //! //! This library offers a flexible HTTP client interface with three modes: @@ -463,7 +475,10 @@ //! - [Microsoft Graph](https://github.com/ramosbugs/oauth2-rs/blob/master/examples/msgraph.rs) //! - [Wunderlist](https://github.com/ramosbugs/oauth2-rs/blob/master/examples/wunderlist.rs) //! - +//! ## Contributed Examples +//! +//! - [`actix-web-oauth2`](https://github.com/pka/actix-web-oauth2) (version 2.x of this crate) +//! use std::borrow::Cow; use std::fmt::Error as FormatterError; use std::fmt::{Debug, Display, Formatter};