Commit Graph

171 Commits

Author SHA1 Message Date
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
dependabot-preview[bot]
06aa1eb63a Update rustls-native-certs requirement from 0.3 to 0.4 (#111)
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.3.0...v/0.4.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:42:28 -07:00
dependabot-preview[bot]
6e69f6cf69 Update cookie requirement from 0.13 to 0.14
Updates the requirements on [cookie](https://github.com/SergioBenitez/cookie-rs) to permit the latest version.
- [Release notes](https://github.com/SergioBenitez/cookie-rs/releases)
- [Changelog](https://github.com/SergioBenitez/cookie-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/SergioBenitez/cookie-rs/compare/0.13.0...0.14.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-01 10:55:27 +02:00
dependabot-preview[bot]
c9ccbd5f09 Update webpki-roots requirement from 0.19 to 0.20 (#100)
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.19.0...v/0.20.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-06-30 19:17:19 -07:00
Jacob Hoffman-Andrews
3f78953874 Add a GitHub action for building docs. (#89)
This helps ensure we don't break that doc build.
2020-06-24 21:20:07 +02:00
Martin Algesten
4e1e3d1ad4 Make features to use for docs.rs build explicit (#90)
Since tls and native-tls are mutually exclusive, we can't use
all-features anymore. Instead we enumerate the features needed to
build the docs for docs.rs.
2020-06-24 09:37:15 -07:00
Jacob Hoffman-Andrews
3cb178ed7c 1.3.0 (#83)
1.3.0
2020-06-24 09:14:00 +02:00
Jacob Hoffman-Andrews
a6e99c8b36 Add smoke test in examples. (#85)
This loads a list of top domain names (e.g. from
https://tranco-list.eu/) and tries to fetch them all, in parallel. This
can be used to exercise ureq and find panics.
2020-06-23 21:09:09 -07:00
Jacob Hoffman-Andrews
bc2cb57e64 Increase chunked_transfer dependency 2020-06-16 10:04:52 +02:00
Martin Algesten
787b11b1e4 1.2.0 2020-06-15 09:38:50 +02:00
k3d3
9f7f712dde Add optional native-tls support, clear up warnings for flag configurations 2020-06-15 09:25:49 +02:00
Martin Algesten
0b6323df44 1.1.2 2020-06-12 22:01:02 +02:00
Martin Algesten
f03995a72f 1.1.1 2020-05-23 08:57:50 +02:00
Martin Algesten
8c1068d40d 1.1.0 2020-05-20 21:29:20 +02:00
Paolo Barbolini
71a9df17e3 Correctly pass --all-features flag to docs.rs 2020-05-20 20:54:43 +02:00
Martin Algesten
bbfd125025 1.0.0 2020-05-06 13:57:01 +02:00
Paolo Barbolini
0b69c595b6 Make Response::into_json deserialize into a serde DeserializeOwned
This removes the necessity to take the result of Response::into_json and
having to convert it into a struct by using serde_json::from_value

This adds no new dependencies since serde_json already depends on serde.
Users of ureq will have to include `serde_derive` either by importing it
directly or by using serde with the `derive` feature, unless they want to
manually implement `Deserialize` on their structs.
2020-05-06 13:47:37 +02:00
sklv
05ce690ebd Add initial SOCKS5 support. 2020-04-18 11:47:30 +02:00