Commit Graph

138 Commits

Author SHA1 Message Date
dependabot[bot]
418c0fafd5 Update rustls-native-certs requirement from 0.5 to 0.6 (#432)
Updates the requirements on [rustls-native-certs](https://github.com/ctz/rustls-native-certs) to permit the latest version.
- [Release notes](https://github.com/ctz/rustls-native-certs/releases)
- [Commits](https://github.com/ctz/rustls-native-certs/compare/v/0.5.0...v/0.6.0)

---
updated-dependencies:
- dependency-name: rustls-native-certs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-12 22:06:40 -08:00
Jacob Hoffman-Andrews
9587a6cc8e Update CHANGELOG and Cargo.toml for 2.3.0 (#431) 2021-10-21 11:39:43 -07:00
Jacob Hoffman-Andrews
f22e67be4c Fix agent test. 2021-10-21 07:38:59 +02:00
Jacob Hoffman-Andrews
848eb7be38 Match versions of rustls 2021-10-21 07:38:59 +02:00
Jacob Hoffman-Andrews
5fa912c4d3 Update to rustls 0.20, webpki 0.22 2021-10-21 07:38:59 +02:00
Martin Algesten
a1d7009e24 2.2.0 2021-08-23 21:32:42 +02:00
Martin Algesten
551f4289fb Update all dependencies
webpki and webpki roots are not compatible with current rustls,
so they are held back.:wq
2021-08-23 21:21:39 +02:00
Keijia
e198a5169b bump socks to 0.3.3 2021-08-23 20:46:44 +02:00
Jacob Hoffman-Andrews
c0d7157ae7 Update CHANGELOG and Cargo.toml for 2.1.1 (#376) 2021-04-26 11:00:53 -07:00
Malloc Voidstar
2f1f9c45aa Fix typo, disable default features of cookie 2021-04-10 16:28:54 +02:00
Martin Algesten
e70fdcc797 2.1.0 2021-03-26 07:45:11 +01:00
Martin Algesten
c5c40cf138 Stop percent encoding cookies 2021-03-24 20:09:27 +01:00
Jacob Hoffman-Andrews
9ec4e7192a Add -k option to cureq example (#342)
By analogy with curl, this turns off certificate verification. Requires
enabling the "dangerous_configuration" feature in the rustls dependency.
2021-03-23 17:00:32 -07:00
Martin Algesten
9a9dd4ee6c Upgrade cookie to 0.15 and cookie_store to 0.13.0
cookie_store default features pulls in reqwest, so we stop that
by specifying the exact features wanted.
2021-03-14 19:00:28 +01:00
Jacob Hoffman-Andrews
6f86ee7f93 Add example "cureq". (#330)
Contrary to smoke-test, this takes full URLs on the commandline and
prints their contents to stdout. This makes it easier to test behavior
with specific URLs. I hope to later add flags for various behaviors like
printing headers, following redirects, enabling / disabling cookies,
and verbose output.

Also add a useful debug line when receiving a cookie header.
2021-02-21 14:26:12 -08:00
Martin Algesten
c833acfe5c 2.0.2 2021-02-21 09:30:57 +01:00
Jacob Hoffman-Andrews
96985956aa Bump to 2.0.1.
Brings in a fix to 308 redirects.
2021-01-03 17:52:38 -08:00
Jacob Hoffman-Andrews
6390558415 Update CHANGELOG for 2.0.0. 2021-01-03 21:07:09 +01:00
Jacob Hoffman-Andrews
234eb5572f Update CHANGELOG and Cargo.toml for 2.0.0-rc4 (#279) 2020-12-19 12:11:38 -08:00
Jacob Hoffman-Andrews
1448969dd7 Increment version to 2.0.0-rc3 2020-12-12 09:27:50 -08:00
messense
df1f4bd0e1 Replace unmaintained encoding crate with encoding_rs 2020-11-29 19:38:39 +01:00
Jacob Hoffman-Andrews
a0b88926fa Remove a keyword from Cargo.toml. (#250)
Crates has a max of 5 keywords.
2020-11-23 00:02:01 -08:00
Jacob Hoffman-Andrews
0e5cb2d018 Merge branch 'master' into merge-master-into-release-2.0a 2020-11-22 23:38:53 -08:00
dependabot-preview[bot]
165eae3296 Update webpki-roots requirement from 0.20 to 0.21 (#247)
Updates the requirements on [webpki-roots](https://github.com/ctz/webpki-roots) to permit the latest version.
- [Release notes](https://github.com/ctz/webpki-roots/releases)
- [Commits](https://github.com/ctz/webpki-roots/compare/v/0.20.0...v/0.21.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
2020-11-22 23:24:33 -08:00
dependabot-preview[bot]
f69725edc4 Update rustls-native-certs requirement from 0.4 to 0.5 (#248)
Updates the requirements on [rustls-native-certs](https://github.com/ctz/rustls-native-certs) to permit the latest version.
- [Release notes](https://github.com/ctz/rustls-native-certs/releases)
- [Commits](https://github.com/ctz/rustls-native-certs/compare/v/0.4.0...v/0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-22 23:23:21 -08:00
dependabot-preview[bot]
f1cfea538d Update rustls requirement from 0.18 to 0.19 (#246)
Updates the requirements on [rustls](https://github.com/ctz/rustls) to permit the latest version.
- [Release notes](https://github.com/ctz/rustls/releases)
- [Changelog](https://github.com/ctz/rustls/blob/main/OLDCHANGES.md)
- [Commits](https://github.com/ctz/rustls/compare/v/0.18.0...v/0.19.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-22 23:23:12 -08:00
Jacob Hoffman-Andrews
cc7ce757bd Update CHANGELOG, Cargo.toml, and docs for 2.0. 2020-11-22 11:09:32 -08:00
Jacob Hoffman-Andrews
1c41da87f0 Merge branch 'master' into merge-master-into-release-2.0 2020-11-22 10:25:13 -08:00
Jacob Hoffman-Andrews
a300ccdaad Update README and docs.
This makes src/lib.rs the primary source for crate-level documentation.
I've generated README.md with `cargo readme > README.md`. Since links to
specific documentation items should be relative when possible, but must
be absolute in README.md, I've used the new syntax for intra-rustdoc
links
(https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md),
along with a README.tpl that sets up those links to point at the
absolute versions. `cargo readme` uses the README.tpl by default.

I've also rewritten the crate level docs, removing some TODO information
at the bottom, and moving the license information to CONTRIBUTING.md.
2020-11-15 22:58:02 -08:00
Jacob Hoffman-Andrews
a0b901f35b Remove qstring dependency. (#221)
Instead, rely on Url's built-in query parameter handling. A Request now
accumulates a list of query param pairs, and joins them with a parsed
URL at the time do_call is called.

In the process, remove some getters that rely on parsing the URL.
Adapting these getters was going to be awkward, and they mostly
duplicate things people can readily get by parsing the URL.
2020-11-13 00:02:52 -08:00
Jacob Hoffman-Andrews
c2d4e527a9 1.5.1 2020-11-08 20:58:11 -08:00
Jacob Hoffman-Andrews
9484d86584 Merge branch 'release-2.0' into rm-rayon 2020-10-29 00:18:43 -07:00
Jacob Hoffman-Andrews
a52c6021cf Merge branch 'master' into release-2.0 2020-10-25 14:07:32 -07:00
Martin Algesten
1369c32351 API changes for 2.0
* Remove Request::build
* All mutations on Request follow builder pattern

The previous `build()` on request was necessary because mutating
functions did not follow a proper builder pattern (taking `&mut self`
instead of `mut self`). With a proper builder pattern, the need for
`.build()` goes away.

* All Request body and call methods consume self

Anything which "executes" the request will now consume the `Request`
to produce a `Result<Response>`.

* Move all config from request to agent builder

Timeouts, redirect config, proxy settings and TLS config are now on
`AgentBuilder`.

* Rename max_pool_connections -> max_idle_connections
* Rename max_pool_connections_per_host ->  max_idle_connections_per_host

Consistent internal and external naming.

* Introduce new AgentConfig for static config created by builder.

`Agent` can be seen as having two parts. Static config and a mutable
shared state between all states. The static config goes into
`AgentConfig` and the mutable shared state into `AgentState`.

* Replace all use of `Default` for `new`.

Deriving or implementing `Default` makes for a secondary instantiation
API.  It is useful in some cases, but gets very confusing when there
is both `new` _and_ a `Default`. It's especially devious for derived
values where a reasonable default is not `0`, `false` or `None`.

* Remove feature native_tls, we want only native rustls.

This feature made for very clunky handling throughout the code. From a
security point of view, it's better to stick with one single TLS API.
Rustls recently got an official audit (very positive).

https://github.com/ctz/rustls/tree/master/audit

Rustls deliberately omits support for older, insecure TLS such as TLS
1.1 or RC4. This might be a problem for a user of ureq, but on balance
not considered important enough to keep native_tls.

* Remove auth and support for basic auth.

The API just wasn't enough. A future reintroduction should at least
also provide a `Bearer` mechanism and possibly more.

* Rename jar -> cookie_store
* Rename jar -> cookie_tin

Just make some field names sync up with the type.

* Drop "cookies" as default feature

The need for handling cookies is probably rare, let's not enable it by
default.

* Change all feature checks for "cookie" to "cookies"

The outward facing feature is "cookies" and I think it's better form
that the code uses the official feature name instead of the optional
library "cookies".

* Keep `set` on Agent level as well as AgentBuilder.

The idea is that an auth exchange might result in a header that need
to be set _after_ the agent has been built.
2020-10-25 11:47:38 +01:00
Jacob Hoffman-Andrews
304981377b Restore serde dev_dependency. 2020-10-24 10:04:55 -07:00
Jacob Hoffman-Andrews
1c5dcc0096 Remove some dev-dependencies.
We don't really need rayon for the parallelism in smoke-test.

Also, now that we use log, smoke-test can just use that.
2020-10-22 22:55:16 -07:00
dependabot-preview[bot]
bd2761e280 Update env_logger requirement from 0.7.1 to 0.8.1
Updates the requirements on [env_logger](https://github.com/env-logger-rs/env_logger) to permit the latest version.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.7.1...v0.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-19 09:11:35 +02:00
Jacob Hoffman-Andrews
0f083a4436 Add jsha to Authors list.
Per suggestion by Martin. :-)
2020-10-18 11:30:38 +02:00
Martin Algesten
e763446d72 1.5.1 2020-10-06 10:06:36 +02:00
Jacob Hoffman-Andrews
2d4b42e298 Use cookie_store crate instead of cookie::CookieJar (#169)
CookieJar doesn't support the path-match and domain-match algorithms from [RFC 6265](https://tools.ietf.org/html/rfc6265#section-5.1.3), while cookie_store does.

This fixes some issues with the cookie matching algorithm currently in ureq. For instance,
the domain-match uses substring matching rather than the RFC 6265 algorithm.

This deletes two tests:

match_cookies_returns_nothing_when_no_cookies didn't test much
agent_cookies was failing because cookie_store rejects cookies on the `test:` scheme.
  The way around this is to set up a testserver - but it turns out cookies_on_redirect already
  does that, and covers the same cases and more.

This changes some cookie-related behavior:

 - Cookies could previously be sent to a wrong domain - e.g. a cookie set on `example.com`
  could go to `example.com.evil.com` or `evilexample.com`. Probably no one was relying on
  this, since it's quite broken.
 - A cookie with a path of `/foo` could be sent on a request to `/foobar`, but now it can't.
 - Cookies could previously be set on IP addresses, but now they can't.
 - Cookies could previously be set for domains other than the one on the request (or its
  parents), but now they can't.
 - When a cookie had no domain attribute, it would previously get the domain from the
  request, and subsequently be sent to that domain and all subdomains. Now, it will only
  be sent to that exact domain (host-only).

That last one is probably the most likely to break people, since someone could depend
on it without realizing it was broken behavior.
2020-10-04 10:21:09 -07:00
Martin Algesten
0bf981031b Replace lazy_static! with once_cell Lazy (#176)
Modern rust code bases prefer once_cell::sync::Lazy over the older
macro based lazy_static.
2020-10-04 09:35:31 -07:00
dependabot-preview[bot]
b8d02f9785 Update base64 requirement from 0.12 to 0.13
Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version.
- [Release notes](https://github.com/marshallpierce/rust-base64/releases)
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.12.0...v0.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-03 10:44:31 +02:00
Martin Algesten
573b175cf7 1.5.0 2020-09-29 11:12:00 +02:00
Jacob Hoffman-Andrews
06d6435374 Merge branch 'master' of https://github.com/algesten/ureq into cookie_store 2020-09-29 01:45:52 -07:00
Jacob Hoffman-Andrews
9300c50461 Make cookie_store optional 2020-09-29 01:45:26 -07:00
Jacob Hoffman-Andrews
065b560dfb Add log dependency. (#170)
Also add log statements to unit. Each request gets one info line;
retries, redirects, and responses get logged at debug level.
2020-09-29 01:37:39 -07:00
Jacob Hoffman-Andrews
9b39e55d1c Use cookie_store 2020-09-29 00:34:29 -07:00
Martin Algesten
b8b67a41a9 1.4.1 2020-09-13 21:46:49 +02:00
Martin Algesten
960c0ff43b 1.4.0 2020-08-14 23:08:08 +02:00
dependabot-preview[bot]
81aab6e79a Update rustls requirement from 0.17 to 0.18 (#112)
Updates the requirements on [rustls](https://github.com/ctz/rustls) to permit the latest version.
- [Release notes](https://github.com/ctz/rustls/releases)
- [Changelog](https://github.com/ctz/rustls/blob/main/OLDCHANGES.md)
- [Commits](https://github.com/ctz/rustls/compare/v/0.17.0...v/0.18.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-08 08:43:17 -07:00