This upgrade Hyper to v0.12 and updats to code to work for it. It has
being done with the minimum code change and so the logic is still
aukward for the futures model. This should be addressed in later commits
but I did not want to compilcate an already large commit.
Use the power of the `AsRef` trait to take generic parameters for
several API functions. This makes the API more ergonomic because the
callers may pass in static `str` slices or references to owned `String`s
or even more exotic things like a `Cow`, all based on their particular
situation.
Update the tests and examples to use the most natural types they have
available.
Fixes#77. No existing code should break, as `&String` implements
`AsRef<str>` and `AsRef<Path>`
For custom AuthenticatorDelegate implementations it may be very weird to
be required to return an additional character after the code from
present_user_url.
One may find himself chasing the bug which is bad UX for the user.
Improve this behavior and therefore introduce a breaking change that
will hopefully not break existing implementations nevertheless.
When implementing AuthenticatorDelegate one might want to change the
redirect_uri to use an authorized domain or just change the way
InstalledFlow works.
Add a redirect_uri method to AuthenticatorDelegate that may be
implemented to define a custom redirect uri if needed.
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.
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.
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.