Commit Graph

101 Commits

Author SHA1 Message Date
Jamie Turner
20810e32d5 Add a no-openssl feature.
Recently, commits were made to remove support for using rustls/ring
in lieu of OpenSSL to avoid having to add those as dependencies in
environments where OpenSSL already exists.

However, yup-oauth2 is being used in some environments where
*OpenSSL* doesn't exist. So, retaining the option to build
it with an openssl-free stack is key.

Note, the change to hyper-native-tls is fine and actually
unrelated, because this is often happening on Windows or
Mac enviornments, where the stack that will link to is
*not* necessarily OpenSSL either.

For example, the particular breakage that prompted this
CR is a build of yup-oauth2 on iOS. In that environment,
hyper-native-tls uses Apple's Security Framework,
but OpenSSL libraries are not actually present on all
devices/simulator environments. So a link against
a mix of Security Framework and rustls make sense,
there.

Also, update to a newer version of rustls/ring while we're at it.
2019-01-04 12:54:08 -08:00
Jamie Turner
ab4b2c2fd4 Rust 2018 edition modifications. 2019-01-04 12:43:19 -08:00
Igor Gnatenko
3163be984d deps: rustls → openssl
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-07-25 22:51:51 +02:00
Igor Gnatenko
9b5bbf5459 deps: hyper-rustls → hyper-native-tls
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-07-25 22:51:37 +02:00
Igor Gnatenko
78cefeab47 deps: update url to 1
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-07-25 22:50:45 +02:00
Igor Gnatenko
e634d3f139 deps: update chrono to 0.4
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-07-25 22:47:52 +02:00
Mark Catley
f529404ccb docs: update the example to use the hyper tls connector
This is required to use tls apis hyper 0.10. The example uses a tls api, so this is required.

Closes #52
2018-05-07 12:24:55 +12:00
Martell Malone
f6d0fa0260 feat(jwt): use rustls and remove openssl
This removes the need for the remaining C interfaces.
Building any rust library with openssl adds a bunch
of depends such as foreign types via ffi and pkgconfg.
You are also required to have a prebuilt openssl.
Cross building and keeping up to date should be easier
with a pure rust implementation.
2017-06-26 16:29:56 +01:00
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