Commit graph

1750 commits

Author SHA1 Message Date
Vincent Ambo
a18dfc5a5e docs(README): Fix crates.io badge URL 2019-02-26 23:11:29 +01:00
Vincent Ambo
9a23a55165 chore(cargo): Bump version to v0.2.0 2019-02-26 23:10:24 +01:00
Vincent Ambo
3530baa4d0 refactor: Add a method per HTTP verb on Request
Instead of the `Request::new` "constructor" for requests, add a method
per HTTP verb which makes the initialisation slightly more concise.
2019-02-26 23:10:24 +01:00
Vincent Ambo
e4e931661b feat: Introduce Response::error_for_status method
This method makes it possible to let users map responses with
unexpected HTTP statuses to custom errors while staying inside a chain
of results.
2019-02-26 22:21:43 +01:00
Vincent Ambo
481825672e feat: Re-export the curl::init method 2019-02-26 18:00:30 +01:00
Vincent Ambo
a039908fc4 test: Add timeouts to HTTP POST tests
Occasionally (and seemingly most commonly in travis-ci), httpbin does
not respond to POST requests.
2019-02-26 17:58:20 +01:00
Vincent Ambo
cf58060fcc feat: Add Request::with_handle method
This method acts as an "escape-hatch" which lets the user configure
whatever they want on the cURL easy handle. No warranty!
2019-02-26 17:55:00 +01:00
Vincent Ambo
df117f855b feat: Add Request::timeout method 2019-02-26 17:54:47 +01:00
Vincent Ambo
acc7e64a0d refactor: Use cURL's own basic auth implementation
Drops the dependency on the base64-crate, which it turns out isn't
necessary as cURL has this built-in.
2019-02-26 17:54:11 +01:00
Vincent Ambo
de86cc551a docs(README): Add badges for travis, docs.rs and crates.io 2019-02-26 17:33:59 +01:00
Vincent Ambo
53489a7bab chore(build): Configure Travis CI builds 2019-02-26 17:30:56 +01:00
Vincent Ambo
2233d15c94 chore(cargo): Prepare Cargo manifest for crate release 2019-02-26 17:30:56 +01:00
Vincent Ambo
f5ab42c147 chore: License under GPL-3.0-or-later 2019-02-26 17:30:56 +01:00
Vincent Ambo
198fe2bffa docs: Update README, add contribution guidelines & CoC
... getting all the docs in order for publication ...
2019-02-26 17:30:53 +01:00
Vincent Ambo
2349dd22c3 feat: Split tls_key_password into a separate function
WHen configuring a PKCS12 certificate it is more useful to be able to
set this separately, as the `tls_client_key` function is never called.
2019-02-26 17:30:53 +01:00
Vincent Ambo
37dc54f2bf feat: Add utility functions for TLS client certificate usage 2019-02-26 17:30:53 +01:00
Vincent Ambo
791e2958fc test: Add test for token-based authentication (bearer_auth) 2019-02-26 17:30:53 +01:00
Vincent Ambo
b493bc3c84 docs(lib): Document available features and update example 2019-02-26 17:30:49 +01:00
Vincent Ambo
de16d9698d feat: Add optional Request::basic_auth utility function
This function adds a dependency on `base64` and is thus gated behind
the (enabled by default) `basic_auth` feature.
2019-02-26 17:30:49 +01:00
Vincent Ambo
bd726c7d4c feat: Add Response::is_success utility method 2019-02-26 17:30:49 +01:00
Vincent Ambo
415e930a07 feat: Add bearer_auth helper function
Adds a helper function for setting `Bearer`-tokens in `Authorization`
headers.
2019-02-26 17:30:49 +01:00
Vincent Ambo
aedfd7c7ac feat: Add support for form-encoded POST bodies 2019-02-26 17:30:49 +01:00
Vincent Ambo
d3a47d3b1c refactor: Move URL & method configuration to send()
This lets the builder proceed without returning a `Result` from the
initial call, which makes for a slightly nicer API.
2019-02-26 17:30:49 +01:00
Vincent Ambo
9ce0098bc0 docs(lib): Update docstrings for rustdoc output 2019-02-26 17:30:45 +01:00
Vincent Ambo
569e10e509 test: Add tests for HTTP verbs & POSTing data 2019-02-26 14:45:06 +01:00
Vincent Ambo
b71b44a672 fix: Correctly configure body sizes before setting read_function 2019-02-26 14:33:42 +01:00
Vincent Ambo
718d945753 refactor: Use mut self-consuming builder functions
Writing the functions this way makes it slightly nicer to chain them
without having to assign the request to an intermediate variable.
2019-02-26 14:33:02 +01:00
Vincent Ambo
c6c1746428 refactor: Introduce json feature and make it optional
Gates support for `serde_json` behind a Cargo feature called `json`
that is enabled by default.
2019-02-26 13:49:43 +01:00
Vincent Ambo
479a6b3442 feat: Support JSON body serialization in requests & responses
Uses `serde_json` to provide serialisation and deserialisation of
request/response bodies.
2019-02-26 13:46:02 +01:00
Vincent Ambo
b28f6e748d feat: Initial check-in of working client layer 2019-02-26 11:20:38 +01:00
Vincent Ambo
e95a82ca4c chore: Initial commit 2019-02-25 18:03:21 +01:00
Vincent Ambo
17060cece3 chore(Cargo): Bump version to 1.0.0
This library has been running in a production codebase for a while and
can be considered stable.

