* More detailed error type for JsonTokenStorage
* removed all traces of rustc_serialize
* use pretty-printers everywhere to allow writing human-readable json
files for secretes and for tokens
Fixes#93
* CallType now represents either Upload or Standard calls, whereas
the Upload variant is represented by the UploadProtocol enum.
That way it's clear what happens, and we don't mix orthogonal concepts
in one enumeration just for convenience.
All tested APIs seem to build, verified
* upload
* download
* request structures
* parameters
* scopes
* config-dir
* debug[-auth]
Fixes#81
* mkdoc docs grammar is now hierarchical, making the command structure
more obvious and easier to understand. It's a nice addition to the
auto-generated, hierachical usage of clap.
* UploadProtocol enum is now CallType, to ease handling the different
ways the Call has to be executed. It looks quite clean, even though
combining upload protocols and the calltype is a bit hacky.
* `--version` now includes the API revision we embody
(using crate_version())
* Allow multiple scopes to be specified, instead of just one. Previously
this was problemantic due to argument parsing of docopt being greedy.
However, this also means we have to specify the `-r` flag for each
invocation. See https://github.com/kbknapp/clap-rs/issues/89 .
* Adapted to new signature of `Arg::possible_values()` and used the
previously orphaned `UploadProtocol` enum.
* Deduplicated code a little by adding the new `opt_values()` generator
function.
Related to #81
We will try to wait for https://github.com/kbknapp/clap-rs/issues/87
to allow us to use the enumeration instead of strings, as well as
an iterator, which will look more idiomatic in the end.
We are currently setting everything up at runtime, and manage to get
nearly all information into it, except for the more complex
`-u (simple|resumable) <file> <mime>` flag.
Fixes#87
Related to #81
We do this in the hopes to circumvent a stack overflow.
This means we will setup the parser entirely at runtime, which actually
saves a little bit of code.
* now the cursor will only be set permanently if the -r flag is used in
'cursor' mode. In 'cursor=value' mode, the cursor change doesn't
persist among the flags. That way, one can easily distinguish
between setting the cursor, and setting a field. However,
'...sublevel.level=value' will still work as it did previously, yet
the cursor change will not persist.
* Documentation was adjusted to represent the new cursor style.
Fixes#86
* 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
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
That way, we can provide better service, as CLIs that consume a lot of
quota can easily have their own app credentials, and with it, their
own quota.
The fallback will be a project that allows to use all possible
google APIs.
The user can always put in his own application secret to use his own
quota or even paid services.
Fixes#80
Previously this case was entirely uncovered.
Interesting note: when a token is revoked, existing auth-tokens will
still work. However, you may not refresh them in case permissions
have been revoked. It's good as there is only one code-path to deal
with (and we verified it to be working), and bad for the user as
malicious software can keep using an account for certain time until
the token expires.
Fixes#79
* with native support for type conversion and error handling
* improved hash-map key-value parsing to at least state that it knows
it's dealing with a hashmap. Error text is still not what it should
be because we don't know at runtime (initially) what type we handle.
Fixes#68
Related to #77
This works already for simple request values, but doens't generate
compiling code for structures with Parts in them.
Nonetheless, it's a big step towards finishing the overall issue.
Related to #64
We handle errors gracefully with costum types and minimal amount of
code. Unfortunately, Mime type parsing is very 'flexible', allowing
nonesense types to be passed easily.
Related to #62
It's implemented in a working fashion, except that the default value
is not currently set to something sensible, causing duplicate errors in
case the key-value syntax is wrong.
Related to #61
We are parsing required scalar values and handle parse-errors correctly,
to the point were we make a simple, non-upload doit() call.
It shows that we seem to build invalid calls, for now,but that's nothing
we can't fix once the time is ripe.
Next goals will be related to finalizing the argument parsing code.
Fixes#60
The hub is just using preset types - we will have to implement our own
storage and auth-delegate, as well as a Hub delegate at some point.
Dry run mode allows us to check for errors and use a call builder
using the very same code.
Fixes#57
* if there is no secret file in json format, we write a default one
that we will then read in a second iteration of the loop.
That way, the user has an example of how such a file must look like.
Next step is to cleanup the error type and implement the Error trait.
Fixes#53
* macro 'alias' was renamed to 'rename'
* fixed `cargo test` on main project
The latter pointed me to the serde issue, which would have made
everything fail when actually used to communicate with google servers.
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
* `ResourceMethodsBuilder` -> `MethodsBuilder`. This is now precise
enough. Previously it was just to similar to what's now a
`CallBuilder`
* Fixed whitespace issue in `doit()`
Previously, it would query the size from the wrong dict and obtain
the value 0 all the time. This would have made every upload fail with
`UploadSizeLimitExeeded`.
Now we obtain the actual size limit, and will ignore it if unset/0
for some reason.
Patch += 1
The delegate logic is implemented and seems sound.
It's somewhat funny that after all this back and forth, all we get
is a valid start position for the upload.