As usage of the `!include` macro is enforced, there is currently no way
to use the exported macros from `yup_hyper_mock`. Now some more
boilerplate code was added to make it work anyway.
* Previously the meta-data was applied to the crate, which doesn't seem
to work.
* attempted to make `examples/auth.rs` work on stable. This isn't
properly tested now, as tests don't compile.
We are now at a state were stable as well as nightly work similarly,
but fail because `include!` doesn't behave correctly if macros are
involved. Namely it happens before crates are linked, yet it will
try to expand macros right away, which is a problem.
If the macro is defined in an empty fashion, it will actually be used
at include time, and expanded. Which causes issues further down the
compilation.
With the current 'fix' we manage to at least make everything but
`cargo test` work.
Related to #12
* It should help to keep track of how to properly call cargo in nightly
mode. After all, I have wasted some time, multiple times just trying
to figure out that I forgot to add the nightly feature.
* Slightly improved structure of lib.rs and includes
Related to #12
It doesn't yet work on nightly due to a panic in
https://goo.gl/RyM4GT
Might have something to do with me being on nightly,
and some cargo-related hickoup.
Due to https://github.com/rust-lang/rust/issues/22252, r-value
temporaries outlive the lifetimes of variables bound with let
statements in a function body. Because of this, device.rs fails to
compile against newer rustc nightlies.
This implements a simple workaround that binds the result of the match
in `request_code` to a local variable before returning it. This allows
it to have the same lifetime as `req` in one of the previous let
bindings.
We would actually fail to decode an error, and then assume it's a valid
result, unwrapping another failed attempt to decode the json string
returned by the server.
Cause seems to be that the json error structure now conains an
additional field, 'error_uri'.
* we removed a debug printing ... .
* incremented version
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
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
* 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
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.
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.
... 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.