Commit Graph
18 Commits
Author SHA1 Message Date
Dirkjan Ochtman 18db31f204 Manage all external dependencies at the workspace level 2024-11-13 13:50:27 -07:00
Dirkjan Ochtman 6c37410042 Use a workspace dependency for serde 2024-10-15 06:04:53 -07:00
Wez Furlong c824985042 deps: upgrade http ecosystem crates so that we're on rusttls 0.23
The blocker for this was axum-server which has been holding us back
for a while. There is now a released version with rustls 0.23 support,
so bump up the various crates in the ecosystem.
2024-09-02 10:42:15 -07:00
Wez Furlong ec795b71d3 mod-http: add client:close() method
Allows explicit closure of any cached connections in the client
object.

Make use of this in the log_hooks:new_json method.
2024-07-09 13:57:46 -07:00
Wez Furlong c524ef5d11 deps: upgrade mlua from 0.8 -> 0.9
I've been holding off on this for a while, because I remember
this upgrade being a bit of a PITA for wezterm.  Since then
there is a `derive(FromLua)` that makes the transition much
easier.

This upgrade makes it potentially a bit easier/nicer/cheaper for
memoize, because it is now possible to retrieve references to userdata
values (rather than always cloning them), but I haven't done anything
special to take advantage of that in this commit.
2024-06-28 17:28:42 -07:00
Wez Furlong f890b16cd2 remove a duplicate rustls from the build graph 2024-05-23 07:47:38 -07:00
Wez Furlong b4aa4a38ec http: allow controlling some timeout and diagnostics on the client
Adds a couple of options that provide more control over the default
timeouts and logging.

These are exposed to the shaping helper as `publish_timeout`,
`publish_pool_idle_timeout` and `publish_connection_verbose`.
2024-04-19 07:44:19 -07:00
Wez Furlong be80391239 add kumo.http.connect_websocket
refs: https://github.com/KumoCorp/kumomta/issues/113
2024-03-28 07:14:35 -07:00
Wez Furlong 584334e30b deps: make reqwest a workspace dependency 2024-03-26 06:46:07 -07:00
Wez Furlong 580be2c4aa kumo.http: add a default 1 minute timeout to requests
Add a timeout method to control the request duration explicitly.
2024-01-13 07:08:54 -07:00
Wez Furlong d843579d1e refactor: control some dep versions via workspace Cargo.toml
This makes it easier to upgrade the version holistically later.
2023-08-17 10:49:25 -07:00
Wez Furlong 26df91729d http: allow explicitly marking a parameter as a file upload
```lua
request:form_multipart_data {
  to = message:recipient().email,
  message = {
    data = message:get_data(),
    file_name = "mime.msg",
  }
}
```
2023-06-29 07:36:18 -07:00
Wez Furlong 0c70ab2c52 improve error message when converting lua -> rust types
refs: https://github.com/KumoCorp/kumomta/issues/56
2023-06-14 20:14:14 -07:00
Wez Furlong 3d6aa1a49d use rustls for reqwest http client
This is a bit of a PITA.

In the docker build we end up with some bad linkage on libssl.so.1.1
on Ubuntu. That is the legacy ssl library, to which we should not
have been able to link, and for which there are no apt installable
sources.

See
<https://askubuntu.com/questions/1465498/update-libssl-so-1-1-for-the-latest-version>

Looking at the deps, the source of this linkage is the new HTTP
client bindings.

This commit dances around this issue by using the rustls implementation
for the client instead.

It's possible that this won't be sufficient, but it at least removes
the openssl linkage issue as a source of headaches for now.
2023-05-15 08:59:49 -07:00
Wez Furlong 9bc92b9a73 rustfmt 2023-05-08 15:21:00 -07:00
Wez Furlong 0211b03060 http: add helpers for constructing form data
refs: https://github.com/KumoCorp/kumomta/issues/36
2023-05-08 15:06:09 -07:00
Wez Furlong 001ba6d46f http: allow inspecting status even after the body has been read 2023-05-08 09:09:04 -07:00
Wez Furlong 5dfa6e5865 add http client module
```lua
  local response = kumo.http
    .build_client({})
    :get('https://example.com/')
    :send()
  print(response:status_code(), response:status_reason())
  for k, v in pairs(response:headers()) do
    print("Header", k, v)
  end
  print(response:text())
```
2023-05-05 14:26:09 -07:00