Commit Graph

163 Commits

Author SHA1 Message Date
Lewin Bormann
8762896a4c Release v6.5.0 with #170 2022-04-01 20:12:52 -07:00
Lewin Bormann
3797ff773a Release v6.4.0
Includes #172
2022-03-20 09:20:50 +01:00
Sarah Bird
2128772d88 Replace chrono with time 2022-03-11 19:39:11 -06:00
Lewin Bormann
4b414ca775 Minor fix in doc test: Publish v6.3.1 2022-02-24 13:43:10 +01:00
Lewin Bormann
3e6d260e97 Publish version v6.3.0 2022-02-24 13:38:11 +01:00
Lewin Bormann
9b81a7183e Make rustls dependency optional by introducing "service_account" feature
Now, service_account code must be (implicitly) enabled.

Asked for in feature #168
2022-02-22 20:10:39 +01:00
Lewin Bormann
d61ab104e4 Release v6.2.0
Including

* #166 Add ID token support
* #167 feat(helper): add parse_service_account_key() function

Thank you @bjornwein!
2021-12-27 11:21:50 +01:00
Lewin Bormann
f7e5ff399e Release v6.1.0
containing

- #164: GCP application default credentials. Thank you @ingwinlu,
  @braincow!
2021-12-02 10:48:35 +01:00
Antti Peltonen
7638946508 work started on adc implementation 2021-11-21 09:57:06 +01:00
Lewin Bormann
5d0e431772 Publish v6 2021-09-27 11:45:08 +02:00
Simonas Kazlauskas
469f045247 Use a test matrix to test feature combinations 2021-06-29 14:07:53 +03:00
Simonas Kazlauskas
dd004fed3c Implement an ability to work without default client 2021-06-29 13:30:40 +03:00
Simonas Kazlauskas
d385601433 --all-features and --no-default-features
This adjusts the code and documentation for `--all-features` and
`--no-default-features` to work correctly. With `--no-default-features`
no `DefaultAuthenticator` is made available. Users are in control of
picking the `Connector` they want to use, and are not forced to stomach
a dependency on `rustls` or `hyper-tls` if their TLS implementation of
choice doesn't happen to match one of the two.

To indicate this, the unstable `doc_cfg` feature is used to build
documentation on docs.rs. That way the generated documentation has
notices on these types that look as such:

> This is supported on crate features hyper-rustls or hyper-tls only.

Additionally this functionality is tested via additional coverage in the
Actions' CI.
2021-06-29 12:57:57 +03:00
Lewin Bormann
e63aa4b843 Merge pull request #146 from djrodgerspryor/custom_storage_options
Custom token storage
2021-04-01 22:53:36 +02:00
Lewin Bormann
376de2aa8c Release v5.1.0
Now, Authenticator can be cloned. #133 #151
2021-03-06 10:23:01 +01:00
Lewin Bormann
e3b2509753 Make drive_example compile and add warning 2021-03-04 11:40:36 +01:00
Daniel Rodgers-Pryor
5ef498f801 Custom token storage
Allow users to build their own token storage system by implementing the `TokenStorage` trait. This allows use of more secure storage mechanisms like OS keychains, encrypted files, or secret-management tools.

Custom storage providers are Box-ed to avoid adding more generics to the API — the indirection cost will only apply if using a custom store.

I've added `anyhow` to allow easy handling of a wide range of errors from custom storage providers.
2021-02-06 22:59:00 +11:00
Lewin Bormann
00574f278b Release v5.0.3
for #147 / #144
2021-02-05 09:03:53 +01:00
Lyon Beckers
5b1facf7a0 Merge branch 'master' of https://github.com/lyonbeckers/yup-oauth2 into option_hyper_tls 2021-02-01 07:18:48 -07:00
Lyon Beckers
26db4b6efc introduced a feature which allows the use of hyper-tls instead of hyper-rustls 2021-01-29 16:58:06 -07:00
Lewin Bormann
75e402412f Release v5.0.2
Includes fix to #141
2021-01-29 21:47:05 +01:00
Lewin Bormann
afec480587 Release v5.0.1 with stable Tokio 2020-12-29 08:39:58 +01:00
Lewin Bormann
864f918496 Merge pull request #138 from maximebedard/bump-tokio-0-3
Bump to tokio 1.0 and hyper 0.14
2020-12-27 09:05:14 +01:00
Maxime Bedard
07bc4803c0 update hyper-rustls to 0.22 2020-12-26 19:30:43 -05:00
Maxime Bedard
63b185b711 use released version of httptest 2020-12-24 16:37:35 -05:00
Maxime Bedard
ec28689080 bump hyper=0.14, tokio=1.0, hyper-rustls, httptest 2020-12-24 09:31:18 -05:00
Michael Kefeder
adc99a10ec example showing howto implement a custom flow, here opening the
default webbrowser with the oauth2 URL for the installed flow.
2020-11-16 09:52:08 +01:00
Maxime Bedard
4026d92cf6 Bump to tokio 0.3 and hyper 0.14 2020-11-12 20:31:19 -05:00
Lewin Bormann
2f50876002 Release v4.1.3 2020-10-27 11:11:33 +01:00
Lewin Bormann
4660676073 Revert "Upgrade tokio -> 0.3: Bump version to v5.0.0"
This reverts commit e07bc6f471.

