Commit Graph

30 Commits

Author SHA1 Message Date
Sebastian Thiel
e05e5553e3 feat(serde): use serde instead of rustc_serialize
That way, we can pretty-print the respective application secret
strucures. This is primiarily of interest for the main client of this
library, namely Google APIs RS.

Version incremented.

Fixes #2
2015-04-30 14:18:44 +02:00
Sebastian Thiel
3ca51ccfe2 fix(rustup): 1.1.0-nightly (97d4e76c2 2015-04-27)
Also incremented version
2015-04-29 09:53:27 +02:00
Sebastian Thiel
727c1d801b fix(rustup): replace sleep with sleep_ms
Now it works with the latest compiler. I wonder why I didn't notice
that before ... .
2015-04-26 21:13:45 +02:00
Sebastian Thiel
2a1247bae0 fix(common): remove obsolete marker trait
... and version-up right away :).
2015-04-26 20:50:27 +02:00
Sebastian Thiel
690bcdb627 fix(helper): unset stored token on refresh failure
Previously we would have no way of getting rid of invalid/revoked
tokens, which would render the application unusable unless the user
would delete the token manually.

Related to https://github.com/Byron/google-apis-rs/issues/79
2015-04-24 09:30:52 +02:00
Sebastian Thiel
1ce4147d54 fix(refresh): use correct URL for refresh flow
This also allowed us to simplify the API once again.
2015-04-23 17:24:20 +02:00
Sebastian Thiel
2481c75c31 fix(API): review Result types and adapt code
* Do not return massive custom result enums, but instead adhere to the
  `Result` convention. This natively fixed our problem related to having
  to make unnecessary clones, making our design much cleaner.

Fixes #4
2015-04-23 17:01:21 +02:00
Sebastian Thiel
2cdf8bbf76 fix(API): overall improved error handling
* Return `Result<Token, Box<Error>>` type wherever feasible
* increment version to 0.3.5
* remove all usages of depreceated std items
2015-04-23 13:47:49 +02:00
Sebastian Thiel
84454d1736 fix(rustup): (abf0548b5 2015-04-15) (built 2015-04-15) 2015-04-17 06:39:16 +02:00
Sebastian Thiel
0222a19e9d fix(version-up): v0.3.3
* hyper adjustments to deal with Client without type parameter
* adjust to changed crate name conventions, '-' are converted to '_'

Fixes #3
2015-04-08 16:40:48 +02:00
Sebastian Thiel
2489b81383 fix(update-dependencies): rustup + dep-up
* updated to rustc (be9bd7c93 2015-04-05)
* use latest hyper

The latter required us to deal with HttpError not being clonable
anymore.
2015-04-07 10:35:25 +02:00
Sebastian Thiel
feba2d0e5a feat(header): Authorization Scheme for Oauth
Allows not natively use Oauth2 schemes with hyper Authorization headers.
Added support for serialization and parsing.
2015-03-22 11:55:05 +01:00
Sebastian Thiel
0710d310f8 feat(api_key): GetToken.api_key()
Allows to get API keys in case there is no known scope.
There might be alterations to this, as I am unsure how it's supposed
to be implemented.
2015-03-16 13:41:19 +01:00
Sebastian Thiel
3d1678daea fix(rustup): update to latest rustc
rustc 1.0.0-nightly (3e4be02b8 2015-03-13) (built 2015-03-13)
2015-03-15 11:34:03 +01:00
Sebastian Thiel
437a60959b fix(rustup): switch to using io where possible
And adapt to hyper in the same moment
2015-03-07 13:35:21 +01:00
Sebastian Thiel
445675db7f fix(common): Default trait for ApplicationSecret 2015-03-01 10:14:19 +01:00
Sebastian Thiel
fb0c3ff506 feat(auth): Authenticator support GetToken trait
This will allow its usage in generics, without having to provide
the 4 additional template types it usees.
2015-03-01 09:56:58 +01:00
Sebastian Thiel
dea3e6b3fd test(auth): removed DeviceFlowHelper
It's superseded by the more powerful `Authenticator`.
Adjusted library documentation accordingly, as well as `auth` program.
2015-02-28 12:03:30 +01:00
Sebastian Thiel
374804331a test(auth): Authenticator test
Also showed that for some reason, BorrowMut<TokenStorage> can't really
be passed, even though it works for Client struct, which is as
simple as well.
2015-02-28 11:09:23 +01:00
Sebastian Thiel
c227c161fd feat(helper): full implementation of Authenticator
It's a generalized DeviceFlowHelper, able to operate on all flows.
It's also more flexible, as it will automatically refresh token as
required. That way, it lends itself to use in libraries which
want minimal hassle.
2015-02-28 09:37:45 +01:00
Sebastian Thiel
091f1c0759 feat(util): new MemoryStorage and NullStorage
Additionally, the Authenticator interface was scetched out.
It will replace the DeviceFlowHelper, and become the universal
do-it-all tool, as it supports storage as well.
2015-02-27 21:02:41 +01:00
Sebastian Thiel
3f965c8fea feat(device): BorrowMut for client 2015-02-27 20:15:28 +01:00
Sebastian Thiel
88d4bf8c28 fix(refresh): BorrowMut for & and owned Client
That way, we are most flexible, at the cost of additional code.
2015-02-27 20:08:53 +01:00
Sebastian Thiel
4486bd595f feat(refresh): &mut Client instead of Client
Breaking: This changes the existing API ... maybe Borrow can be used
to hide the type of client.
2015-02-27 19:58:06 +01:00
Sebastian Thiel
1f655b4eff feat(common): Token type serialization support
This works by storing only timestamps.
Some convenience is provided as well.
2015-02-27 16:34:17 +01:00
Sebastian Thiel
aedc9b6696 feat(common): ConsoleApplicationSecret
A simplel structure to help reading secret files obtained from
https://code.google.com/apis/console
2015-02-27 15:32:26 +01:00
Sebastian Thiel
aa030e8987 fix(common): AuthenticationType implements Str
Instead of an arbitrary `url()` method with the signature of
`to_slice()`
2015-02-27 15:06:50 +01:00
Sebastian Thiel
646a94ac11 fix(device): DeviceFlowHelper fails by default ...
... in case there is a connection error.
Its purpose is to handle the device flow, not to retry if there are
more general problems, like connection errors. However, the user
may implement this differently in his delegate.
2015-02-27 10:39:30 +01:00
Sebastian Thiel
b23bb2459b fix(example-auth): convert UTC to local time
Requires chrono 0.2.3 to work.
Also removed some warnings
2015-02-27 08:29:41 +01:00
Sebastian Thiel
2feddf4f56 initial commit after moving it out of yup/lib 2015-02-26 19:43:15 +01:00