Brian Smith
22a3076924
Update dependencies.
...
The current Git master doesn't build with Rust 1.17 because the
version of Rustls used on master doesn't built with Rust 1.17.
* Update the base64 dependency to ensure the version with a buffer
overflow fix is used.
* Update hyper-rustls to one that uses a version of Rustls that builds
with Rust 1.17, and that uses *ring* 0.9+, to ensure there are no
problems with accidentally linking multiple versions of *ring*, to make
the build easier to set up (especially on Windows), and to keep things
working once *ring* 0.7.* gets yanked.
* Update the rust-openssl dependency while we're at it.
2017-05-09 10:42:32 -10:00
OZ
09488622a7
Make "sub" argument simple String in with_sub constructor
2017-02-26 01:23:20 +01:00
OZ
4e45d4358d
Add with_sub method for ServiceAccountKey - required to read email from user accounts
2017-02-22 03:50:21 +01:00
Lewin Bormann
38fd851493
fix(service_account): Fix bad PR #51 : JWTs need RSA signatures.
2017-02-04 17:03:47 +01:00
Sebastian Thiel
59584b240e
imp(serde):use proc_macros and serde-derive
...
With Rust 1.15, proc macros have been stabilized. Therefore
custom build scripts are not required anymore.
This commit removes all the previous machinery and the
need for nightly.
2017-02-03 06:40:00 +01:00
Lewin Bormann
d4ebbc47b2
chore(language): Sort imports and migrate from deprecated types.
...
std:#️⃣ :SipHasher is not std::collections::hash_map::DefaultHasher
(really!?).
Imports were unordered.
2017-01-31 19:27:50 +01:00
Lewin Bormann
567ff12cd4
fix(deps): Fix dependency problems and openssl test failure.
...
Sigh, #51 again.
2017-01-31 18:54:07 +01:00
Lewin Bormann
1639b1648f
Revert "fix(openssl): Update to 0.9.x"
...
The patch introduced an unwrap() failure in a test.
This reverts commit fe0a094b45 .
2017-01-30 19:54:12 +01:00
Martell Malone
fe0a094b45
fix(openssl): Update to 0.9.x
...
This also updates hyper to 0.10.x because it uses openssl
2017-01-26 10:56:47 +00:00
Lewin Bormann
608b2af781
doc(service_account): auth/token URIs aren't hardcoded anymore
...
Instead, they're taken from the ServiceAccountKey JSON structure.
2016-12-23 10:00:40 +01:00
Sebastian Thiel
11baf2f712
fix(serde): use serde_derive
...
serde_macros is no longer maintained and will eventually
fail on nightly.
Also in a hopefully not-so-distant future, we will be able
to use macros 1.1 in stable, and thus get rid of the
complication required for the hybrid approach.
2016-10-09 16:38:52 +02:00
Lewin Bormann
a8479b8ddb
feat(device): Make the Device flow independent of Google
...
This is a breaking change; it's supposed to fix #1 . Also, it's a
proposal -- not sure if the benefits outweigh the cost of this.
The example/auth.rs binary is not broken by this, as it doesn't use the
API that changed. The tests have been updated accordingly.
2016-10-09 09:55:33 +02:00
Lewin Bormann
08d79de313
fix(tests): A deactivated key leads to "Signature errors"
2016-10-01 15:40:45 +02:00
Lewin Bormann
970d188794
feat(service_account): Enable service account oauth with other providers
...
The Token URI is already in the client key, so we should just use that
information instead of hardcoding it.
2016-10-01 15:33:55 +02:00
Lewin Bormann
2b77d01229
Merge pull request #40 from dermesser/crate-docs
...
docs(crate): Update crate documentation
2016-09-28 22:15:22 +02:00
Lewin Bormann
b143033ad1
fix(service_account): Use correct base64 encoding
2016-09-28 21:45:10 +02:00
Lewin Bormann
69c43287e7
docs(crate): Update crate documentation
...
Please regenerate the documentation in `gh-pages`.
2016-09-28 21:19:43 +02:00
Lewin Bormann
a4d60e754b
fix(deps): Use small base64 crate instead of rustc-serialize
2016-09-28 20:10:53 +02:00
Lewin Bormann
3cf00eb1cf
docs(crate): Add a short snippet about service account auth.
2016-09-21 22:50:23 +02:00
Lewin Bormann
ed0a3c4990
fix(types::Token): Don't panic if refresh_token is empty
...
Service account tokens don't set the refresh_token. Checking the
access_token field should be sufficient.
2016-09-21 09:24:09 +02:00
Lewin Bormann
943f57e42f
fix(service_account): Remove debug println from code
...
whoops :)
2016-09-21 09:03:51 +02:00
Lewin Bormann
624a202464
docs(helpers): Let service account and helper code show up in rustdoc
2016-09-21 08:39:47 +02:00
Lewin Bormann
1c1880cfe7
feat(service_account): Implement token source for service accounts
...
Tested with unit tests and against Google OAuth.
2016-09-20 20:29:19 +02:00
Lewin Bormann
d151e75454
feat(helpers): Add service account key helper
2016-09-20 20:19:10 +02:00
Lewin Bormann
0506ffaa44
feat(helpers): Implement hash_scope() helper function
2016-09-20 20:19:00 +02:00
Lewin Bormann
2bdb47375a
feat(refactor): Move StringError from authenticator to types module
2016-09-20 20:18:45 +02:00
Lewin Bormann
51e0b9d163
docs(installed): Mention the InstalledFlow in the documentation
2016-09-04 19:29:56 +02:00
Lewin Bormann
cb66737988
fix(test): Add missing import to authenticator tests
2016-09-04 19:20:59 +02:00
Lewin Bormann
a4532f27b4
fix(helper): Parse app secrets into right type
2016-08-31 20:46:10 +02:00
Lewin Bormann
c4231e9499
feat(helpers): Add helpers for reading/parsing JSON
...
This is boilerplate that can easily be provided to users of the library.
2016-08-31 20:07:33 +02:00
Lewin Bormann
85b12dd3e8
refactor(common): Rename common -> types
2016-08-31 20:01:24 +02:00
Lewin Bormann
9e59bf0496
refactor(all): More flows demand for a different structure
...
I mainly resolved some circular dependencies that had crept in, and
moved code around. I renamed helper.rs because that was not really an
appropriate name anymore, and moved the delegate code into a new module.
2016-08-31 19:48:38 +02:00
Sebastian Thiel
7a907eb318
fix(dependencies): use latest version of serde_codegen
...
In the way it's meant to be used, which means it uses it's
own version of syntex, to assure it doesn't clash anymore in
unforseen ways.
2016-07-17 11:36:21 +02:00
Sebastian Thiel
57a3151d4d
fix(flows): save Token properly
...
The installed flow didn't explicitly set the retrieved token
absolute, which would cause failures down the road.
2016-05-20 18:24:28 +02:00
Sebastian Thiel
31bad1ae53
chore(features): rename with_syntex to with-syntex
...
This makes the name similar to the one used in quasi, aster, serde
and the likes.
2016-05-20 14:57:09 +02:00
Sebastian Thiel
a3bc7e88b5
chore(serde): upgrade to latest version for stable
...
Now it builds with stable too, it appears.
2016-05-20 12:15:23 +02:00
Sebastian Thiel
22bb255a55
fix(dependencies): work with latest dependencies on nightly
...
Stable doesn't quite work yet due to the cargo issue further
described [here][cargo-issue]
[cargo-issue]: https://github.com/rust-lang/cargo/issues/2064
2016-05-20 08:57:06 +02:00
Sebastian Thiel
815d8863ed
Merge branch 'disk-token-storage' of https://github.com/dermesser/yup-oauth2 into all-upgrades
2016-05-20 07:58:14 +02:00
Lewin Bormann
a7e8423fe0
refactor(installedflow): Apply suggestions from PR
2016-04-27 19:25:40 +02:00
Lewin Bormann
ae5e94bf7b
fix(DiskTokenStorage): make DiskTokenStorage::new() return a Result<>
2016-04-25 19:14:53 +02:00
Lewin Bormann
b039dc0cdc
refactor(installedflow): use app secret instead of single params
2016-04-16 21:02:57 +02:00
Lewin Bormann
9b31070edb
fix(installed): Genericize token/auth URI
...
This means that in theory other providers besides Google could be used.
2016-04-16 20:54:11 +02:00
Lewin Bormann
77355888f2
feat(flows): Implement flow for installed apps
...
The "Installed App Flow" requires user interaction; we first generate a
URL that the user has to navigate to. Then, the user either pastes a
displayed code into the app being authorized, or the OAuth provider
redirects the user's browser to a webserver that is running on
localhost. This webserver is provided by the library and the flow should
work automatically. Extensive documentation can be found here:
https://developers.google.com/identity/protocols/OAuth2InstalledApp
An example for the InstalledFlow with the Drive API is here:
https://gist.github.com/dermesser/8c915ec4c88ee8e8927e7d40b276ca52
2016-04-16 14:45:45 +00:00
Lewin Bormann
2cb5250e72
feat(storage): Implement DiskTokenStorage
...
DiskTokenStorage is a TokenStorage that stores its tokens in a JSON file
on disk. That file can be read in later, and the tokens in it reused.
(The idea for a cache file is from here:
https://developers.google.com/drive/v3/web/quickstart/go )
2016-04-15 19:42:50 +00:00
Sebastian Thiel
c18ae07bbb
imp(duration): use std::time::Duration everywhere
...
This gets rid of the time crate, which was necessary only while Duration wasn't stable
in std.
2016-02-07 10:09:36 +01:00
Sebastian Thiel
c039db56cd
fix(secret): allow project_id field
...
It seems to be part of the google secrets now ... lets see if this improves anything
2016-02-07 09:37:34 +01:00
Sebastian Thiel
850ddbf5ba
fix(rustup): add now mandatory lifetimes
...
fixes #13
2015-12-23 18:34:29 +01:00
Sebastian Thiel
ad0bde3092
fix(tests): assure tests actually work
...
Previously we simply forgot to run the tests, and published test-code
that didn't really work.
2015-08-08 11:45:53 +02:00
Sebastian Thiel
a169d9610d
chore(serde): update to serde 0.5.0
...
Serde move all json code into a separate crate, which we are now pulling
in separately.
2015-08-08 10:40:14 +02:00
Sebastian Thiel
624ec51e8f
chore(build.rs): moved into src/ dir
2015-06-24 16:34:53 +02:00