There is a minor breaking change between this version and the previous
0.1.0 in that the `ValidationError` enum has gained additional variants.
2019-02-13 14:18:07 +01:00
Vincent Ambo
cc1ee9c81d fix: Allow trailing bits in base64 encodings
After upgrading the base64 library, tests were failing because the new
default of the library is to disallow trailing bits in JWTs.

Some JWT provider implementations do however use this "forgiving"
version of base64-encoding, hence it is required for token validation.

This adds a base64::Config with the appropriate settings and also
chains base64-errors separately from other token errors.
2019-02-13 14:18:07 +01:00
Vincent Ambo
4051fe0ec8 chore(Cargo): Update base64 dependency 2019-02-13 14:18:07 +01:00
Vincent Ambo
83f1b769fb feat(adho): Add Kulturhuset and Forest & Brown wifis 2019-02-11 14:54:24 +01:00
Vincent Ambo
9b35db823f chore(init): Remove adjust-parens configuration
This package is actually kind of annoying.
2019-02-10 21:43:54 +01:00
Vincent Ambo
09daca2fea fix(init): Move ace-window-display-mode into hook function
For some reason that I can not be bothered to debug this mode will
only work correctly if initialised from inside this hook function (or
manually, after startup).
2019-02-10 21:43:54 +01:00
Vincent Ambo
bdff24f52b fix(init): Initialise ace-window-display-mode on launch 2019-02-10 21:43:54 +01:00
Vincent Ambo
4a53a084a5 feat(mail): Refresh unread mail count more often
Decreases the interval from 90 seconds to 30 seconds.
2019-02-10 21:43:54 +01:00
Vincent Ambo
dd5c880138 chore(nixos): Reshuffle EXWM screen assignment on adho 2019-02-10 21:43:54 +01:00
Vincent Ambo
5b5f051b13 refactor: Reutilise multi-term commands for Alacritty buffers
In practice I never use multi-term, but it's nice to have the same
buffer selection functionality for Alacritty buffers.
2019-02-10 21:43:54 +01:00
Vincent Ambo
2c5946163c fix(nix-mode): Use nix-indent-line as indentation function 2019-02-10 21:43:54 +01:00
Vincent Ambo
0f9136ab88 feat(custom): Enable intero-global-mode 2019-02-10 21:43:54 +01:00
Vincent Ambo
dd2ba5aafc fix: Use indent-relative in Kotlin buffers 2019-02-10 21:43:54 +01:00
Vincent Ambo
ee143eaf14 fix: Run GHCi-workaround /after/ switching to REPL buffer
This simply changes the advice position. This way around makes more
sense in case that the REPL is just being started up.
2019-02-10 21:43:54 +01:00
Vincent Ambo
bab9f15a33 fix: Add temporary workaround for Intero + GHC 8.4 bug
Adds a workaround for commercialhaskell/intero#569 by adding a
function that disables the offending GHCi flag in the Intero REPL, and
advising the `intero-repl` and `intero-repl-load` commands to always
execute it.

I did not manage to locate a common entrypoint to the REPL, but it's
probably not worth spending more time on as this will be fixed
properly in a future GHC release.
2019-02-10 21:43:54 +01:00
Vincent Ambo
0cf7af4403 fix(cargo): Disable keybinding for 'cargo clean' 2019-02-10 21:43:54 +01:00
Vincent Ambo
d74692acf2 chore(custom): Configure Intero to use 0.1.31 backend 2019-02-10 21:43:54 +01:00
Vincent Ambo
e0a8a6f35f feat(functions): Add function to start inferior Erlang via Nix 2019-02-10 21:43:54 +01:00
Vincent Ambo
5b32cd74c6 feat(mail): Add counsel-notmuch support 2019-02-10 21:43:54 +01:00