Commit Graph

50 Commits

Author SHA1 Message Date
JohnDimas
6d0a9740da Resolves 'Panic on http2 timeout ' 2022-07-21 14:57:37 +02:00
David Schmitt
7293ff5b10 Fix the client source to pass cargo test
* change `http::Uri` -> `hyper::http::Uri`
* add dependency on `tower-service`
2022-06-03 21:03:54 +01:00
Kyle Gentle
c5ff239961 feat(Hub): Support custom connectors
Switch the constraints on Hub types to use public traits based on
tower::service, as recommended by Hyper. This enables support for
custom connectors beyond hyper_rustls::HttpsConnector

Closes #337.
2022-06-01 21:12:32 -04:00
Federico Cergol
544be6d2a2 refactor: remove various errors structs
BREAKING CHANGE: removed errors structs exposed in the Delegate and as return value from the `doit` methods
2022-03-07 22:32:33 +01:00
Sebastian Thiel
74621c9c37 Explicitly specify Send requirement where dyn traits are used (#296) 2021-08-26 09:05:39 +08:00
Sebastian Thiel
a22c18725c Make ReadSeek require 'Send', related to #294 2021-08-25 07:52:02 +08:00
Remco Bloemen
33e83bb610 Correct multipart line endings 2021-08-04 09:37:06 +08:00
Petter Rasmussen
19088aa178 Fix resumable uploads
Only increment the start offset when the response is successful and seek
to the start offset on each iteration.
2021-06-06 15:08:33 +02:00
Dennis Vestergaard Værum
6d56955037 Bug-fix for the upload error: Failed at uploading 'client requires absolute-form URIs' 2021-04-19 14:55:32 +02:00
Sebastian Thiel
3b087bf3e2 Assuure Delegate is Send (#271) 2021-04-14 16:30:53 +08:00
Sebastian Thiel
9c339da955 Simplify type system to leverage 'Sync' types
These are generally available now that we use hyper's async
APIs along with the most recent yup-hypermock.
2021-04-14 09:52:27 +08:00
Sebastian Thiel
fe6ccfed3f Remove RefCell around autenticator - they are sync now 2021-04-14 09:38:07 +08:00
Sergiu Puscas
819e1ccce5 std::iter not needed 2021-04-05 18:44:00 +02:00
Sergiu Puscas
83fed44db0 Run code through cargo fmt. 2021-04-05 18:41:44 +02:00
Sergiu Puscas
6ec46827e7 Fix clippy warnings. 2021-04-05 18:41:17 +02:00
Sergiu Puscas
30ea80bf31 Use hyper::body::to_bytes() instead of aggregate().
This should not truncate the content.
2021-04-05 18:27:43 +02:00
Dennis Vestergaard Værum
1f776ddc54 Bug fix: It was not possible to use FileGetCall to download binary files 2021-04-02 07:53:48 +02:00
Sebastian Thiel
891f126a56 Groupsmigration compiles 2021-04-01 09:58:13 +08:00
Daniel Rodgers-Pryor
b8a66bc666 Update hyper, rustls and yup-oauth2
I've switched to a new M1 laptop which couldn't build the old dependencies because the old ring library version doesn't compile on mac arm (but new version do). There's no way to update ring in isolation, so I've got to update the whole tree at once.
2021-02-04 23:49:07 +11:00
Sebastian Thiel
b88e1633ed Fix rust compile warnings 2021-01-06 22:45:28 +08:00
Petros Angelatos
af73936b95 rename cmn to client
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 00:46:06 +01:00
Petros Angelatos
b5923b277c use direct references to types to generate documentation
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2020-12-19 00:44:20 +01:00
Sebastian Thiel
65b8f0063d Rewrite deprecated features, such as try!
As taken from
https://github.com/Byron/google-apis-rs/pull/247
2020-01-18 14:46:53 +08:00
Sebastian Thiel
bcc72e4fc1 Fields in Error related structs are now accessible
Fixes #239
2019-09-09 08:12:17 +02:00
Chris Pick
499416c011 fix(rust): teach remove_json_null_values arrays
change `remove_json_null_values()` to properly remove nulls from and recurse in to arrays
google_firestore1_beta1's `CommitRequest` contains an array of `Write` objects which can ultimately
contain `Value` members that need to have nulls removed to avoid sending multiple types of values
which generates a 400 response

fixes calls to google_firestore1_beta1's `hub.projects().databases_documents_commit()`
2019-07-03 18:27:27 +08:00
Greg Dallavalle
8f47126103 Fix typo Requst->Request 2017-01-12 12:33:33 -06:00
Sebastian Thiel
e7721ce53b chore(cleanup): remove workaround marker
... and some left-over comments.

The workaround code is actually more readable than the previous version,
so it may as well stay.

Fixes #109
2016-07-17 13:56:25 +02:00
Sebastian Thiel
065cfdd22f fix(lib): use hyper Bearer header style
Considering we kind-of hardcoded this authentication type anyway,
we now use the Auth-types provided by hyper 0.8.

The incentive here was the compiler telling us that there the
yup-oauth::Scheme type doesn't implement the hyper::authorization::Scheme
anymore, even though that clearly was the case. Also it couldn't be
reproduced in yup-oauth itself.

This will need some work to get correct again, so this is just a crude
patch to make it work again.
2016-04-10 13:01:18 +02:00
Sebastian Thiel
a2c6b58d5b fix(versionup): use latest oauth2 lib
It enables using std::time::Duration natively
2016-01-30 14:03:15 +01:00
Sebastian Thiel
b54acb7c96 fix(rustup): use std::Thread::sleep
However, in sibling libraries, we still use time::Duration, which
now is a part of std::time::Duration.
These should be adjusted, to make the usage of
sleep(Duration::from_millis(d.num_milliseconds() as u64)) into sleep(d)
2016-01-29 18:56:58 +01:00
Curtis McEnroe
61e74d99a2 Fix impl of hyper::net::NetworkStream 2015-11-29 17:55:35 -05:00
Sebastian Thiel
8ab4fd0bd4 fix(serde-up): update to serde 0.5.0
Serde move all json code into a separate crate that we are now using
as well.
2015-08-08 10:55:21 +02:00
Sebastian Thiel
d0491a4950 fix(hyper-up): work with hyper v0.6.0
Currently the latter actually fails to link on OSX, and requires a local
override with [this fix](https://goo.gl/OTExmN).
2015-06-26 15:49:30 +02:00
Sebastian Thiel
2ad8d887cd fix(api): minor fixes
* Mime crate must be used in the same version hyper uses
* made attempted move a borrow
2015-06-19 11:41:29 +02:00
Sebastian Thiel
5483e32832 fix(api): expanded header implementation
Now it compiles to the point where `Mime` appears as duplicate type,
for some reason.
2015-06-19 11:34:57 +02:00
Sebastian Thiel
b0a41c4e78 fix(api): first big step towards syntex
Even though there is a bug that caues {} to be used in stead of
(),
when exanding macros, which causes syntax errors that we have to
workaround, it's not a real issue.

What's happening additionally is missing hyper macros, which
now have to be expanded manually. Shouldn't be a problem,
pretty-printing when compiling is made for just that ;).

No, it's sad that `include!()` works so badly, it makes
using serde so difficult ... it's no fun i must say.

Just for stable ... I am not sure if it is worth it."
2015-06-18 22:51:17 +02:00
Sebastian Thiel
ee84fefb4a fix(rustup): deal with rustc lifetime issue
Related to #109
2015-05-11 10:56:36 +02:00
Sebastian Thiel
e86e55cae7 imp(API): improved display of BadRequest
Previously you would only see "BadRequest ... " without the information
that would actually help you to understand what the cause of the issue
is.
Now we will print all the information we have, accordingly, which
greatly improves usability.

Closes #103
[skip ci]
2015-05-09 19:15:16 +02:00
Sebastian Thiel
3fe2732a01 fix(compat): upgrade to hyper v0.4.0
It was basically just a find-and-replace to adapt to the changed names
of Error and Result types.
2015-05-08 11:52:28 +02:00
Sebastian Thiel
c346645fc9 fix(API): let delegate forget uploaded urls
When uploading using the resumable protocol, we are now telling the
delegate to forget the previously stored URL after successful upload.
Previously it would have tried to return such a URL and thus made
the system retry uploading a file that was already uploaded.

Fixes #85
[skip ci]
2015-05-01 16:24:31 +02:00
Sebastian Thiel
4115d50ca7 fix(API): adjust to latest hyper header macros 2015-04-30 11:15:48 +02:00
Sebastian Thiel
2f3b2d24ce fix(CLI): simple and resumable upload works
* fixed boundary syntax of multi-part message. Was --BOUNDARY, now is
  --BOUNDARY--
* Fixed ContentRange parsing and serialization. We actually managed
  to break it last time we tried to update it to match the Go
  implementation.
* fixed uploadType header parameter. It's based on chosen protocol and
  whether or not the method supports multipart operation for the given
  protocol.

Related to #76
2015-04-25 18:45:37 +02:00
Sebastian Thiel
a328942033 feat(API): improved error handling
We are now able to decode detailed errors and pass them on. This allows
the CLI to provide more useful error responses.
Additionally, the CLI will only print debug responses in --debug mode.

Fixes #82
2015-04-25 09:49:57 +02:00
Sebastian Thiel
e523ddb6ec fix(API): adapt to changed yup-oauth2 API
The latter changed a lot, to the better, and we handle the new
return types accordingly.

Related to #74
2015-04-23 17:07:28 +02:00
Sebastian Thiel
7dc9972445 feat(API): Display + Error traits for Error struct
* improved documentation about error handling, it's less verbose yet
  explains what you can do.

Fixes #56
2015-04-14 10:28:59 +02:00
Sebastian Thiel
be228f1994 feat(CLI): engine checks resource and method args
We are now at a spot where we can actually start parsing arguments.

* ArgumentError -> ClIError - seems more fitting

Fixes #55
2015-04-14 09:41:55 +02:00
Sebastian Thiel
b9a469c0a4 fix(cmn): use bytes=... when sending as well
Previously, `bytes=` was just parsed, but not sent to the server.
This change is motivated by a similar change in this commit:
http://goo.gl/AvyvLb
2015-04-11 09:31:23 +02:00
Sebastian Thiel
191e822c5a fix(hyper-client): adjust to hyper client
* deal with hyper client not using a type-parameter anymore
* fix incorrect documentation link (use '_' instead of '-')

Fixes #47
2015-04-08 16:51:46 +02:00
Sebastian Thiel
91861dcb71 fix(rustup): rustc (be9bd7c93 2015-04-05)
* using std::convert
* update to latest hyper (and other dependencies)

Related to #46
2015-04-07 11:59:10 +02:00
Sebastian Thiel
cefd606b53 feat(make): cli depends on API, generically
This allows us to build efficiently. CLI programs can now have their
own cmn.rs implementation, which we can test standalone with
`cargo test`.

The primary makefile currently just explicitly pulls in the type-*.yaml,
one day we could possibly put it into a loop.

Fixes #11
2015-03-24 12:56:24 +01:00