gauthz
google api service authentication by way of rust
Documentation
Install
Add the following to your project's Cargo.toml
file
[]
= "0.1"
Usage
Typical use requires gauthz::Tokens
configured with a tokio reactor handle
gauthz::Credentials
and gauthz::Scope
s representing the access level for
your intended API usage.
Note your
hyper::Client
must be configured with tls support. Hyper doesn't provide that out of the box but there are multiple crates that provide the support
A gauthz::Tokens
instance provides two interfaces get
which returns a Future
that resolves to an access token and a Stream
which resolves to new tokens when
the current token expires ( typically ) after one hour. The stream interface is
intended for long running applications which will inevitably require access for more
than one hour.
extern crate futures;
extern crate gauthz;
extern crate tokio_core;
use Future;
use Core;
use ;
use ErrorKind;
These tokens may be used in Authorization
HTTP headers to authenticate with
the Google API's the tokens are scoped to.
pronounced
gawthz
Doug Tangren (softprops) 2017