Hyper and tokio 0.3 don't work together yet.
2020-10-20 17:47:39 +02:00
Lewin Bormann
e07bc6f471 Upgrade tokio -> 0.3: Bump version to v5.0.0 2020-10-20 16:28:46 +02:00
Lewin Bormann
55a8984c81 Another slight update to README 2020-10-18 22:42:14 +02:00
Lewin Bormann
3221e8986a chore(version): Publish v4.1.2 2020-05-01 20:36:01 +02:00
George Hahn
4b1262933b Update dependencies 2020-05-01 11:52:23 -05:00
Lewin Bormann
6fe83abf61 chore(version): release 4.1.1 for #127
fixes #128
2020-04-29 18:16:07 +02:00
Abdul Rehman
09d1f05a00 feat: Use futures-aware mutex 2020-04-06 15:31:49 +05:00
Lewin Bormann
c5bad4c209 chore(version): Release 4.1.0 2020-03-17 10:55:25 +01:00
Lewin Bormann
a80984d219 chore(version): Release 4.0.2
Update dependencies (#124)
2020-02-15 20:04:14 +01:00
Simonas Kazlauskas
05ee4a4cee chore(*): update the dependencies 2020-02-06 23:20:26 +02:00
Lewin Bormann
d17bbb719c chore(version): Release 4.0.1 2020-02-05 21:45:04 +01:00
Lewin Bormann
26513ec63c chore(version): Release 4.0.0 2020-02-05 21:44:38 +01:00
Glenn Griffin
f00bc5cb35 Update to httptest v0.11.1 2020-02-05 12:13:00 -08:00
Glenn Griffin
1d5c3a4512 Switch from mockito to httptest 2019-12-18 09:07:45 -08:00
Glenn Griffin
9238153723 Move to hyper 0.13.1!!!! 2019-12-18 09:07:45 -08:00
Glenn Griffin
5e39a81894 Go back to waiting for disk writes on every token set.
Defering disk writes is still probably a good idea, but unfortunately
there are some tradeoffs with rust's async story that make it non-ideal.
Ideally we would defer writes, but have a Drop impl on DiskStorage that
waited for all the deferred writes to complete. While it's trival to
create a future that waits for all deferred writes to finish it's not
currently possible to write a Drop impl that waits on a future.

It would be possible to write an inherent async fn that takes self by
value and waits for the writes, but that method would need to be
propogated up all the way to users of the library and they would need to
remember to invoke it before dropping the Authenticator.
2019-12-18 09:07:45 -08:00
Glenn Griffin
0525926bb2 Improve Token
Remove expires_in in favor of only having an expires_at DateTime field.
Add a from_json method that deserializes from json data into the
appropriate Token (or Error) and use that consistently throughout the
codebase.
2019-12-18 09:07:45 -08:00
Glenn Griffin
089c6ba212 Use seahash rather that DefaultHasher.
DefaultHasher is not documented as being consistent. It's best to not
trust that the resulting hash value is consistent even across different
executions of the same binary and even more so across different
versions.
2019-12-18 09:06:33 -08:00
Glenn Griffin
b6b48594b9 Remove dev-dependencies that are no longer used.
These appear to only be used by examples in the old/ directory which has
not compiled for a long time. Not sure why the contents of that
directory are still around.
2019-12-18 08:59:43 -08:00
Glenn Griffin
e5aa32b3cf Tidy up some imports.
No more need to macro_use serde. Order the imports consistently (albeit
somewhat arbitrary), starting with items from this crate, followed by
std, followed by external crates.
2019-12-18 08:59:43 -08:00
Glenn Griffin
88a8f74406 Refactor token storage.
The current code uses standard blocking i/o operations (std::fs::*) this
is problematic as it would block the entire futures executor waiting for
i/o.

This change is a major refactoring to make the token storage mechansim
async i/o friendly. The first major decision was to abandon the GetToken
trait. The trait is only implemented internally and there was no
mechanism for users to provide their own, but async fn's are not
currently supported in trait impls so keeping the trait would have
required Boxing futures. This probably would have been fine, but seemed
unnecessary. Instead of a trait the storage mechanism is just an enum
with a choice between Memory and Disk storage.

The DiskStorage works primarily as it did before, rewriting the entire
contents of the file on every set() invocation. The only difference is
that we now defer the actual writing to a separate task so that it does
not block the return of the Token to the user. If disk i/o is too slow
to keep up with the rate of incoming writes it will push back and
will eventually block the return of tokens, this is to prevent a buildup
of in-flight requests. One major drawback to this approach is that any
errors that happen on write are simply logged and no delegate function
is invoked on error because the delegate no longer has the ability to
say to sleep, retry, etc.
2019-12-18 08:57:24 -08:00